| |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><title>Python: module gdata.contacts.client</title> |
| </head><body bgcolor="#f0f0f8"> |
| |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| <tr bgcolor="#7799ee"> |
| <td valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="gdata.html"><font color="#ffffff">gdata</font></a>.<a href="gdata.contacts.html"><font color="#ffffff">contacts</font></a>.client</strong></big></big></font></td |
| ><td align=right valign=bottom |
| ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/contacts/client.py">/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/contacts/client.py</a></font></td></tr></table> |
| <p><tt># Copyright (C) 2009 Google Inc.<br> |
| #<br> |
| # Licensed under the Apache License, Version 2.0 (the "License");<br> |
| # you may not use this file except in compliance with the License.<br> |
| # You may obtain a copy of the License at<br> |
| #<br> |
| # <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a><br> |
| #<br> |
| # Unless required by applicable law or agreed to in writing, software<br> |
| # distributed under the License is distributed on an "AS IS" BASIS,<br> |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br> |
| # See the License for the specific language governing permissions and<br> |
| # limitations under the License.</tt></p> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#aa55cc"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="atom.html">atom</a><br> |
| </td><td width="25%" valign=top><a href="gdata.html">gdata</a><br> |
| </td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ee77aa"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| <td width="100%"><dl> |
| <dt><font face="helvetica, arial"><a href="gdata.client.html#GDClient">gdata.client.GDClient</a>(<a href="atom.client.html#AtomPubClient">atom.client.AtomPubClient</a>) |
| </font></dt><dd> |
| <dl> |
| <dt><font face="helvetica, arial"><a href="gdata.contacts.client.html#ContactsClient">ContactsClient</a> |
| </font></dt></dl> |
| </dd> |
| <dt><font face="helvetica, arial"><a href="gdata.client.html#Query">gdata.client.Query</a>(<a href="__builtin__.html#object">__builtin__.object</a>) |
| </font></dt><dd> |
| <dl> |
| <dt><font face="helvetica, arial"><a href="gdata.contacts.client.html#ContactsQuery">ContactsQuery</a> |
| </font></dt><dt><font face="helvetica, arial"><a href="gdata.contacts.client.html#ProfilesQuery">ProfilesQuery</a> |
| </font></dt></dl> |
| </dd> |
| </dl> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="ContactsClient">class <strong>ContactsClient</strong></a>(<a href="gdata.client.html#GDClient">gdata.client.GDClient</a>)</font></td></tr> |
| |
| <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> |
| <td width="100%"><dl><dt>Method resolution order:</dt> |
| <dd><a href="gdata.contacts.client.html#ContactsClient">ContactsClient</a></dd> |
| <dd><a href="gdata.client.html#GDClient">gdata.client.GDClient</a></dd> |
| <dd><a href="atom.client.html#AtomPubClient">atom.client.AtomPubClient</a></dd> |
| <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="ContactsClient-AddContact"><strong>AddContact</strong></a> = <a href="#ContactsClient-add_contact">add_contact</a>(self, new_contact, insert_uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, billing_information<font color="#909090">=None</font>, birthday<font color="#909090">=None</font>, calendar_link<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-ChangePhoto"><strong>ChangePhoto</strong></a> = <a href="#ContactsClient-change_photo">change_photo</a>(self, media, contact_entry_or_url, content_type<font color="#909090">=None</font>, content_length<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-CreateContact"><strong>CreateContact</strong></a> = <a href="#ContactsClient-create_contact">create_contact</a>(self, new_contact, insert_uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-CreateGroup"><strong>CreateGroup</strong></a> = <a href="#ContactsClient-create_group">create_group</a>(self, new_group, insert_uri<font color="#909090">=None</font>, url_params<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-DeleteGroup"><strong>DeleteGroup</strong></a> = <a href="#ContactsClient-delete_group">delete_group</a>(self, group_object, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, **kws)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-DeletePhoto"><strong>DeletePhoto</strong></a> = <a href="#ContactsClient-delete_photo">delete_photo</a>(self, contact_entry_or_url, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-ExecuteBatch"><strong>ExecuteBatch</strong></a> = <a href="#ContactsClient-execute_batch">execute_batch</a>(self, batch_feed, url<font color="#909090">='https://www.google.com/m8/feeds/contacts/default/full/batch'</font>, desired_class<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-ExecuteBatchProfiles"><strong>ExecuteBatchProfiles</strong></a> = <a href="#ContactsClient-execute_batch_profiles">execute_batch_profiles</a>(self, batch_feed, url<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.ProfilesFeed'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetContact"><strong>GetContact</strong></a> = <a href="#ContactsClient-get_contact">get_contact</a>(self, uri, desired_class<font color="#909090">=<class 'gdata.contacts.data.ContactEntry'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetContacts"><strong>GetContacts</strong></a> = <a href="#ContactsClient-get_contacts">get_contacts</a>(self, uri<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.ContactsFeed'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetFeedUri"><strong>GetFeedUri</strong></a> = <a href="#ContactsClient-get_feed_uri">get_feed_uri</a>(self, kind<font color="#909090">='contacts'</font>, contact_list<font color="#909090">=None</font>, projection<font color="#909090">='full'</font>, scheme<font color="#909090">='https'</font>)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetGroup"><strong>GetGroup</strong></a> = <a href="#ContactsClient-get_group">get_group</a>(self, uri<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.GroupEntry'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetGroups"><strong>GetGroups</strong></a> = <a href="#ContactsClient-get_groups">get_groups</a>(self, uri<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.GroupsFeed'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetPhoto"><strong>GetPhoto</strong></a> = <a href="#ContactsClient-get_photo">get_photo</a>(self, contact_entry_or_url, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetProfile"><strong>GetProfile</strong></a> = <a href="#ContactsClient-get_profile">get_profile</a>(self, uri, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetProfilesFeed"><strong>GetProfilesFeed</strong></a> = <a href="#ContactsClient-get_profiles_feed">get_profiles_feed</a>(self, uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-UpdateGroup"><strong>UpdateGroup</strong></a> = <a href="#ContactsClient-update_group">update_group</a>(self, edit_uri, updated_group, url_params<font color="#909090">=None</font>, escape_params<font color="#909090">=True</font>, desired_class<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-UpdateProfile"><strong>UpdateProfile</strong></a> = <a href="#ContactsClient-update_profile">update_profile</a>(self, updated_profile, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-__init__"><strong>__init__</strong></a>(self, domain<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Constructs a new client for the Email Settings API.<br> |
| <br> |
| Args:<br> |
| domain: string The Google Apps domain (if any).<br> |
| kwargs: The other parameters to pass to the gdata.client.<a href="gdata.client.html#GDClient">GDClient</a><br> |
| constructor.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-add_contact"><strong>add_contact</strong></a>(self, new_contact, insert_uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, billing_information<font color="#909090">=None</font>, birthday<font color="#909090">=None</font>, calendar_link<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Adds an new contact to Google Contacts.<br> |
| <br> |
| Args:<br> |
| new_contact: atom.Entry or subclass A new contact which is to be added to<br> |
| Google Contacts.<br> |
| insert_uri: the URL to post new contacts to the feed<br> |
| url_params: dict (optional) Additional URL parameters to be included<br> |
| in the insertion request.<br> |
| escape_params: boolean (optional) If true, the url_parameters will be<br> |
| escaped before they are included in the request.<br> |
| <br> |
| Returns:<br> |
| On successful insert, an entry containing the contact created<br> |
| On failure, a RequestError is raised of the form:<br> |
| {'status': HTTP status code from server,<br> |
| 'reason': HTTP reason from the server,<br> |
| 'body': HTTP body of the server's response}</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-change_photo"><strong>change_photo</strong></a>(self, media, contact_entry_or_url, content_type<font color="#909090">=None</font>, content_length<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Change the photo for the contact by uploading a new photo.<br> |
| <br> |
| Performs a PUT against the photo edit URL to send the binary data for the<br> |
| photo.<br> |
| <br> |
| Args:<br> |
| media: filename, file-like-object, or a gdata.data.MediaSource object to send.<br> |
| contact_entry_or_url: ContactEntry or str If it is a ContactEntry, this<br> |
| method will search for an edit photo link URL and<br> |
| perform a PUT to the URL.<br> |
| content_type: str (optional) the mime type for the photo data. This is<br> |
| necessary if media is a file or file name, but if media<br> |
| is a MediaSource object then the media object can contain<br> |
| the mime type. If media_type is set, it will override the<br> |
| mime type in the media object.<br> |
| content_length: int or str (optional) Specifying the content length is<br> |
| only required if media is a file-like object. If media<br> |
| is a filename, the length is determined using<br> |
| os.path.getsize. If media is a MediaSource object, it is<br> |
| assumed that it already contains the content length.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-create_contact"><strong>create_contact</strong></a>(self, new_contact, insert_uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Adds an new contact to Google Contacts.<br> |
| <br> |
| Args:<br> |
| new_contact: atom.Entry or subclass A new contact which is to be added to<br> |
| Google Contacts.<br> |
| insert_uri: the URL to post new contacts to the feed<br> |
| url_params: dict (optional) Additional URL parameters to be included<br> |
| in the insertion request.<br> |
| escape_params: boolean (optional) If true, the url_parameters will be<br> |
| escaped before they are included in the request.<br> |
| <br> |
| Returns:<br> |
| On successful insert, an entry containing the contact created<br> |
| On failure, a RequestError is raised of the form:<br> |
| {'status': HTTP status code from server,<br> |
| 'reason': HTTP reason from the server,<br> |
| 'body': HTTP body of the server's response}</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-create_group"><strong>create_group</strong></a>(self, new_group, insert_uri<font color="#909090">=None</font>, url_params<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-delete_group"><strong>delete_group</strong></a>(self, group_object, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, **kws)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-delete_photo"><strong>delete_photo</strong></a>(self, contact_entry_or_url, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Delete the contact's profile photo.<br> |
| <br> |
| Args:<br> |
| contact_entry_or_url: a gdata.contacts.ContactEntry object or a string<br> |
| containing the photo link's URL.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-execute_batch"><strong>execute_batch</strong></a>(self, batch_feed, url<font color="#909090">='https://www.google.com/m8/feeds/contacts/default/full/batch'</font>, desired_class<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Sends a batch request feed to the server.<br> |
| <br> |
| Args:<br> |
| batch_feed: gdata.contacts.ContactFeed A feed containing batch<br> |
| request entries. Each entry contains the operation to be performed<br> |
| on the data contained in the entry. For example an entry with an<br> |
| operation type of insert will be used as if the individual entry<br> |
| had been inserted.<br> |
| url: str The batch URL to which these operations should be applied.<br> |
| converter: Function (optional) The function used to convert the server's<br> |
| response to an object.<br> |
| <br> |
| Returns:<br> |
| The results of the batch request's execution on the server. If the<br> |
| default converter is used, this is stored in a ContactsFeed.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-execute_batch_profiles"><strong>execute_batch_profiles</strong></a>(self, batch_feed, url<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.ProfilesFeed'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Sends a batch request feed to the server.<br> |
| <br> |
| Args:<br> |
| batch_feed: gdata.profiles.ProfilesFeed A feed containing batch<br> |
| request entries. Each entry contains the operation to be performed<br> |
| on the data contained in the entry. For example an entry with an<br> |
| operation type of insert will be used as if the individual entry<br> |
| had been inserted.<br> |
| url: string The batch URL to which these operations should be applied.<br> |
| converter: Function (optional) The function used to convert the server's<br> |
| response to an object. The default value is<br> |
| gdata.profiles.ProfilesFeedFromString.<br> |
| <br> |
| Returns:<br> |
| The results of the batch request's execution on the server. If the<br> |
| default converter is used, this is stored in a ProfilesFeed.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_contact"><strong>get_contact</strong></a>(self, uri, desired_class<font color="#909090">=<class 'gdata.contacts.data.ContactEntry'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-get_contacts"><strong>get_contacts</strong></a>(self, uri<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.ContactsFeed'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Obtains a feed with the contacts belonging to the current user.<br> |
| <br> |
| Args:<br> |
| auth_token: An object which sets the Authorization HTTP header in its<br> |
| modify_request method. Recommended classes include<br> |
| gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken<br> |
| among others. Represents the current user. Defaults to None<br> |
| and if None, this method will look for a value in the<br> |
| auth_token member of SpreadsheetsClient.<br> |
| desired_class: class descended from atom.core.XmlElement to which a<br> |
| successful response should be converted. If there is no<br> |
| converter function specified (desired_class=None) then the<br> |
| desired_class will be used in calling the<br> |
| atom.core.parse function. If neither<br> |
| the desired_class nor the converter is specified, an<br> |
| HTTP reponse object will be returned. Defaults to<br> |
| gdata.spreadsheets.data.SpreadsheetsFeed.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_feed_uri"><strong>get_feed_uri</strong></a>(self, kind<font color="#909090">='contacts'</font>, contact_list<font color="#909090">=None</font>, projection<font color="#909090">='full'</font>, scheme<font color="#909090">='https'</font>)</dt><dd><tt>Builds a feed URI.<br> |
| <br> |
| Args:<br> |
| kind: The type of feed to return, typically 'groups' or 'contacts'.<br> |
| Default value: 'contacts'.<br> |
| contact_list: The contact list to return a feed for.<br> |
| Default value: self.<strong>contact_list</strong>.<br> |
| projection: The projection to apply to the feed contents, for example<br> |
| 'full', 'base', 'base/12345', 'full/batch'. Default value: 'full'.<br> |
| scheme: The URL scheme such as 'http' or 'https', None to return a<br> |
| relative URI without hostname.<br> |
| <br> |
| Returns:<br> |
| A feed URI using the given kind, contact list, and projection.<br> |
| Example: '/m8/feeds/contacts/default/full'.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_group"><strong>get_group</strong></a>(self, uri<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.GroupEntry'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Get a single groups details<br> |
| Args:<br> |
| uri: the group uri or id</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_groups"><strong>get_groups</strong></a>(self, uri<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.contacts.data.GroupsFeed'></font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-get_photo"><strong>get_photo</strong></a>(self, contact_entry_or_url, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Retrives the binary data for the contact's profile photo as a string.<br> |
| <br> |
| Args:<br> |
| contact_entry_or_url: a gdata.contacts.ContactEntry object or a string<br> |
| containing the photo link's URL. If the contact entry does not<br> |
| contain a photo link, the image will not be fetched and this method<br> |
| will return None.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_profile"><strong>get_profile</strong></a>(self, uri, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Retrieves a domain's profile for the user.<br> |
| <br> |
| Args:<br> |
| uri: string the URL to retrieve the profiles feed,<br> |
| for example /m8/feeds/profiles/default/full/username<br> |
| <br> |
| Returns:<br> |
| On success, a ProfileEntry containing the profile for the user.<br> |
| On failure, raises a RequestError</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_profiles_feed"><strong>get_profiles_feed</strong></a>(self, uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Retrieves a feed containing all domain's profiles.<br> |
| <br> |
| Args:<br> |
| uri: string (optional) the URL to retrieve the profiles feed,<br> |
| for example /m8/feeds/profiles/default/full<br> |
| <br> |
| Returns:<br> |
| On success, a ProfilesFeed containing the profiles.<br> |
| On failure, raises a RequestError.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-update_group"><strong>update_group</strong></a>(self, edit_uri, updated_group, url_params<font color="#909090">=None</font>, escape_params<font color="#909090">=True</font>, desired_class<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-update_profile"><strong>update_profile</strong></a>(self, updated_profile, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, **kwargs)</dt><dd><tt>Updates an existing profile.<br> |
| <br> |
| Args:<br> |
| updated_profile: atom.Entry or subclass containing<br> |
| the Atom Entry which will replace the profile which is<br> |
| stored at the edit_url.<br> |
| auth_token: An object which sets the Authorization HTTP header in its<br> |
| modify_request method. Recommended classes include<br> |
| gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken<br> |
| among others. Represents the current user. Defaults to None<br> |
| and if None, this method will look for a value in the<br> |
| auth_token member of <a href="#ContactsClient">ContactsClient</a>.<br> |
| force: boolean stating whether an update should be forced. Defaults to<br> |
| False. Normally, if a change has been made since the passed in<br> |
| entry was obtained, the server will not overwrite the entry since<br> |
| the changes were based on an obsolete version of the entry.<br> |
| Setting force to True will cause the update to silently<br> |
| overwrite whatever version is present.<br> |
| url_params: dict (optional) Additional URL parameters to be included<br> |
| in the insertion request.<br> |
| escape_params: boolean (optional) If true, the url_parameters will be<br> |
| escaped before they are included in the request.<br> |
| <br> |
| Returns:<br> |
| On successful update, a httplib.HTTPResponse containing the server's<br> |
| response to the PUT request.<br> |
| On failure, raises a RequestError.</tt></dd></dl> |
| |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>api_version</strong> = '3'</dl> |
| |
| <dl><dt><strong>auth_scopes</strong> = ('https://www.google.com/m8/feeds/', 'http://www.google.com/m8/feeds/')</dl> |
| |
| <dl><dt><strong>auth_service</strong> = 'cp'</dl> |
| |
| <dl><dt><strong>contact_list</strong> = 'default'</dl> |
| |
| <dl><dt><strong>server</strong> = 'www.google.com'</dl> |
| |
| <dl><dt><strong>ssl</strong> = True</dl> |
| |
| <hr> |
| Methods inherited from <a href="gdata.client.html#GDClient">gdata.client.GDClient</a>:<br> |
| <dl><dt><a name="ContactsClient-Batch"><strong>Batch</strong></a> = batch(self, feed, uri<font color="#909090">=None</font>, force<font color="#909090">=False</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Sends a batch request to the server to execute operation entries.<br> |
| <br> |
| Args:<br> |
| feed: A batch feed containing batch entries, each is an operation.<br> |
| uri: (optional) The uri to which the batch request feed should be POSTed.<br> |
| If none is provided, then the feed's edit link will be used.<br> |
| force: (optional) boolean set to True if you want the batch update to<br> |
| clobber all data. If False, the version in the information in the<br> |
| feed object will cause the server to check to see that no changes<br> |
| intervened between when you fetched the data and when you sent the<br> |
| changes.<br> |
| auth_token: (optional) An object which sets the Authorization HTTP header<br> |
| in its modify_request method. Recommended classes include<br> |
| gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken<br> |
| among others.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-ClientLogin"><strong>ClientLogin</strong></a> = client_login(self, email, password, source, service<font color="#909090">=None</font>, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, auth_url<font color="#909090">=<atom.http_core.Uri object></font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt><dd><tt>Performs an auth request using the user's email address and password.<br> |
| <br> |
| In order to modify user specific data and read user private data, your<br> |
| application must be authorized by the user. One way to demonstrage<br> |
| authorization is by including a Client Login token in the Authorization<br> |
| HTTP header of all requests. This method requests the Client Login token<br> |
| by sending the user's email address, password, the name of the<br> |
| application, and the service code for the service which will be accessed<br> |
| by the application. If the username and password are correct, the server<br> |
| will respond with the client login code and a new ClientLoginToken<br> |
| object will be set in the client's auth_token member. With the auth_token<br> |
| set, future requests from this client will include the Client Login<br> |
| token.<br> |
| <br> |
| For a list of service names, see <br> |
| <a href="http://code.google.com/apis/gdata/faq.html#clientlogin">http://code.google.com/apis/gdata/faq.html#clientlogin</a><br> |
| For more information on Client Login, see:<br> |
| <a href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html">http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html</a><br> |
| <br> |
| Args:<br> |
| email: str The user's email address or username.<br> |
| password: str The password for the user's account.<br> |
| source: str The name of your application. This can be anything you<br> |
| like but should should give some indication of which app is<br> |
| making the request.<br> |
| service: str The service code for the service you would like to access.<br> |
| For example, 'cp' for contacts, 'cl' for calendar. For a full<br> |
| list see<br> |
| <a href="http://code.google.com/apis/gdata/faq.html#clientlogin">http://code.google.com/apis/gdata/faq.html#clientlogin</a><br> |
| If you are using a subclass of the gdata.client.<a href="gdata.client.html#GDClient">GDClient</a>, the<br> |
| service will usually be filled in for you so you do not need<br> |
| to specify it. For example see BloggerClient,<br> |
| SpreadsheetsClient, etc.<br> |
| account_type: str (optional) The type of account which is being<br> |
| authenticated. This can be either 'GOOGLE' for a Google<br> |
| Account, 'HOSTED' for a Google Apps Account, or the<br> |
| default 'HOSTED_OR_GOOGLE' which will select the Google<br> |
| Apps Account if the same email address is used for both<br> |
| a Google Account and a Google Apps Account.<br> |
| auth_url: str (optional) The URL to which the login request should be<br> |
| sent.<br> |
| captcha_token: str (optional) If a previous login attempt was reponded<br> |
| to with a CAPTCHA challenge, this is the token which<br> |
| identifies the challenge (from the CAPTCHA's URL).<br> |
| captcha_response: str (optional) If a previous login attempt was<br> |
| reponded to with a CAPTCHA challenge, this is the<br> |
| response text which was contained in the challenge.<br> |
| <br> |
| Returns:<br> |
| Generated token, which is also stored in this object.<br> |
| <br> |
| Raises:<br> |
| A RequestError or one of its suclasses: BadAuthentication,<br> |
| BadAuthenticationServiceURL, ClientLoginFailed,<br> |
| ClientLoginTokenMissing, or CaptchaChallenge</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-Delete"><strong>Delete</strong></a> = delete(self, entry_or_uri, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetAccessToken"><strong>GetAccessToken</strong></a> = get_access_token(self, request_token, url<font color="#909090">='https://www.google.com/accounts/OAuthGetAccessToken'</font>)</dt><dd><tt>Exchanges an authorized OAuth request token for an access token.<br> |
| <br> |
| Contacts the Google OAuth server to upgrade a previously authorized<br> |
| request token. Once the request token is upgraded to an access token,<br> |
| the access token may be used to access the user's data.<br> |
| <br> |
| For more details, see the Google Accounts OAuth documentation:<br> |
| <a href="http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken">http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken</a><br> |
| <br> |
| Args:<br> |
| request_token: An OAuth token which has been authorized by the user.<br> |
| url: (optional) The URL to which the upgrade request should be sent.<br> |
| Defaults to: https://www.google.com/accounts/OAuthAuthorizeToken</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-GetEntry"><strong>GetEntry</strong></a> = get_entry(self, uri, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.data.GDEntry'></font>, etag<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetFeed"><strong>GetFeed</strong></a> = get_feed(self, uri, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.data.GDFeed'></font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-GetNext"><strong>GetNext</strong></a> = get_next(self, feed, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Fetches the next set of results from the feed.<br> |
| <br> |
| When requesting a feed, the number of entries returned is capped at a<br> |
| service specific default limit (often 25 entries). You can specify your<br> |
| own entry-count cap using the max-results URL query parameter. If there<br> |
| are more results than could fit under max-results, the feed will contain<br> |
| a next link. This method performs a GET against this next results URL.<br> |
| <br> |
| Returns:<br> |
| A new feed object containing the next set of entries in this feed.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-GetOAuthToken"><strong>GetOAuthToken</strong></a> = get_oauth_token(self, scopes, next, consumer_key, consumer_secret<font color="#909090">=None</font>, rsa_private_key<font color="#909090">=None</font>, url<font color="#909090">='https://www.google.com/accounts/OAuthGetRequestToken'</font>)</dt><dd><tt>Obtains an OAuth request token to allow the user to authorize this app.<br> |
| <br> |
| Once this client has a request token, the user can authorize the request<br> |
| token by visiting the authorization URL in their browser. After being<br> |
| redirected back to this app at the 'next' URL, this app can then exchange<br> |
| the authorized request token for an access token.<br> |
| <br> |
| For more information see the documentation on Google Accounts with OAuth:<br> |
| <a href="http://code.google.com/apis/accounts/docs/OAuth.html#AuthProcess">http://code.google.com/apis/accounts/docs/OAuth.html#AuthProcess</a><br> |
| <br> |
| Args:<br> |
| scopes: list of strings or atom.http_core.Uri objects which specify the<br> |
| URL prefixes which this app will be accessing. For example, to access<br> |
| the Google Calendar API, you would want to use scopes:<br> |
| ['https://www.google.com/calendar/feeds/',<br> |
| '<a href="http://www.google.com/calendar/feeds/">http://www.google.com/calendar/feeds/</a>']<br> |
| next: str or atom.http_core.Uri object, The URL which the user's browser<br> |
| should be sent to after they authorize access to their data. This<br> |
| should be a URL in your application which will read the token<br> |
| information from the URL and upgrade the request token to an access<br> |
| token.<br> |
| consumer_key: str This is the identifier for this application which you<br> |
| should have received when you registered your application with Google<br> |
| to use OAuth.<br> |
| consumer_secret: str (optional) The shared secret between your app and<br> |
| Google which provides evidence that this request is coming from you<br> |
| application and not another app. If present, this libraries assumes<br> |
| you want to use an HMAC signature to verify requests. Keep this data<br> |
| a secret.<br> |
| rsa_private_key: str (optional) The RSA private key which is used to<br> |
| generate a digital signature which is checked by Google's server. If<br> |
| present, this library assumes that you want to use an RSA signature<br> |
| to verify requests. Keep this data a secret.<br> |
| url: The URL to which a request for a token should be made. The default<br> |
| is Google's OAuth request token provider.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-ModifyRequest"><strong>ModifyRequest</strong></a> = modify_request(self, http_request)</dt><dd><tt>Adds or changes request before making the HTTP request.<br> |
| <br> |
| This client will add the API version if it is specified.<br> |
| Subclasses may override this method to add their own request<br> |
| modifications before the request is made.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-Post"><strong>Post</strong></a> = post(self, entry, uri, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-Request"><strong>Request</strong></a> = request(self, method<font color="#909090">=None</font>, uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, http_request<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, redirects_remaining<font color="#909090">=4</font>, **kwargs)</dt><dd><tt>Make an HTTP request to the server.<br> |
| <br> |
| See also documentation for atom.client.AtomPubClient.request.<br> |
| <br> |
| If a 302 redirect is sent from the server to the client, this client<br> |
| assumes that the redirect is in the form used by the Google Calendar API.<br> |
| The same request URI and method will be used as in the original request,<br> |
| but a gsessionid URL parameter will be added to the request URI with<br> |
| the value provided in the server's 302 redirect response. If the 302<br> |
| redirect is not in the format specified by the Google Calendar API, a<br> |
| RedirectError will be raised containing the body of the server's<br> |
| response.<br> |
| <br> |
| The method calls the client's modify_request method to make any changes<br> |
| required by the client before the request is made. For example, a<br> |
| version 2 client could add a GData-Version: 2 header to the request in<br> |
| its modify_request method.<br> |
| <br> |
| Args:<br> |
| method: str The HTTP verb for this request, usually 'GET', 'POST',<br> |
| 'PUT', or 'DELETE'<br> |
| uri: atom.http_core.Uri, str, or unicode The URL being requested.<br> |
| auth_token: An object which sets the Authorization HTTP header in its<br> |
| modify_request method. Recommended classes include<br> |
| gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken<br> |
| among others.<br> |
| http_request: (optional) atom.http_core.HttpRequest<br> |
| converter: function which takes the body of the response as its only<br> |
| argument and returns the desired object.<br> |
| desired_class: class descended from atom.core.XmlElement to which a<br> |
| successful response should be converted. If there is no<br> |
| converter function specified (converter=None) then the<br> |
| desired_class will be used in calling the<br> |
| atom.core.parse function. If neither<br> |
| the desired_class nor the converter is specified, an<br> |
| HTTP reponse object will be returned.<br> |
| redirects_remaining: (optional) int, if this number is 0 and the<br> |
| server sends a 302 redirect, the request method<br> |
| will raise an exception. This parameter is used in<br> |
| recursive request calls to avoid an infinite loop.<br> |
| <br> |
| Any additional arguments are passed through to<br> |
| atom.client.AtomPubClient.request.<br> |
| <br> |
| Returns:<br> |
| An HTTP response object (see atom.http_core.HttpResponse for a<br> |
| description of the object's interface) if no converter was<br> |
| specified and no desired_class was specified. If a converter function<br> |
| was provided, the results of calling the converter are returned. If no<br> |
| converter was specified but a desired_class was provided, the response<br> |
| body will be converted to the class using<br> |
| atom.core.parse.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-RequestClientLoginToken"><strong>RequestClientLoginToken</strong></a> = request_client_login_token(self, email, password, source, service<font color="#909090">=None</font>, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, auth_url<font color="#909090">=<atom.http_core.Uri object></font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-RevokeToken"><strong>RevokeToken</strong></a> = revoke_token(self, token<font color="#909090">=None</font>, url<font color="#909090">=<atom.http_core.Uri object></font>)</dt><dd><tt>Requests that the token be invalidated.<br> |
| <br> |
| This method can be used for both AuthSub and OAuth tokens (to invalidate<br> |
| a ClientLogin token, the user must change their password).<br> |
| <br> |
| Returns:<br> |
| True if the server responded with a 200.<br> |
| <br> |
| Raises:<br> |
| A RequestError if the server responds with a non-200 status.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-Update"><strong>Update</strong></a> = update(self, entry, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, uri<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Edits the entry on the server by sending the XML for this entry.<br> |
| <br> |
| Performs a PUT and converts the response to a new entry object with a<br> |
| matching class to the entry passed in.<br> |
| <br> |
| Args:<br> |
| entry:<br> |
| auth_token:<br> |
| force: boolean stating whether an update should be forced. Defaults to<br> |
| False. Normally, if a change has been made since the passed in<br> |
| entry was obtained, the server will not overwrite the entry since<br> |
| the changes were based on an obsolete version of the entry.<br> |
| Setting force to True will cause the update to silently<br> |
| overwrite whatever version is present.<br> |
| uri: The uri to put to. If provided, this uri is PUT to rather than the<br> |
| inferred uri from the entry's edit link.<br> |
| <br> |
| Returns:<br> |
| A new Entry object of a matching type to the entry which was passed in.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-UpgradeToken"><strong>UpgradeToken</strong></a> = upgrade_token(self, token<font color="#909090">=None</font>, url<font color="#909090">=<atom.http_core.Uri object></font>)</dt><dd><tt>Asks the Google auth server for a multi-use AuthSub token.<br> |
| <br> |
| For details on AuthSub, see:<br> |
| <a href="http://code.google.com/apis/accounts/docs/AuthSub.html">http://code.google.com/apis/accounts/docs/AuthSub.html</a><br> |
| <br> |
| Args:<br> |
| token: gdata.gauth.AuthSubToken or gdata.gauth.SecureAuthSubToken<br> |
| (optional) If no token is passed in, the client's auth_token member<br> |
| is used to request the new token. The token object will be modified<br> |
| to contain the new session token string.<br> |
| url: str or atom.http_core.Uri (optional) The URL to which the token<br> |
| upgrade request should be sent. Defaults to:<br> |
| https://www.google.com/accounts/AuthSubSessionToken<br> |
| <br> |
| Returns:<br> |
| The upgraded gdata.gauth.AuthSubToken object.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-batch"><strong>batch</strong></a>(self, feed, uri<font color="#909090">=None</font>, force<font color="#909090">=False</font>, auth_token<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Sends a batch request to the server to execute operation entries.<br> |
| <br> |
| Args:<br> |
| feed: A batch feed containing batch entries, each is an operation.<br> |
| uri: (optional) The uri to which the batch request feed should be POSTed.<br> |
| If none is provided, then the feed's edit link will be used.<br> |
| force: (optional) boolean set to True if you want the batch update to<br> |
| clobber all data. If False, the version in the information in the<br> |
| feed object will cause the server to check to see that no changes<br> |
| intervened between when you fetched the data and when you sent the<br> |
| changes.<br> |
| auth_token: (optional) An object which sets the Authorization HTTP header<br> |
| in its modify_request method. Recommended classes include<br> |
| gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken<br> |
| among others.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-client_login"><strong>client_login</strong></a>(self, email, password, source, service<font color="#909090">=None</font>, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, auth_url<font color="#909090">=<atom.http_core.Uri object></font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt><dd><tt>Performs an auth request using the user's email address and password.<br> |
| <br> |
| In order to modify user specific data and read user private data, your<br> |
| application must be authorized by the user. One way to demonstrage<br> |
| authorization is by including a Client Login token in the Authorization<br> |
| HTTP header of all requests. This method requests the Client Login token<br> |
| by sending the user's email address, password, the name of the<br> |
| application, and the service code for the service which will be accessed<br> |
| by the application. If the username and password are correct, the server<br> |
| will respond with the client login code and a new ClientLoginToken<br> |
| object will be set in the client's auth_token member. With the auth_token<br> |
| set, future requests from this client will include the Client Login<br> |
| token.<br> |
| <br> |
| For a list of service names, see <br> |
| <a href="http://code.google.com/apis/gdata/faq.html#clientlogin">http://code.google.com/apis/gdata/faq.html#clientlogin</a><br> |
| For more information on Client Login, see:<br> |
| <a href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html">http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html</a><br> |
| <br> |
| Args:<br> |
| email: str The user's email address or username.<br> |
| password: str The password for the user's account.<br> |
| source: str The name of your application. This can be anything you<br> |
| like but should should give some indication of which app is<br> |
| making the request.<br> |
| service: str The service code for the service you would like to access.<br> |
| For example, 'cp' for contacts, 'cl' for calendar. For a full<br> |
| list see<br> |
| <a href="http://code.google.com/apis/gdata/faq.html#clientlogin">http://code.google.com/apis/gdata/faq.html#clientlogin</a><br> |
| If you are using a subclass of the gdata.client.<a href="gdata.client.html#GDClient">GDClient</a>, the<br> |
| service will usually be filled in for you so you do not need<br> |
| to specify it. For example see BloggerClient,<br> |
| SpreadsheetsClient, etc.<br> |
| account_type: str (optional) The type of account which is being<br> |
| authenticated. This can be either 'GOOGLE' for a Google<br> |
| Account, 'HOSTED' for a Google Apps Account, or the<br> |
| default 'HOSTED_OR_GOOGLE' which will select the Google<br> |
| Apps Account if the same email address is used for both<br> |
| a Google Account and a Google Apps Account.<br> |
| auth_url: str (optional) The URL to which the login request should be<br> |
| sent.<br> |
| captcha_token: str (optional) If a previous login attempt was reponded<br> |
| to with a CAPTCHA challenge, this is the token which<br> |
| identifies the challenge (from the CAPTCHA's URL).<br> |
| captcha_response: str (optional) If a previous login attempt was<br> |
| reponded to with a CAPTCHA challenge, this is the<br> |
| response text which was contained in the challenge.<br> |
| <br> |
| Returns:<br> |
| Generated token, which is also stored in this object.<br> |
| <br> |
| Raises:<br> |
| A RequestError or one of its suclasses: BadAuthentication,<br> |
| BadAuthenticationServiceURL, ClientLoginFailed,<br> |
| ClientLoginTokenMissing, or CaptchaChallenge</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-delete"><strong>delete</strong></a>(self, entry_or_uri, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-get_access_token"><strong>get_access_token</strong></a>(self, request_token, url<font color="#909090">='https://www.google.com/accounts/OAuthGetAccessToken'</font>)</dt><dd><tt>Exchanges an authorized OAuth request token for an access token.<br> |
| <br> |
| Contacts the Google OAuth server to upgrade a previously authorized<br> |
| request token. Once the request token is upgraded to an access token,<br> |
| the access token may be used to access the user's data.<br> |
| <br> |
| For more details, see the Google Accounts OAuth documentation:<br> |
| <a href="http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken">http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken</a><br> |
| <br> |
| Args:<br> |
| request_token: An OAuth token which has been authorized by the user.<br> |
| url: (optional) The URL to which the upgrade request should be sent.<br> |
| Defaults to: https://www.google.com/accounts/OAuthAuthorizeToken</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_entry"><strong>get_entry</strong></a>(self, uri, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.data.GDEntry'></font>, etag<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-get_feed"><strong>get_feed</strong></a>(self, uri, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=<class 'gdata.data.GDFeed'></font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-get_next"><strong>get_next</strong></a>(self, feed, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Fetches the next set of results from the feed.<br> |
| <br> |
| When requesting a feed, the number of entries returned is capped at a<br> |
| service specific default limit (often 25 entries). You can specify your<br> |
| own entry-count cap using the max-results URL query parameter. If there<br> |
| are more results than could fit under max-results, the feed will contain<br> |
| a next link. This method performs a GET against this next results URL.<br> |
| <br> |
| Returns:<br> |
| A new feed object containing the next set of entries in this feed.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get_oauth_token"><strong>get_oauth_token</strong></a>(self, scopes, next, consumer_key, consumer_secret<font color="#909090">=None</font>, rsa_private_key<font color="#909090">=None</font>, url<font color="#909090">='https://www.google.com/accounts/OAuthGetRequestToken'</font>)</dt><dd><tt>Obtains an OAuth request token to allow the user to authorize this app.<br> |
| <br> |
| Once this client has a request token, the user can authorize the request<br> |
| token by visiting the authorization URL in their browser. After being<br> |
| redirected back to this app at the 'next' URL, this app can then exchange<br> |
| the authorized request token for an access token.<br> |
| <br> |
| For more information see the documentation on Google Accounts with OAuth:<br> |
| <a href="http://code.google.com/apis/accounts/docs/OAuth.html#AuthProcess">http://code.google.com/apis/accounts/docs/OAuth.html#AuthProcess</a><br> |
| <br> |
| Args:<br> |
| scopes: list of strings or atom.http_core.Uri objects which specify the<br> |
| URL prefixes which this app will be accessing. For example, to access<br> |
| the Google Calendar API, you would want to use scopes:<br> |
| ['https://www.google.com/calendar/feeds/',<br> |
| '<a href="http://www.google.com/calendar/feeds/">http://www.google.com/calendar/feeds/</a>']<br> |
| next: str or atom.http_core.Uri object, The URL which the user's browser<br> |
| should be sent to after they authorize access to their data. This<br> |
| should be a URL in your application which will read the token<br> |
| information from the URL and upgrade the request token to an access<br> |
| token.<br> |
| consumer_key: str This is the identifier for this application which you<br> |
| should have received when you registered your application with Google<br> |
| to use OAuth.<br> |
| consumer_secret: str (optional) The shared secret between your app and<br> |
| Google which provides evidence that this request is coming from you<br> |
| application and not another app. If present, this libraries assumes<br> |
| you want to use an HMAC signature to verify requests. Keep this data<br> |
| a secret.<br> |
| rsa_private_key: str (optional) The RSA private key which is used to<br> |
| generate a digital signature which is checked by Google's server. If<br> |
| present, this library assumes that you want to use an RSA signature<br> |
| to verify requests. Keep this data a secret.<br> |
| url: The URL to which a request for a token should be made. The default<br> |
| is Google's OAuth request token provider.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Adds or changes request before making the HTTP request.<br> |
| <br> |
| This client will add the API version if it is specified.<br> |
| Subclasses may override this method to add their own request<br> |
| modifications before the request is made.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-post"><strong>post</strong></a>(self, entry, uri, auth_token<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-request"><strong>request</strong></a>(self, method<font color="#909090">=None</font>, uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, http_request<font color="#909090">=None</font>, converter<font color="#909090">=None</font>, desired_class<font color="#909090">=None</font>, redirects_remaining<font color="#909090">=4</font>, **kwargs)</dt><dd><tt>Make an HTTP request to the server.<br> |
| <br> |
| See also documentation for atom.client.AtomPubClient.request.<br> |
| <br> |
| If a 302 redirect is sent from the server to the client, this client<br> |
| assumes that the redirect is in the form used by the Google Calendar API.<br> |
| The same request URI and method will be used as in the original request,<br> |
| but a gsessionid URL parameter will be added to the request URI with<br> |
| the value provided in the server's 302 redirect response. If the 302<br> |
| redirect is not in the format specified by the Google Calendar API, a<br> |
| RedirectError will be raised containing the body of the server's<br> |
| response.<br> |
| <br> |
| The method calls the client's modify_request method to make any changes<br> |
| required by the client before the request is made. For example, a<br> |
| version 2 client could add a GData-Version: 2 header to the request in<br> |
| its modify_request method.<br> |
| <br> |
| Args:<br> |
| method: str The HTTP verb for this request, usually 'GET', 'POST',<br> |
| 'PUT', or 'DELETE'<br> |
| uri: atom.http_core.Uri, str, or unicode The URL being requested.<br> |
| auth_token: An object which sets the Authorization HTTP header in its<br> |
| modify_request method. Recommended classes include<br> |
| gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken<br> |
| among others.<br> |
| http_request: (optional) atom.http_core.HttpRequest<br> |
| converter: function which takes the body of the response as its only<br> |
| argument and returns the desired object.<br> |
| desired_class: class descended from atom.core.XmlElement to which a<br> |
| successful response should be converted. If there is no<br> |
| converter function specified (converter=None) then the<br> |
| desired_class will be used in calling the<br> |
| atom.core.parse function. If neither<br> |
| the desired_class nor the converter is specified, an<br> |
| HTTP reponse object will be returned.<br> |
| redirects_remaining: (optional) int, if this number is 0 and the<br> |
| server sends a 302 redirect, the request method<br> |
| will raise an exception. This parameter is used in<br> |
| recursive request calls to avoid an infinite loop.<br> |
| <br> |
| Any additional arguments are passed through to<br> |
| atom.client.AtomPubClient.request.<br> |
| <br> |
| Returns:<br> |
| An HTTP response object (see atom.http_core.HttpResponse for a<br> |
| description of the object's interface) if no converter was<br> |
| specified and no desired_class was specified. If a converter function<br> |
| was provided, the results of calling the converter are returned. If no<br> |
| converter was specified but a desired_class was provided, the response<br> |
| body will be converted to the class using<br> |
| atom.core.parse.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-request_client_login_token"><strong>request_client_login_token</strong></a>(self, email, password, source, service<font color="#909090">=None</font>, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, auth_url<font color="#909090">=<atom.http_core.Uri object></font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt></dl> |
| |
| <dl><dt><a name="ContactsClient-revoke_token"><strong>revoke_token</strong></a>(self, token<font color="#909090">=None</font>, url<font color="#909090">=<atom.http_core.Uri object></font>)</dt><dd><tt>Requests that the token be invalidated.<br> |
| <br> |
| This method can be used for both AuthSub and OAuth tokens (to invalidate<br> |
| a ClientLogin token, the user must change their password).<br> |
| <br> |
| Returns:<br> |
| True if the server responded with a 200.<br> |
| <br> |
| Raises:<br> |
| A RequestError if the server responds with a non-200 status.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-update"><strong>update</strong></a>(self, entry, auth_token<font color="#909090">=None</font>, force<font color="#909090">=False</font>, uri<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Edits the entry on the server by sending the XML for this entry.<br> |
| <br> |
| Performs a PUT and converts the response to a new entry object with a<br> |
| matching class to the entry passed in.<br> |
| <br> |
| Args:<br> |
| entry:<br> |
| auth_token:<br> |
| force: boolean stating whether an update should be forced. Defaults to<br> |
| False. Normally, if a change has been made since the passed in<br> |
| entry was obtained, the server will not overwrite the entry since<br> |
| the changes were based on an obsolete version of the entry.<br> |
| Setting force to True will cause the update to silently<br> |
| overwrite whatever version is present.<br> |
| uri: The uri to put to. If provided, this uri is PUT to rather than the<br> |
| inferred uri from the entry's edit link.<br> |
| <br> |
| Returns:<br> |
| A new Entry object of a matching type to the entry which was passed in.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-upgrade_token"><strong>upgrade_token</strong></a>(self, token<font color="#909090">=None</font>, url<font color="#909090">=<atom.http_core.Uri object></font>)</dt><dd><tt>Asks the Google auth server for a multi-use AuthSub token.<br> |
| <br> |
| For details on AuthSub, see:<br> |
| <a href="http://code.google.com/apis/accounts/docs/AuthSub.html">http://code.google.com/apis/accounts/docs/AuthSub.html</a><br> |
| <br> |
| Args:<br> |
| token: gdata.gauth.AuthSubToken or gdata.gauth.SecureAuthSubToken<br> |
| (optional) If no token is passed in, the client's auth_token member<br> |
| is used to request the new token. The token object will be modified<br> |
| to contain the new session token string.<br> |
| url: str or atom.http_core.Uri (optional) The URL to which the token<br> |
| upgrade request should be sent. Defaults to:<br> |
| https://www.google.com/accounts/AuthSubSessionToken<br> |
| <br> |
| Returns:<br> |
| The upgraded gdata.gauth.AuthSubToken object.</tt></dd></dl> |
| |
| <hr> |
| Data and other attributes inherited from <a href="gdata.client.html#GDClient">gdata.client.GDClient</a>:<br> |
| <dl><dt><strong>alt_auth_service</strong> = None</dl> |
| |
| <hr> |
| Methods inherited from <a href="atom.client.html#AtomPubClient">atom.client.AtomPubClient</a>:<br> |
| <dl><dt><a name="ContactsClient-Get"><strong>Get</strong></a> = get(self, uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, http_request<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Performs a request using the GET method, returns an HTTP response.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-Put"><strong>Put</strong></a> = put(self, uri<font color="#909090">=None</font>, data<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, http_request<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Sends data using the PUT method, returns an HTTP response.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-get"><strong>get</strong></a>(self, uri<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, http_request<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Performs a request using the GET method, returns an HTTP response.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsClient-put"><strong>put</strong></a>(self, uri<font color="#909090">=None</font>, data<font color="#909090">=None</font>, auth_token<font color="#909090">=None</font>, http_request<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Sends data using the PUT method, returns an HTTP response.</tt></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="atom.client.html#AtomPubClient">atom.client.AtomPubClient</a>:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| </dl> |
| <hr> |
| Data and other attributes inherited from <a href="atom.client.html#AtomPubClient">atom.client.AtomPubClient</a>:<br> |
| <dl><dt><strong>auth_token</strong> = None</dl> |
| |
| <dl><dt><strong>host</strong> = None</dl> |
| |
| <dl><dt><strong>xoauth_requestor_id</strong> = None</dl> |
| |
| </td></tr></table> <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="ContactsQuery">class <strong>ContactsQuery</strong></a>(<a href="gdata.client.html#Query">gdata.client.Query</a>)</font></td></tr> |
| |
| <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| <td colspan=2><tt>Create a custom Contacts <a href="gdata.client.html#Query">Query</a><br> |
| <br> |
| Full specs can be found at: U{Contacts query parameters reference<br> |
| <<a href="http://code.google.com/apis/contacts/docs/3.0/reference.html#Parameters">http://code.google.com/apis/contacts/docs/3.0/reference.html#Parameters</a>>}<br> </tt></td></tr> |
| <tr><td> </td> |
| <td width="100%"><dl><dt>Method resolution order:</dt> |
| <dd><a href="gdata.contacts.client.html#ContactsQuery">ContactsQuery</a></dd> |
| <dd><a href="gdata.client.html#Query">gdata.client.Query</a></dd> |
| <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="ContactsQuery-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#ContactsQuery-modify_request">modify_request</a>(self, http_request)</dt></dl> |
| |
| <dl><dt><a name="ContactsQuery-__init__"><strong>__init__</strong></a>(self, feed<font color="#909090">=None</font>, group<font color="#909090">=None</font>, orderby<font color="#909090">=None</font>, showdeleted<font color="#909090">=None</font>, sortorder<font color="#909090">=None</font>, requirealldeleted<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>@param max_results: The maximum number of entries to return. If you want<br> |
| to receive all of the contacts, rather than only the default maximum, you<br> |
| can specify a very large number for max-results.<br> |
| @param start-index: The 1-based index of the first result to be retrieved.<br> |
| @param updated-min: The lower bound on entry update dates.<br> |
| @param group: Constrains the results to only the contacts belonging to the<br> |
| group specified. Value of this parameter specifies group ID<br> |
| @param orderby: Sorting criterion. The only supported value is<br> |
| lastmodified.<br> |
| @param showdeleted: Include deleted contacts in the returned contacts feed<br> |
| @pram sortorder: Sorting order direction. Can be either ascending or<br> |
| descending.<br> |
| @param requirealldeleted: Only relevant if showdeleted and updated-min<br> |
| are also provided. It dictates the behavior of the server in case it<br> |
| detects that placeholders of some entries deleted since the point in<br> |
| time specified as updated-min may have been lost.</tt></dd></dl> |
| |
| <dl><dt><a name="ContactsQuery-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt></dl> |
| |
| <hr> |
| Methods inherited from <a href="gdata.client.html#Query">gdata.client.Query</a>:<br> |
| <dl><dt><a name="ContactsQuery-AddCustomParameter"><strong>AddCustomParameter</strong></a> = add_custom_parameter(self, key, value)</dt></dl> |
| |
| <dl><dt><a name="ContactsQuery-add_custom_parameter"><strong>add_custom_parameter</strong></a>(self, key, value)</dt></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="gdata.client.html#Query">gdata.client.Query</a>:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| </dl> |
| </td></tr></table> <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="ProfilesQuery">class <strong>ProfilesQuery</strong></a>(<a href="gdata.client.html#Query">gdata.client.Query</a>)</font></td></tr> |
| |
| <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| <td colspan=2><tt>Create a custom Profiles <a href="gdata.client.html#Query">Query</a><br> |
| <br> |
| Full specs can be found at: U{Profiless query parameters reference<br> |
| <<a href="http://code.google.com/apis/apps/profiles/reference.html#Parameters">http://code.google.com/apis/apps/profiles/reference.html#Parameters</a>>}<br> </tt></td></tr> |
| <tr><td> </td> |
| <td width="100%"><dl><dt>Method resolution order:</dt> |
| <dd><a href="gdata.contacts.client.html#ProfilesQuery">ProfilesQuery</a></dd> |
| <dd><a href="gdata.client.html#Query">gdata.client.Query</a></dd> |
| <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="ProfilesQuery-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#ProfilesQuery-modify_request">modify_request</a>(self, http_request)</dt></dl> |
| |
| <dl><dt><a name="ProfilesQuery-__init__"><strong>__init__</strong></a>(self, feed<font color="#909090">=None</font>, start_key<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>@param start_key: Opaque key of the first element to retrieve. Present in<br> |
| the next link of an earlier request, if further pages of response are<br> |
| available.</tt></dd></dl> |
| |
| <dl><dt><a name="ProfilesQuery-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt></dl> |
| |
| <hr> |
| Methods inherited from <a href="gdata.client.html#Query">gdata.client.Query</a>:<br> |
| <dl><dt><a name="ProfilesQuery-AddCustomParameter"><strong>AddCustomParameter</strong></a> = add_custom_parameter(self, key, value)</dt></dl> |
| |
| <dl><dt><a name="ProfilesQuery-add_custom_parameter"><strong>add_custom_parameter</strong></a>(self, key, value)</dt></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="gdata.client.html#Query">gdata.client.Query</a>:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| </dl> |
| </td></tr></table></td></tr></table><p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#55aa55"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
| <td width="100%"><strong>DEFAULT_BATCH_URL</strong> = 'https://www.google.com/m8/feeds/contacts/default/full/batch'<br> |
| <strong>DEFAULT_PROFILES_BATCH_URL</strong> = 'https://www.google.com/m8/feeds/profiles/domain/%s/full/batch'<br> |
| <strong>__author__</strong> = 'vinces1979@gmail.com (Vince Spicer)'</td></tr></table><p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#7799ee"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| <td width="100%">vinces1979@gmail.com (Vince Spicer)</td></tr></table> |
| </body></html> |