gam7 7.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +77555 -0
- gam/__main__.py +40 -0
- gam/atom/__init__.py +1460 -0
- gam/atom/auth.py +41 -0
- gam/atom/client.py +214 -0
- gam/atom/core.py +535 -0
- gam/atom/data.py +327 -0
- gam/atom/http.py +354 -0
- gam/atom/http_core.py +599 -0
- gam/atom/http_interface.py +144 -0
- gam/atom/mock_http.py +123 -0
- gam/atom/mock_http_core.py +313 -0
- gam/atom/mock_service.py +235 -0
- gam/atom/service.py +723 -0
- gam/atom/token_store.py +105 -0
- gam/atom/url.py +130 -0
- gam/cacerts.pem +1130 -0
- gam/cbcm-v1.1beta1.json +593 -0
- gam/contactdelegation-v1.json +249 -0
- gam/datastudio-v1.json +486 -0
- gam/gamlib/__init__.py +17 -0
- gam/gamlib/glaction.py +308 -0
- gam/gamlib/glapi.py +837 -0
- gam/gamlib/glcfg.py +616 -0
- gam/gamlib/glclargs.py +1184 -0
- gam/gamlib/glentity.py +831 -0
- gam/gamlib/glgapi.py +817 -0
- gam/gamlib/glgdata.py +98 -0
- gam/gamlib/glglobals.py +307 -0
- gam/gamlib/glindent.py +46 -0
- gam/gamlib/glmsgs.py +547 -0
- gam/gamlib/glskus.py +246 -0
- gam/gamlib/gluprop.py +279 -0
- gam/gamlib/glverlibs.py +33 -0
- gam/gamlib/yubikey.py +202 -0
- gam/gdata/__init__.py +825 -0
- gam/gdata/alt/__init__.py +20 -0
- gam/gdata/alt/app_engine.py +101 -0
- gam/gdata/alt/appengine.py +321 -0
- gam/gdata/apps/__init__.py +526 -0
- gam/gdata/apps/audit/__init__.py +1 -0
- gam/gdata/apps/audit/service.py +278 -0
- gam/gdata/apps/contacts/__init__.py +874 -0
- gam/gdata/apps/contacts/service.py +355 -0
- gam/gdata/apps/service.py +544 -0
- gam/gdata/apps/sites/__init__.py +283 -0
- gam/gdata/apps/sites/service.py +246 -0
- gam/gdata/service.py +1714 -0
- gam/gdata/urlfetch.py +247 -0
- gam/googleapiclient/__init__.py +27 -0
- gam/googleapiclient/_auth.py +167 -0
- gam/googleapiclient/_helpers.py +207 -0
- gam/googleapiclient/channel.py +315 -0
- gam/googleapiclient/discovery.py +1662 -0
- gam/googleapiclient/discovery_cache/__init__.py +78 -0
- gam/googleapiclient/discovery_cache/appengine_memcache.py +55 -0
- gam/googleapiclient/discovery_cache/base.py +46 -0
- gam/googleapiclient/discovery_cache/file_cache.py +145 -0
- gam/googleapiclient/errors.py +197 -0
- gam/googleapiclient/http.py +1962 -0
- gam/googleapiclient/mimeparse.py +183 -0
- gam/googleapiclient/model.py +429 -0
- gam/googleapiclient/schema.py +317 -0
- gam/googleapiclient/version.py +15 -0
- gam/iso8601/__init__.py +28 -0
- gam/iso8601/iso8601.py +160 -0
- gam/serviceaccountlookup-v1.json +141 -0
- gam/six.py +982 -0
- gam7-7.3.4.dist-info/METADATA +69 -0
- gam7-7.3.4.dist-info/RECORD +72 -0
- gam7-7.3.4.dist-info/WHEEL +4 -0
- gam7-7.3.4.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
#
|
|
3
|
+
# Copyright 2009 Google Inc. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
"""Data model classes for parsing and generating XML for the Contacts API."""
|
|
18
|
+
|
|
19
|
+
import atom
|
|
20
|
+
import gdata
|
|
21
|
+
|
|
22
|
+
## Constants from http://code.google.com/apis/gdata/elements.html ##
|
|
23
|
+
REL_HOME = 'http://schemas.google.com/g/2005#home'
|
|
24
|
+
REL_WORK = 'http://schemas.google.com/g/2005#work'
|
|
25
|
+
REL_OTHER = 'http://schemas.google.com/g/2005#other'
|
|
26
|
+
|
|
27
|
+
IM_AIM = 'http://schemas.google.com/g/2005#AIM' # AOL Instant Messenger protocol
|
|
28
|
+
IM_MSN = 'http://schemas.google.com/g/2005#MSN' # MSN Messenger protocol
|
|
29
|
+
IM_YAHOO = 'http://schemas.google.com/g/2005#YAHOO' # Yahoo Messenger protocol
|
|
30
|
+
IM_SKYPE = 'http://schemas.google.com/g/2005#SKYPE' # Skype protocol
|
|
31
|
+
IM_QQ = 'http://schemas.google.com/g/2005#QQ' # QQ protocol
|
|
32
|
+
IM_GOOGLE_TALK = 'http://schemas.google.com/g/2005#GOOGLE_TALK' # Google Talk protocol
|
|
33
|
+
IM_ICQ = 'http://schemas.google.com/g/2005#ICQ' # ICQ protocol
|
|
34
|
+
IM_JABBER = 'http://schemas.google.com/g/2005#JABBER' # Jabber protocol
|
|
35
|
+
IM_NETMEETING = 'http://schemas.google.com/g/2005#NETMEETING' # NetMeeting
|
|
36
|
+
|
|
37
|
+
PHOTO_LINK_REL = 'http://schemas.google.com/contacts/2008/rel#photo'
|
|
38
|
+
PHOTO_EDIT_LINK_REL = 'http://schemas.google.com/contacts/2008/rel#edit-photo'
|
|
39
|
+
|
|
40
|
+
# Different phone types, for more info see:
|
|
41
|
+
# http://code.google.com/apis/gdata/docs/2.0/elements.html#gdPhoneNumber
|
|
42
|
+
PHONE_ASSISTANT = 'http://schemas.google.com/g/2005#assistant'
|
|
43
|
+
PHONE_CALLBACK = 'http://schemas.google.com/g/2005#callback'
|
|
44
|
+
PHONE_CAR = 'http://schemas.google.com/g/2005#car'
|
|
45
|
+
PHONE_COMPANY_MAIN = 'http://schemas.google.com/g/2005#company_main'
|
|
46
|
+
PHONE_FAX = 'http://schemas.google.com/g/2005#fax'
|
|
47
|
+
PHONE_GENERAL = 'http://schemas.google.com/g/2005#general'
|
|
48
|
+
PHONE_HOME = REL_HOME
|
|
49
|
+
PHONE_HOME_FAX = 'http://schemas.google.com/g/2005#home_fax'
|
|
50
|
+
PHONE_INTERNAL = 'http://schemas.google.com/g/2005#internal-extension'
|
|
51
|
+
PHONE_ISDN = 'http://schemas.google.com/g/2005#isdn'
|
|
52
|
+
PHONE_MAIN = 'http://schemas.google.com/g/2005#main'
|
|
53
|
+
PHONE_MOBILE = 'http://schemas.google.com/g/2005#mobile'
|
|
54
|
+
PHONE_OTHER = REL_OTHER
|
|
55
|
+
PHONE_OTHER_FAX = 'http://schemas.google.com/g/2005#other_fax'
|
|
56
|
+
PHONE_PAGER = 'http://schemas.google.com/g/2005#pager'
|
|
57
|
+
PHONE_RADIO = 'http://schemas.google.com/g/2005#radio'
|
|
58
|
+
PHONE_SATELLITE = 'http://schemas.google.com/g/2005#satellite'
|
|
59
|
+
PHONE_TELEX = 'http://schemas.google.com/g/2005#telex'
|
|
60
|
+
PHONE_TTY_TDD = 'http://schemas.google.com/g/2005#tty_tdd'
|
|
61
|
+
PHONE_VOIP = 'http://schemas.google.com/g/2005#voip'
|
|
62
|
+
PHONE_WORK = REL_WORK
|
|
63
|
+
PHONE_WORK_FAX = 'http://schemas.google.com/g/2005#work_fax'
|
|
64
|
+
PHONE_WORK_MOBILE = 'http://schemas.google.com/g/2005#work_mobile'
|
|
65
|
+
PHONE_WORK_PAGER = 'http://schemas.google.com/g/2005#work_pager'
|
|
66
|
+
|
|
67
|
+
MAIL_BOTH = 'http://schemas.google.com/g/2005#both'
|
|
68
|
+
MAIL_LETTERS = 'http://schemas.google.com/g/2005#letters'
|
|
69
|
+
MAIL_PARCELS = 'http://schemas.google.com/g/2005#parcels'
|
|
70
|
+
MAIL_NEITHER = 'http://schemas.google.com/g/2005#neither'
|
|
71
|
+
|
|
72
|
+
GENERAL_ADDRESS = 'http://schemas.google.com/g/2005#general'
|
|
73
|
+
LOCAL_ADDRESS = 'http://schemas.google.com/g/2005#local'
|
|
74
|
+
|
|
75
|
+
EXTERNAL_ID_ORGANIZATION = 'organization'
|
|
76
|
+
|
|
77
|
+
RELATION_MANAGER = 'manager'
|
|
78
|
+
|
|
79
|
+
CONTACTS_NAMESPACE = 'http://schemas.google.com/contact/2008'
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class GDataBase(atom.AtomBase):
|
|
83
|
+
"""The Google Contacts intermediate class from atom.AtomBase."""
|
|
84
|
+
_namespace = gdata.GDATA_NAMESPACE
|
|
85
|
+
_children = atom.AtomBase._children.copy()
|
|
86
|
+
_attributes = atom.AtomBase._attributes.copy()
|
|
87
|
+
|
|
88
|
+
def __init__(self, text=None):
|
|
89
|
+
atom.AtomBase.__init__(self, text=text)
|
|
90
|
+
|
|
91
|
+
class ContactsBase(GDataBase):
|
|
92
|
+
"""The Google Contacts intermediate class for Contacts namespace."""
|
|
93
|
+
_namespace = CONTACTS_NAMESPACE
|
|
94
|
+
|
|
95
|
+
class BillingInformation(ContactsBase):
|
|
96
|
+
"""The gContact:billingInformation element."""
|
|
97
|
+
_tag = 'billingInformation'
|
|
98
|
+
|
|
99
|
+
class Birthday(ContactsBase):
|
|
100
|
+
"""The gContact:birthday element."""
|
|
101
|
+
_tag = 'birthday'
|
|
102
|
+
_children = ContactsBase._children.copy()
|
|
103
|
+
_attributes = ContactsBase._attributes.copy()
|
|
104
|
+
_attributes['when'] = 'when'
|
|
105
|
+
|
|
106
|
+
def __init__(self, when=None):
|
|
107
|
+
ContactsBase.__init__(self)
|
|
108
|
+
self.when = when
|
|
109
|
+
|
|
110
|
+
class CalendarLink(ContactsBase):
|
|
111
|
+
"""The gContact:calendarLink element."""
|
|
112
|
+
_tag = 'calendarLink'
|
|
113
|
+
_children = ContactsBase._children.copy()
|
|
114
|
+
_attributes = ContactsBase._attributes.copy()
|
|
115
|
+
_attributes['href'] = 'href'
|
|
116
|
+
_attributes['label'] = 'label'
|
|
117
|
+
_attributes['primary'] = 'primary'
|
|
118
|
+
_attributes['rel'] = 'rel'
|
|
119
|
+
|
|
120
|
+
def __init__(self, href=None, label=None, primary='false', rel=None):
|
|
121
|
+
ContactsBase.__init__(self)
|
|
122
|
+
self.href = href
|
|
123
|
+
self.label = label
|
|
124
|
+
self.primary = primary
|
|
125
|
+
self.rel = rel
|
|
126
|
+
|
|
127
|
+
class Content(atom.AtomBase):
|
|
128
|
+
"""The Google Contacts Content element."""
|
|
129
|
+
_tag = 'content'
|
|
130
|
+
_namespace = atom.ATOM_NAMESPACE
|
|
131
|
+
|
|
132
|
+
def __init__(self, text=None):
|
|
133
|
+
atom.AtomBase.__init__(self, text=text)
|
|
134
|
+
|
|
135
|
+
class DirectoryServer(ContactsBase):
|
|
136
|
+
"""The gContact:directoryServer element."""
|
|
137
|
+
_tag = 'directoryServer'
|
|
138
|
+
|
|
139
|
+
class Email(GDataBase):
|
|
140
|
+
"""The gd:email element."""
|
|
141
|
+
_tag = 'email'
|
|
142
|
+
_children = GDataBase._children.copy()
|
|
143
|
+
_attributes = GDataBase._attributes.copy()
|
|
144
|
+
_attributes['address'] = 'address'
|
|
145
|
+
_attributes['primary'] = 'primary'
|
|
146
|
+
_attributes['rel'] = 'rel'
|
|
147
|
+
_attributes['label'] = 'label'
|
|
148
|
+
|
|
149
|
+
def __init__(self, label=None, rel=None, address=None, primary='false'):
|
|
150
|
+
GDataBase.__init__(self)
|
|
151
|
+
self.label = label
|
|
152
|
+
self.rel = rel
|
|
153
|
+
self.address = address
|
|
154
|
+
self.primary = primary
|
|
155
|
+
|
|
156
|
+
class When(GDataBase):
|
|
157
|
+
"""The Google Contacts when element."""
|
|
158
|
+
_tag = 'when'
|
|
159
|
+
_children = GDataBase._children.copy()
|
|
160
|
+
_attributes = GDataBase._attributes.copy()
|
|
161
|
+
_attributes['startTime'] = 'startTime'
|
|
162
|
+
_attributes['label'] = 'label'
|
|
163
|
+
|
|
164
|
+
def __init__(self, startTime=None, label=None):
|
|
165
|
+
GDataBase.__init__(self)
|
|
166
|
+
self.startTime = startTime
|
|
167
|
+
self.label = label
|
|
168
|
+
|
|
169
|
+
class Event(ContactsBase):
|
|
170
|
+
"""The gContact:event element."""
|
|
171
|
+
_tag = 'event'
|
|
172
|
+
_children = ContactsBase._children.copy()
|
|
173
|
+
_attributes = ContactsBase._attributes.copy()
|
|
174
|
+
_attributes['label'] = 'label'
|
|
175
|
+
_attributes['rel'] = 'rel'
|
|
176
|
+
_children['{%s}when' % GDataBase._namespace] = ('when', When)
|
|
177
|
+
|
|
178
|
+
def __init__(self, label=None, rel=None, when=None):
|
|
179
|
+
ContactsBase.__init__(self)
|
|
180
|
+
self.label = label
|
|
181
|
+
self.rel = rel
|
|
182
|
+
self.when = when
|
|
183
|
+
|
|
184
|
+
def EventFromString(xml_string):
|
|
185
|
+
return atom.CreateClassFromXMLString(Event, xml_string)
|
|
186
|
+
|
|
187
|
+
class ExternalId(ContactsBase):
|
|
188
|
+
"""The gContact:externalId element."""
|
|
189
|
+
_tag = 'externalId'
|
|
190
|
+
_children = ContactsBase._children.copy()
|
|
191
|
+
_attributes = ContactsBase._attributes.copy()
|
|
192
|
+
_attributes['label'] = 'label'
|
|
193
|
+
_attributes['rel'] = 'rel'
|
|
194
|
+
_attributes['value'] = 'value'
|
|
195
|
+
|
|
196
|
+
def __init__(self, label=None, rel=None, value=None):
|
|
197
|
+
ContactsBase.__init__(self)
|
|
198
|
+
self.label = label
|
|
199
|
+
self.rel = rel
|
|
200
|
+
self.value = value
|
|
201
|
+
|
|
202
|
+
def ExternalIdFromString(xml_string):
|
|
203
|
+
return atom.CreateClassFromXMLString(ExternalId, xml_string)
|
|
204
|
+
|
|
205
|
+
class Gender(ContactsBase):
|
|
206
|
+
"""The gContact:gender element."""
|
|
207
|
+
_tag = 'gender'
|
|
208
|
+
_children = ContactsBase._children.copy()
|
|
209
|
+
_attributes = ContactsBase._attributes.copy()
|
|
210
|
+
_attributes['value'] = 'value'
|
|
211
|
+
|
|
212
|
+
def __init__(self, value=None):
|
|
213
|
+
ContactsBase.__init__(self)
|
|
214
|
+
self.value = value
|
|
215
|
+
|
|
216
|
+
class Hobby(ContactsBase):
|
|
217
|
+
"""The gContact:hobby element."""
|
|
218
|
+
_tag = 'hobby'
|
|
219
|
+
|
|
220
|
+
class IM(GDataBase):
|
|
221
|
+
"""The gd:im element."""
|
|
222
|
+
_tag = 'im'
|
|
223
|
+
_children = GDataBase._children.copy()
|
|
224
|
+
_attributes = GDataBase._attributes.copy()
|
|
225
|
+
_attributes['address'] = 'address'
|
|
226
|
+
_attributes['primary'] = 'primary'
|
|
227
|
+
_attributes['protocol'] = 'protocol'
|
|
228
|
+
_attributes['label'] = 'label'
|
|
229
|
+
_attributes['rel'] = 'rel'
|
|
230
|
+
|
|
231
|
+
def __init__(self, primary='false', rel=None, address=None, protocol=None, label=None):
|
|
232
|
+
GDataBase.__init__(self)
|
|
233
|
+
self.protocol = protocol
|
|
234
|
+
self.address = address
|
|
235
|
+
self.primary = primary
|
|
236
|
+
self.rel = rel
|
|
237
|
+
self.label = label
|
|
238
|
+
|
|
239
|
+
class Initials(ContactsBase):
|
|
240
|
+
"""The gContact:initials element."""
|
|
241
|
+
_tag = 'initials'
|
|
242
|
+
|
|
243
|
+
class Jot(ContactsBase):
|
|
244
|
+
"""The gContact:jot element."""
|
|
245
|
+
_tag = 'jot'
|
|
246
|
+
_children = ContactsBase._children.copy()
|
|
247
|
+
_attributes = ContactsBase._attributes.copy()
|
|
248
|
+
_attributes['rel'] = 'rel'
|
|
249
|
+
|
|
250
|
+
def __init__(self, rel=None, text=None):
|
|
251
|
+
ContactsBase.__init__(self, text=text)
|
|
252
|
+
self.rel = rel
|
|
253
|
+
|
|
254
|
+
class Language(ContactsBase):
|
|
255
|
+
"""The gContact:language element."""
|
|
256
|
+
_tag = 'language'
|
|
257
|
+
_children = ContactsBase._children.copy()
|
|
258
|
+
_attributes = ContactsBase._attributes.copy()
|
|
259
|
+
_attributes['code'] = 'code'
|
|
260
|
+
_attributes['label'] = 'label'
|
|
261
|
+
|
|
262
|
+
def __init__(self, code=None, label=None):
|
|
263
|
+
ContactsBase.__init__(self)
|
|
264
|
+
self.code = code
|
|
265
|
+
self.label = label
|
|
266
|
+
|
|
267
|
+
class MaidenName(ContactsBase):
|
|
268
|
+
"""The gContact:maidenName element."""
|
|
269
|
+
_tag = 'maidenName'
|
|
270
|
+
|
|
271
|
+
class Mileage(ContactsBase):
|
|
272
|
+
"""The gContact:mileage element."""
|
|
273
|
+
_tag = 'mileage'
|
|
274
|
+
|
|
275
|
+
class NamePrefix(GDataBase):
|
|
276
|
+
"""The gd:namePrefix element."""
|
|
277
|
+
_tag = 'namePrefix'
|
|
278
|
+
|
|
279
|
+
class GivenName(GDataBase):
|
|
280
|
+
"""The gd:givenName element."""
|
|
281
|
+
_tag = 'givenName'
|
|
282
|
+
|
|
283
|
+
class AdditionalName(GDataBase):
|
|
284
|
+
"""The gd:additionalName element."""
|
|
285
|
+
_tag = 'additionalName'
|
|
286
|
+
|
|
287
|
+
class FamilyName(GDataBase):
|
|
288
|
+
"""The gd:familyName element."""
|
|
289
|
+
_tag = 'familyName'
|
|
290
|
+
|
|
291
|
+
class NameSuffix(GDataBase):
|
|
292
|
+
"""The gd:nameSuffix element."""
|
|
293
|
+
_tag = 'nameSuffix'
|
|
294
|
+
|
|
295
|
+
class FullName(GDataBase):
|
|
296
|
+
"""The gd:fullName element."""
|
|
297
|
+
_tag = 'fullName'
|
|
298
|
+
|
|
299
|
+
class Name(GDataBase):
|
|
300
|
+
"""The gd:name element."""
|
|
301
|
+
_tag = 'name'
|
|
302
|
+
_children = GDataBase._children.copy()
|
|
303
|
+
_attributes = GDataBase._attributes.copy()
|
|
304
|
+
_children['{%s}namePrefix' % GDataBase._namespace] = ('name_prefix', NamePrefix)
|
|
305
|
+
_children['{%s}givenName' % GDataBase._namespace] = ('given_name', GivenName)
|
|
306
|
+
_children['{%s}additionalName' % GDataBase._namespace] = ('additional_name', AdditionalName)
|
|
307
|
+
_children['{%s}familyName' % GDataBase._namespace] = ('family_name', FamilyName)
|
|
308
|
+
_children['{%s}nameSuffix' % GDataBase._namespace] = ('name_suffix', NameSuffix)
|
|
309
|
+
_children['{%s}fullName' % GDataBase._namespace] = ('full_name', FullName)
|
|
310
|
+
|
|
311
|
+
def __init__(self, given_name=None, additional_name=None, family_name=None,
|
|
312
|
+
name_prefix=None, name_suffix=None, full_name=None,):
|
|
313
|
+
GDataBase.__init__(self)
|
|
314
|
+
self.given_name = given_name
|
|
315
|
+
self.additional_name = additional_name
|
|
316
|
+
self.family_name = family_name
|
|
317
|
+
self.name_prefix = name_prefix
|
|
318
|
+
self.name_suffix = name_suffix
|
|
319
|
+
self.full_name = full_name
|
|
320
|
+
|
|
321
|
+
class Nickname(ContactsBase):
|
|
322
|
+
"""The gContact:nickname element."""
|
|
323
|
+
_tag = 'nickname'
|
|
324
|
+
|
|
325
|
+
class Occupation(ContactsBase):
|
|
326
|
+
"""The gContact:occupation element."""
|
|
327
|
+
_tag = 'occupation'
|
|
328
|
+
|
|
329
|
+
class PhoneNumber(GDataBase):
|
|
330
|
+
"""The gd:phoneNumber element."""
|
|
331
|
+
_tag = 'phoneNumber'
|
|
332
|
+
_children = GDataBase._children.copy()
|
|
333
|
+
_attributes = GDataBase._attributes.copy()
|
|
334
|
+
_attributes['label'] = 'label'
|
|
335
|
+
_attributes['rel'] = 'rel'
|
|
336
|
+
_attributes['uri'] = 'uri'
|
|
337
|
+
_attributes['primary'] = 'primary'
|
|
338
|
+
|
|
339
|
+
def __init__(self, label=None, rel=None, uri=None, primary='false', text=None):
|
|
340
|
+
GDataBase.__init__(self, text=text)
|
|
341
|
+
self.label = label
|
|
342
|
+
self.rel = rel
|
|
343
|
+
self.uri = uri
|
|
344
|
+
self.primary = primary
|
|
345
|
+
|
|
346
|
+
class OrgName(GDataBase):
|
|
347
|
+
"""The gd:orgName element."""
|
|
348
|
+
_tag = 'orgName'
|
|
349
|
+
|
|
350
|
+
class OrgTitle(GDataBase):
|
|
351
|
+
"""The gd:orgTitle element."""
|
|
352
|
+
_tag = 'orgTitle'
|
|
353
|
+
|
|
354
|
+
class OrgSymbol(GDataBase):
|
|
355
|
+
"""The gd:orgSymbol element."""
|
|
356
|
+
_tag = 'orgSymbol'
|
|
357
|
+
|
|
358
|
+
class OrgDepartment(GDataBase):
|
|
359
|
+
"""The gd:orgDepartment element."""
|
|
360
|
+
_tag = 'orgDepartment'
|
|
361
|
+
|
|
362
|
+
class OrgJobDescription(GDataBase):
|
|
363
|
+
"""The gd:orgJobDescription element."""
|
|
364
|
+
_tag = 'orgJobDescription'
|
|
365
|
+
|
|
366
|
+
class Where(GDataBase):
|
|
367
|
+
"""The gd:where element."""
|
|
368
|
+
_tag = 'where'
|
|
369
|
+
_children = GDataBase._children.copy()
|
|
370
|
+
_attributes = GDataBase._attributes.copy()
|
|
371
|
+
_attributes['valueString'] = 'value_string'
|
|
372
|
+
|
|
373
|
+
def __init__(self, value_string=None):
|
|
374
|
+
GDataBase.__init__(self)
|
|
375
|
+
self.value_string = value_string
|
|
376
|
+
|
|
377
|
+
class Organization(GDataBase):
|
|
378
|
+
"""The gd:organization element."""
|
|
379
|
+
_tag = 'organization'
|
|
380
|
+
_children = GDataBase._children.copy()
|
|
381
|
+
_attributes = GDataBase._attributes.copy()
|
|
382
|
+
_attributes['label'] = 'label'
|
|
383
|
+
_attributes['rel'] = 'rel'
|
|
384
|
+
_attributes['primary'] = 'primary'
|
|
385
|
+
_children['{%s}orgName' % GDataBase._namespace] = ('name', OrgName)
|
|
386
|
+
_children['{%s}orgSymbol' % GDataBase._namespace] = ('symbol', OrgSymbol)
|
|
387
|
+
_children['{%s}orgTitle' % GDataBase._namespace] = ('title', OrgTitle)
|
|
388
|
+
_children['{%s}orgDepartment' % GDataBase._namespace] = ('department', OrgDepartment)
|
|
389
|
+
_children['{%s}orgJobDescription' % GDataBase._namespace] = ('job_description', OrgJobDescription)
|
|
390
|
+
_children['{%s}where' % GDataBase._namespace] = ('where', Where)
|
|
391
|
+
|
|
392
|
+
def __init__(self, label=None, rel=None, primary='false', name=None,
|
|
393
|
+
title=None, symbol=None, department=None, job_description=None, where=None,):
|
|
394
|
+
GDataBase.__init__(self)
|
|
395
|
+
self.label = label
|
|
396
|
+
self.rel = rel
|
|
397
|
+
self.primary = primary
|
|
398
|
+
self.name = name
|
|
399
|
+
self.symbol = symbol
|
|
400
|
+
self.title = title
|
|
401
|
+
self.department = department
|
|
402
|
+
self.job_description = job_description
|
|
403
|
+
self.where = where
|
|
404
|
+
|
|
405
|
+
class PostalAddress(GDataBase):
|
|
406
|
+
"""The gd:postalAddress element."""
|
|
407
|
+
_tag = 'postalAddress'
|
|
408
|
+
_children = GDataBase._children.copy()
|
|
409
|
+
_attributes = GDataBase._attributes.copy()
|
|
410
|
+
_attributes['label'] = 'label'
|
|
411
|
+
_attributes['rel'] = 'rel'
|
|
412
|
+
_attributes['primary'] = 'primary'
|
|
413
|
+
|
|
414
|
+
def __init__(self, primary=None, rel=None, label=None, text=None):
|
|
415
|
+
GDataBase.__init__(self, text=text)
|
|
416
|
+
self.label = label
|
|
417
|
+
self.rel = rel
|
|
418
|
+
self.primary = primary
|
|
419
|
+
|
|
420
|
+
class Priority(ContactsBase):
|
|
421
|
+
"""The gContact:priority element."""
|
|
422
|
+
_tag = 'priority'
|
|
423
|
+
_children = ContactsBase._children.copy()
|
|
424
|
+
_attributes = ContactsBase._attributes.copy()
|
|
425
|
+
_attributes['rel'] = 'rel'
|
|
426
|
+
|
|
427
|
+
def __init__(self, rel=None):
|
|
428
|
+
ContactsBase.__init__(self)
|
|
429
|
+
self.rel = rel
|
|
430
|
+
|
|
431
|
+
class Relation(ContactsBase):
|
|
432
|
+
"""The gContact:relation element."""
|
|
433
|
+
_tag = 'relation'
|
|
434
|
+
_children = ContactsBase._children.copy()
|
|
435
|
+
_attributes = ContactsBase._attributes.copy()
|
|
436
|
+
_attributes['label'] = 'label'
|
|
437
|
+
_attributes['rel'] = 'rel'
|
|
438
|
+
|
|
439
|
+
def __init__(self, label=None, rel=None, text=None):
|
|
440
|
+
ContactsBase.__init__(self, text=text)
|
|
441
|
+
self.label = label
|
|
442
|
+
self.rel = rel
|
|
443
|
+
|
|
444
|
+
def RelationFromString(xml_string):
|
|
445
|
+
return atom.CreateClassFromXMLString(Relation, xml_string)
|
|
446
|
+
|
|
447
|
+
class Sensitivity(ContactsBase):
|
|
448
|
+
"""The gContact:sensitivity element."""
|
|
449
|
+
_tag = 'sensitivity'
|
|
450
|
+
_children = ContactsBase._children.copy()
|
|
451
|
+
_attributes = ContactsBase._attributes.copy()
|
|
452
|
+
_attributes['rel'] = 'rel'
|
|
453
|
+
|
|
454
|
+
def __init__(self, rel=None):
|
|
455
|
+
ContactsBase.__init__(self)
|
|
456
|
+
self.rel = rel
|
|
457
|
+
|
|
458
|
+
class ShortName(ContactsBase):
|
|
459
|
+
"""The gContact:shortName element."""
|
|
460
|
+
_tag = 'shortName'
|
|
461
|
+
|
|
462
|
+
class Street(GDataBase):
|
|
463
|
+
"""The gd:street element.
|
|
464
|
+
Can be street, avenue, road, etc. This element also includes the
|
|
465
|
+
house number and room/apartment/flat/floor number.
|
|
466
|
+
"""
|
|
467
|
+
_tag = 'street'
|
|
468
|
+
|
|
469
|
+
class PoBox(GDataBase):
|
|
470
|
+
"""The gd:pobox element.
|
|
471
|
+
Covers actual P.O. boxes, drawers, locked bags, etc. This is usually
|
|
472
|
+
but not always mutually exclusive with street.
|
|
473
|
+
"""
|
|
474
|
+
_tag = 'pobox'
|
|
475
|
+
|
|
476
|
+
class Neighborhood(GDataBase):
|
|
477
|
+
"""The gd:neighborhood element.
|
|
478
|
+
This is used to disambiguate a street address when a city contains more
|
|
479
|
+
than one street with the same name, or to specify a small place whose
|
|
480
|
+
mail is routed through a larger postal town. In China it could be a
|
|
481
|
+
county or a minor city.
|
|
482
|
+
"""
|
|
483
|
+
_tag = 'neighborhood'
|
|
484
|
+
|
|
485
|
+
class City(GDataBase):
|
|
486
|
+
"""The gd:city element.
|
|
487
|
+
Can be city, village, town, borough, etc. This is the postal town and
|
|
488
|
+
not necessarily the place of residence or place of business.
|
|
489
|
+
"""
|
|
490
|
+
_tag = 'city'
|
|
491
|
+
|
|
492
|
+
class Region(GDataBase):
|
|
493
|
+
"""The gd:region element.
|
|
494
|
+
A state, province, county (in Ireland), Land (in Germany),
|
|
495
|
+
departement (in France), etc.
|
|
496
|
+
"""
|
|
497
|
+
_tag = 'region'
|
|
498
|
+
|
|
499
|
+
class Postcode(GDataBase):
|
|
500
|
+
"""The gd:postcode element.
|
|
501
|
+
Postal code. Usually country-wide, but sometimes specific to the
|
|
502
|
+
city (e.g. "2" in "Dublin 2, Ireland" addresses).
|
|
503
|
+
"""
|
|
504
|
+
_tag = 'postcode'
|
|
505
|
+
|
|
506
|
+
class Country(GDataBase):
|
|
507
|
+
"""The gd:country element.
|
|
508
|
+
The name or code of the country.
|
|
509
|
+
"""
|
|
510
|
+
_tag = 'country'
|
|
511
|
+
|
|
512
|
+
class FormattedAddress(GDataBase):
|
|
513
|
+
"""The gd:formattedAddress element."""
|
|
514
|
+
_tag = 'formattedAddress'
|
|
515
|
+
|
|
516
|
+
class StructuredPostalAddress(GDataBase):
|
|
517
|
+
"""The gd:structuredPostalAddress element."""
|
|
518
|
+
_tag = 'structuredPostalAddress'
|
|
519
|
+
_children = GDataBase._children.copy()
|
|
520
|
+
_attributes = GDataBase._attributes.copy()
|
|
521
|
+
_attributes['label'] = 'label'
|
|
522
|
+
_attributes['rel'] = 'rel'
|
|
523
|
+
_attributes['primary'] = 'primary'
|
|
524
|
+
_children['{%s}street' % GDataBase._namespace] = ('street', Street)
|
|
525
|
+
_children['{%s}pobox' % GDataBase._namespace] = ('pobox', PoBox)
|
|
526
|
+
_children['{%s}neighborhood' % GDataBase._namespace] = ('neighborhood', Neighborhood)
|
|
527
|
+
_children['{%s}city' % GDataBase._namespace] = ('city', City)
|
|
528
|
+
_children['{%s}region' % GDataBase._namespace] = ('region', Region)
|
|
529
|
+
_children['{%s}postcode' % GDataBase._namespace] = ('postcode', Postcode)
|
|
530
|
+
_children['{%s}country' % GDataBase._namespace] = ('country', Country)
|
|
531
|
+
_children['{%s}formattedAddress' % GDataBase._namespace] = ('formatted_address', FormattedAddress)
|
|
532
|
+
|
|
533
|
+
def __init__(self, rel=None, label=None, primary='false',
|
|
534
|
+
street=None,
|
|
535
|
+
pobox=None,
|
|
536
|
+
neighborhood=None,
|
|
537
|
+
city=None,
|
|
538
|
+
region=None,
|
|
539
|
+
postcode=None,
|
|
540
|
+
country=None,
|
|
541
|
+
formatted_address=None):
|
|
542
|
+
GDataBase.__init__(self)
|
|
543
|
+
self.label = label
|
|
544
|
+
self.rel = rel
|
|
545
|
+
self.primary = primary
|
|
546
|
+
self.street = street
|
|
547
|
+
self.pobox = pobox
|
|
548
|
+
self.neighborhood = neighborhood
|
|
549
|
+
self.city = city
|
|
550
|
+
self.region = region
|
|
551
|
+
self.postcode = postcode
|
|
552
|
+
self.country = country
|
|
553
|
+
self.formatted_address = formatted_address
|
|
554
|
+
|
|
555
|
+
class Subject(ContactsBase):
|
|
556
|
+
"""The gContact:Subject element."""
|
|
557
|
+
_tag = 'subject'
|
|
558
|
+
|
|
559
|
+
class UserDefinedField(ContactsBase):
|
|
560
|
+
"""The gContact:userDefinedField element."""
|
|
561
|
+
_tag = 'userDefinedField'
|
|
562
|
+
_children = ContactsBase._children.copy()
|
|
563
|
+
_attributes = ContactsBase._attributes.copy()
|
|
564
|
+
_attributes['key'] = 'key'
|
|
565
|
+
_attributes['value'] = 'value'
|
|
566
|
+
|
|
567
|
+
def __init__(self, key=None, value=None):
|
|
568
|
+
ContactsBase.__init__(self)
|
|
569
|
+
self.key = key
|
|
570
|
+
self.value = value
|
|
571
|
+
|
|
572
|
+
def UserDefinedFieldFromString(xml_string):
|
|
573
|
+
return atom.CreateClassFromXMLString(UserDefinedField, xml_string)
|
|
574
|
+
|
|
575
|
+
class Website(ContactsBase):
|
|
576
|
+
"""The gContact:Website element."""
|
|
577
|
+
_tag = 'website'
|
|
578
|
+
_children = ContactsBase._children.copy()
|
|
579
|
+
_attributes = ContactsBase._attributes.copy()
|
|
580
|
+
_attributes['href'] = 'href'
|
|
581
|
+
_attributes['label'] = 'label'
|
|
582
|
+
_attributes['primary'] = 'primary'
|
|
583
|
+
_attributes['rel'] = 'rel'
|
|
584
|
+
|
|
585
|
+
def __init__(self, href=None, label=None, primary='false', rel=None):
|
|
586
|
+
ContactsBase.__init__(self)
|
|
587
|
+
self.href = href
|
|
588
|
+
self.label = label
|
|
589
|
+
self.primary = primary
|
|
590
|
+
self.rel = rel
|
|
591
|
+
|
|
592
|
+
def WebsiteFromString(xml_string):
|
|
593
|
+
return atom.CreateClassFromXMLString(Website, xml_string)
|
|
594
|
+
|
|
595
|
+
class PersonEntry(gdata.BatchEntry):
|
|
596
|
+
"""Base class for ContactEntry and ProfileEntry."""
|
|
597
|
+
_children = gdata.BatchEntry._children.copy()
|
|
598
|
+
_children['{%s}billingInformation' % CONTACTS_NAMESPACE] = ('billingInformation', BillingInformation)
|
|
599
|
+
_children['{%s}birthday' % CONTACTS_NAMESPACE] = ('birthday', Birthday)
|
|
600
|
+
_children['{%s}calendarLink' % CONTACTS_NAMESPACE] = ('calendarLink', [CalendarLink])
|
|
601
|
+
_children['{%s}content' % atom.ATOM_NAMESPACE] = ('content', Content)
|
|
602
|
+
_children['{%s}directoryServer' % CONTACTS_NAMESPACE] = ('directoryServer', DirectoryServer)
|
|
603
|
+
_children['{%s}email' % gdata.GDATA_NAMESPACE] = ('email', [Email])
|
|
604
|
+
_children['{%s}event' % CONTACTS_NAMESPACE] = ('event', [Event])
|
|
605
|
+
_children['{%s}externalId' % CONTACTS_NAMESPACE] = ('externalId', [ExternalId])
|
|
606
|
+
_children['{%s}gender' % CONTACTS_NAMESPACE] = ('gender', Gender)
|
|
607
|
+
_children['{%s}hobby' % CONTACTS_NAMESPACE] = ('hobby', [Hobby])
|
|
608
|
+
_children['{%s}im' % gdata.GDATA_NAMESPACE] = ('im', [IM])
|
|
609
|
+
_children['{%s}initials' % CONTACTS_NAMESPACE] = ('initials', Initials)
|
|
610
|
+
_children['{%s}jot' % CONTACTS_NAMESPACE] = ('jot', [Jot])
|
|
611
|
+
_children['{%s}language' % CONTACTS_NAMESPACE] = ('language', Language)
|
|
612
|
+
_children['{%s}maidenName' % CONTACTS_NAMESPACE] = ('maidenName', MaidenName)
|
|
613
|
+
_children['{%s}mileage' % CONTACTS_NAMESPACE] = ('mileage', Mileage)
|
|
614
|
+
_children['{%s}name' % gdata.GDATA_NAMESPACE] = ('name', Name)
|
|
615
|
+
_children['{%s}nickname' % CONTACTS_NAMESPACE] = ('nickname', Nickname)
|
|
616
|
+
_children['{%s}occupation' % CONTACTS_NAMESPACE] = ('occupation', Occupation)
|
|
617
|
+
_children['{%s}organization' % gdata.GDATA_NAMESPACE] = ('organization', [Organization])
|
|
618
|
+
_children['{%s}phoneNumber' % gdata.GDATA_NAMESPACE] = ('phoneNumber', [PhoneNumber])
|
|
619
|
+
_children['{%s}postalAddress' % gdata.GDATA_NAMESPACE] = ('postalAddress', [PostalAddress])
|
|
620
|
+
_children['{%s}priority' % CONTACTS_NAMESPACE] = ('priority', Priority)
|
|
621
|
+
_children['{%s}relation' % CONTACTS_NAMESPACE] = ('relation', [Relation])
|
|
622
|
+
_children['{%s}sensitivity' % CONTACTS_NAMESPACE] = ('sensitivity', Sensitivity)
|
|
623
|
+
_children['{%s}shortName' % CONTACTS_NAMESPACE] = ('shortName', ShortName)
|
|
624
|
+
_children['{%s}structuredPostalAddress' % gdata.GDATA_NAMESPACE] = ('structuredPostalAddress', [StructuredPostalAddress])
|
|
625
|
+
_children['{%s}subject' % CONTACTS_NAMESPACE] = ('subject', Subject)
|
|
626
|
+
_children['{%s}userDefinedField' % CONTACTS_NAMESPACE] = ('userDefinedField', [UserDefinedField])
|
|
627
|
+
_children['{%s}website' % CONTACTS_NAMESPACE] = ('website', [Website])
|
|
628
|
+
_children['{%s}where' % gdata.GDATA_NAMESPACE] = ('where', Where)
|
|
629
|
+
|
|
630
|
+
_attributes = gdata.BatchEntry._attributes.copy()
|
|
631
|
+
_attributes['{%s}etag' % gdata.GDATA_NAMESPACE] = 'etag'
|
|
632
|
+
|
|
633
|
+
def __init__(self,
|
|
634
|
+
billingInformation=None,
|
|
635
|
+
birthday=None,
|
|
636
|
+
calendarLink=None,
|
|
637
|
+
content=None,
|
|
638
|
+
directoryServer=None,
|
|
639
|
+
email=None,
|
|
640
|
+
event=None,
|
|
641
|
+
externalId=None,
|
|
642
|
+
gender=None,
|
|
643
|
+
hobby=None,
|
|
644
|
+
im=None,
|
|
645
|
+
initials=None,
|
|
646
|
+
jot=None,
|
|
647
|
+
language=None,
|
|
648
|
+
maidenName=None,
|
|
649
|
+
mileage=None,
|
|
650
|
+
name=None,
|
|
651
|
+
nickname=None,
|
|
652
|
+
occupation=None,
|
|
653
|
+
organization=None,
|
|
654
|
+
phoneNumber=None,
|
|
655
|
+
postalAddress=None,
|
|
656
|
+
priority=None,
|
|
657
|
+
relation=None,
|
|
658
|
+
sensitivity=None,
|
|
659
|
+
shortName=None,
|
|
660
|
+
structuredPostalAddress=None,
|
|
661
|
+
subject=None,
|
|
662
|
+
text=None,
|
|
663
|
+
title=None,
|
|
664
|
+
userDefinedField=None,
|
|
665
|
+
website=None,
|
|
666
|
+
where=None,
|
|
667
|
+
etag=None):
|
|
668
|
+
gdata.BatchEntry.__init__(self)
|
|
669
|
+
self.billingInformation = billingInformation
|
|
670
|
+
self.birthday = birthday
|
|
671
|
+
self.calendarLink = calendarLink or []
|
|
672
|
+
self.content = content
|
|
673
|
+
self.directoryServer = directoryServer
|
|
674
|
+
self.email = email or []
|
|
675
|
+
self.event = event or []
|
|
676
|
+
self.externalId = externalId or []
|
|
677
|
+
self.gender = gender
|
|
678
|
+
self.hobby = hobby or []
|
|
679
|
+
self.im = im or []
|
|
680
|
+
self.initials = initials
|
|
681
|
+
self.jot = jot or []
|
|
682
|
+
self.language = language
|
|
683
|
+
self.maidenName = maidenName
|
|
684
|
+
self.mileage = mileage
|
|
685
|
+
self.name = name
|
|
686
|
+
self.nickname = nickname
|
|
687
|
+
self.occupation = occupation
|
|
688
|
+
self.organization = organization or []
|
|
689
|
+
self.phoneNumber = phoneNumber or []
|
|
690
|
+
self.postalAddress = postalAddress or []
|
|
691
|
+
self.priority = priority
|
|
692
|
+
self.relation = relation or []
|
|
693
|
+
self.sensitivity = sensitivity
|
|
694
|
+
self.shortName = shortName
|
|
695
|
+
self.structuredPostalAddress = structuredPostalAddress or []
|
|
696
|
+
self.subject = subject
|
|
697
|
+
self.text = text
|
|
698
|
+
self.userDefinedField = userDefinedField or []
|
|
699
|
+
self.website = website or []
|
|
700
|
+
self.where = where
|
|
701
|
+
self.extension_attributes = {}
|
|
702
|
+
self.extension_elements = []
|
|
703
|
+
self.etag = etag
|
|
704
|
+
|
|
705
|
+
class Deleted(GDataBase):
|
|
706
|
+
"""The gd:Deleted element."""
|
|
707
|
+
_tag = 'deleted'
|
|
708
|
+
|
|
709
|
+
class GroupMembershipInfo(ContactsBase):
|
|
710
|
+
"""The Google Contacts GroupMembershipInfo element."""
|
|
711
|
+
_tag = 'groupMembershipInfo'
|
|
712
|
+
_children = ContactsBase._children.copy()
|
|
713
|
+
_attributes = ContactsBase._attributes.copy()
|
|
714
|
+
_attributes['deleted'] = 'deleted'
|
|
715
|
+
_attributes['href'] = 'href'
|
|
716
|
+
|
|
717
|
+
def __init__(self, deleted=None, href=None, text=None):
|
|
718
|
+
ContactsBase.__init__(self, text=text)
|
|
719
|
+
self.deleted = deleted
|
|
720
|
+
self.href = href
|
|
721
|
+
|
|
722
|
+
class ContactEntry(PersonEntry):
|
|
723
|
+
"""Represents a contact."""
|
|
724
|
+
_tag = 'entry'
|
|
725
|
+
_namespace = atom.ATOM_NAMESPACE
|
|
726
|
+
_children = PersonEntry._children.copy()
|
|
727
|
+
|
|
728
|
+
_children['{%s}deleted' % gdata.GDATA_NAMESPACE] = ('deleted', Deleted)
|
|
729
|
+
_children['{%s}groupMembershipInfo' % CONTACTS_NAMESPACE] = ('groupMembershipInfo', [GroupMembershipInfo])
|
|
730
|
+
_children['{%s}extendedProperty' % gdata.GDATA_NAMESPACE] = ('extended_property', [gdata.ExtendedProperty])
|
|
731
|
+
# Overwrite the organization rule in PersonEntry so that a ContactEntry
|
|
732
|
+
# may only contain one <gd:organization> element.
|
|
733
|
+
#_children['{%s}organization' % gdata.GDATA_NAMESPACE] = ('organization', Organization)
|
|
734
|
+
|
|
735
|
+
def __init__(self,
|
|
736
|
+
billingInformation=None,
|
|
737
|
+
birthday=None,
|
|
738
|
+
calendarLink=None,
|
|
739
|
+
content=None,
|
|
740
|
+
deleted=None,
|
|
741
|
+
directoryServer=None,
|
|
742
|
+
email=None,
|
|
743
|
+
event=None,
|
|
744
|
+
extended_property=None,
|
|
745
|
+
externalId=None,
|
|
746
|
+
gender=None,
|
|
747
|
+
groupMembershipInfo=None,
|
|
748
|
+
hobby=None,
|
|
749
|
+
im=None,
|
|
750
|
+
initials=None,
|
|
751
|
+
jot=None,
|
|
752
|
+
language=None,
|
|
753
|
+
maidenName=None,
|
|
754
|
+
mileage=None,
|
|
755
|
+
name=None,
|
|
756
|
+
nickname=None,
|
|
757
|
+
occupation=None,
|
|
758
|
+
organization=None,
|
|
759
|
+
phoneNumber=None,
|
|
760
|
+
postalAddress=None,
|
|
761
|
+
priority=None,
|
|
762
|
+
relation=None,
|
|
763
|
+
sensitivity=None,
|
|
764
|
+
shortName=None,
|
|
765
|
+
structuredPostalAddress=None,
|
|
766
|
+
subject=None,
|
|
767
|
+
text=None,
|
|
768
|
+
title=None,
|
|
769
|
+
userDefinedField=None,
|
|
770
|
+
website=None,
|
|
771
|
+
where=None,
|
|
772
|
+
etag=None):
|
|
773
|
+
PersonEntry.__init__(self,
|
|
774
|
+
billingInformation=billingInformation,
|
|
775
|
+
birthday=birthday,
|
|
776
|
+
calendarLink=calendarLink,
|
|
777
|
+
content=content,
|
|
778
|
+
directoryServer=directoryServer,
|
|
779
|
+
email=email,
|
|
780
|
+
event=event,
|
|
781
|
+
externalId=externalId,
|
|
782
|
+
gender=gender,
|
|
783
|
+
hobby=hobby,
|
|
784
|
+
im=im,
|
|
785
|
+
initials=initials,
|
|
786
|
+
jot=jot,
|
|
787
|
+
language=language,
|
|
788
|
+
maidenName=maidenName,
|
|
789
|
+
mileage=mileage,
|
|
790
|
+
name=name,
|
|
791
|
+
nickname=nickname,
|
|
792
|
+
occupation=occupation,
|
|
793
|
+
organization=organization,
|
|
794
|
+
phoneNumber=phoneNumber,
|
|
795
|
+
postalAddress=postalAddress,
|
|
796
|
+
priority=priority,
|
|
797
|
+
relation=relation,
|
|
798
|
+
sensitivity=sensitivity,
|
|
799
|
+
shortName=shortName,
|
|
800
|
+
structuredPostalAddress=structuredPostalAddress,
|
|
801
|
+
subject=subject,
|
|
802
|
+
text=text,
|
|
803
|
+
title=title,
|
|
804
|
+
userDefinedField=userDefinedField,
|
|
805
|
+
website=website,
|
|
806
|
+
where=where,
|
|
807
|
+
etag=etag)
|
|
808
|
+
self.deleted = deleted
|
|
809
|
+
self.extended_property = extended_property or []
|
|
810
|
+
self.groupMembershipInfo = groupMembershipInfo or []
|
|
811
|
+
|
|
812
|
+
def GetPhotoLink(self):
|
|
813
|
+
for a_link in self.link:
|
|
814
|
+
if a_link.rel == PHOTO_LINK_REL:
|
|
815
|
+
return a_link
|
|
816
|
+
return None
|
|
817
|
+
|
|
818
|
+
def GetPhotoEditLink(self):
|
|
819
|
+
for a_link in self.link:
|
|
820
|
+
if a_link.rel == PHOTO_EDIT_LINK_REL:
|
|
821
|
+
return a_link
|
|
822
|
+
return None
|
|
823
|
+
|
|
824
|
+
def ContactEntryFromString(xml_string):
|
|
825
|
+
return atom.CreateClassFromXMLString(ContactEntry, xml_string)
|
|
826
|
+
|
|
827
|
+
class ContactsFeed(gdata.BatchFeed, gdata.LinkFinder):
|
|
828
|
+
"""A Google contacts feed flavor of an Atom Feed."""
|
|
829
|
+
_tag = 'feed'
|
|
830
|
+
_namespace = atom.ATOM_NAMESPACE
|
|
831
|
+
_children = gdata.BatchFeed._children.copy()
|
|
832
|
+
_children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [ContactEntry])
|
|
833
|
+
|
|
834
|
+
def __init__(self):
|
|
835
|
+
gdata.BatchFeed.__init__(self)
|
|
836
|
+
|
|
837
|
+
def ContactsFeedFromString(xml_string):
|
|
838
|
+
return atom.CreateClassFromXMLString(ContactsFeed, xml_string)
|
|
839
|
+
|
|
840
|
+
class GroupEntry(gdata.BatchEntry):
|
|
841
|
+
"""Represents a contact group."""
|
|
842
|
+
_children = gdata.BatchEntry._children.copy()
|
|
843
|
+
_children['{%s}deleted' % gdata.GDATA_NAMESPACE] = ('deleted', Deleted)
|
|
844
|
+
_children['{%s}extendedProperty' % gdata.GDATA_NAMESPACE] = ('extended_property', [gdata.ExtendedProperty])
|
|
845
|
+
|
|
846
|
+
_attributes = gdata.BatchEntry._attributes.copy()
|
|
847
|
+
_attributes['{%s}etag' % gdata.GDATA_NAMESPACE] = 'etag'
|
|
848
|
+
|
|
849
|
+
def __init__(self,
|
|
850
|
+
title=None,
|
|
851
|
+
deleted=None,
|
|
852
|
+
extended_property=None,
|
|
853
|
+
etag=None):
|
|
854
|
+
gdata.BatchEntry.__init__(self)
|
|
855
|
+
self.title = title
|
|
856
|
+
self.deleted = deleted
|
|
857
|
+
self.extended_property = extended_property or []
|
|
858
|
+
self.etag = etag
|
|
859
|
+
|
|
860
|
+
def GroupEntryFromString(xml_string):
|
|
861
|
+
return atom.CreateClassFromXMLString(GroupEntry, xml_string)
|
|
862
|
+
|
|
863
|
+
class GroupsFeed(gdata.BatchFeed):
|
|
864
|
+
"""A Google contact groups feed flavor of an Atom Feed."""
|
|
865
|
+
_tag = 'feed'
|
|
866
|
+
_namespace = atom.ATOM_NAMESPACE
|
|
867
|
+
_children = gdata.BatchFeed._children.copy()
|
|
868
|
+
_children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [GroupEntry])
|
|
869
|
+
|
|
870
|
+
def __init__(self):
|
|
871
|
+
gdata.BatchFeed.__init__(self)
|
|
872
|
+
|
|
873
|
+
def GroupsFeedFromString(xml_string):
|
|
874
|
+
return atom.CreateClassFromXMLString(GroupsFeed, xml_string)
|