slidge-whatsapp 0.2.0a0__cp311-cp311-manylinux_2_36_x86_64.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 slidge-whatsapp might be problematic. Click here for more details.
- slidge_whatsapp/__init__.py +11 -0
- slidge_whatsapp/__main__.py +9 -0
- slidge_whatsapp/attachment.go +386 -0
- slidge_whatsapp/command.py +143 -0
- slidge_whatsapp/config.py +38 -0
- slidge_whatsapp/contact.py +75 -0
- slidge_whatsapp/event.go +856 -0
- slidge_whatsapp/gateway.go +175 -0
- slidge_whatsapp/gateway.py +97 -0
- slidge_whatsapp/generated/__init__.py +0 -0
- slidge_whatsapp/generated/_whatsapp.cpython-311-x86_64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +378 -0
- slidge_whatsapp/generated/go.py +1720 -0
- slidge_whatsapp/generated/whatsapp.py +2797 -0
- slidge_whatsapp/go.mod +28 -0
- slidge_whatsapp/go.sum +55 -0
- slidge_whatsapp/group.py +240 -0
- slidge_whatsapp/session.go +783 -0
- slidge_whatsapp/session.py +663 -0
- slidge_whatsapp/util.py +12 -0
- slidge_whatsapp-0.2.0a0.dist-info/LICENSE +661 -0
- slidge_whatsapp-0.2.0a0.dist-info/METADATA +81 -0
- slidge_whatsapp-0.2.0a0.dist-info/RECORD +25 -0
- slidge_whatsapp-0.2.0a0.dist-info/WHEEL +4 -0
- slidge_whatsapp-0.2.0a0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,2797 @@
|
|
|
1
|
+
|
|
2
|
+
# python wrapper for package git.sr.ht/~nicoco/slidge-whatsapp/slidge_whatsapp within overall package whatsapp
|
|
3
|
+
# This is what you import to use the package.
|
|
4
|
+
# File is generated by gopy. Do not edit.
|
|
5
|
+
# gopy build -output=generated -no-make=true .
|
|
6
|
+
|
|
7
|
+
# the following is required to enable dlopen to open the _go.so file
|
|
8
|
+
import os,sys,inspect,collections
|
|
9
|
+
try:
|
|
10
|
+
import collections.abc as _collections_abc
|
|
11
|
+
except ImportError:
|
|
12
|
+
_collections_abc = collections
|
|
13
|
+
|
|
14
|
+
cwd = os.getcwd()
|
|
15
|
+
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
|
16
|
+
os.chdir(currentdir)
|
|
17
|
+
from . import _whatsapp
|
|
18
|
+
from . import go
|
|
19
|
+
|
|
20
|
+
os.chdir(cwd)
|
|
21
|
+
|
|
22
|
+
# to use this code in your end-user python file, import it as follows:
|
|
23
|
+
# from whatsapp import whatsapp
|
|
24
|
+
# and then refer to everything using whatsapp. prefix
|
|
25
|
+
# packages imported by this package listed below:
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# ---- Types ---
|
|
31
|
+
|
|
32
|
+
# Python type for slice []whatsapp.Attachment
|
|
33
|
+
class Slice_whatsapp_Attachment(go.GoClass):
|
|
34
|
+
""""""
|
|
35
|
+
def __init__(self, *args, **kwargs):
|
|
36
|
+
"""
|
|
37
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
38
|
+
otherwise parameter is a python list that we copy from
|
|
39
|
+
"""
|
|
40
|
+
self.index = 0
|
|
41
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
42
|
+
self.handle = kwargs['handle']
|
|
43
|
+
_whatsapp.IncRef(self.handle)
|
|
44
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
45
|
+
self.handle = args[0].handle
|
|
46
|
+
_whatsapp.IncRef(self.handle)
|
|
47
|
+
else:
|
|
48
|
+
self.handle = _whatsapp.Slice_whatsapp_Attachment_CTor()
|
|
49
|
+
_whatsapp.IncRef(self.handle)
|
|
50
|
+
if len(args) > 0:
|
|
51
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
52
|
+
raise TypeError('Slice_whatsapp_Attachment.__init__ takes a sequence as argument')
|
|
53
|
+
for elt in args[0]:
|
|
54
|
+
self.append(elt)
|
|
55
|
+
def __del__(self):
|
|
56
|
+
_whatsapp.DecRef(self.handle)
|
|
57
|
+
def __str__(self):
|
|
58
|
+
s = 'whatsapp.Slice_whatsapp_Attachment len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
59
|
+
if len(self) < 120:
|
|
60
|
+
s += ', '.join(map(str, self)) + ']'
|
|
61
|
+
return s
|
|
62
|
+
def __repr__(self):
|
|
63
|
+
return 'whatsapp.Slice_whatsapp_Attachment([' + ', '.join(map(str, self)) + '])'
|
|
64
|
+
def __len__(self):
|
|
65
|
+
return _whatsapp.Slice_whatsapp_Attachment_len(self.handle)
|
|
66
|
+
def __getitem__(self, key):
|
|
67
|
+
if isinstance(key, slice):
|
|
68
|
+
if key.step == None or key.step == 1:
|
|
69
|
+
st = key.start
|
|
70
|
+
ed = key.stop
|
|
71
|
+
if st == None:
|
|
72
|
+
st = 0
|
|
73
|
+
if ed == None:
|
|
74
|
+
ed = _whatsapp.Slice_whatsapp_Attachment_len(self.handle)
|
|
75
|
+
return Slice_whatsapp_Attachment(handle=_whatsapp.Slice_whatsapp_Attachment_subslice(self.handle, st, ed))
|
|
76
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
77
|
+
elif isinstance(key, int):
|
|
78
|
+
if key < 0:
|
|
79
|
+
key += len(self)
|
|
80
|
+
if key < 0 or key >= len(self):
|
|
81
|
+
raise IndexError('slice index out of range')
|
|
82
|
+
return Attachment(handle=_whatsapp.Slice_whatsapp_Attachment_elem(self.handle, key))
|
|
83
|
+
else:
|
|
84
|
+
raise TypeError('slice index invalid type')
|
|
85
|
+
def __setitem__(self, idx, value):
|
|
86
|
+
if idx < 0:
|
|
87
|
+
idx += len(self)
|
|
88
|
+
if idx < len(self):
|
|
89
|
+
_whatsapp.Slice_whatsapp_Attachment_set(self.handle, idx, value.handle)
|
|
90
|
+
return
|
|
91
|
+
raise IndexError('slice index out of range')
|
|
92
|
+
def __iadd__(self, value):
|
|
93
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
94
|
+
raise TypeError('Slice_whatsapp_Attachment.__iadd__ takes a sequence as argument')
|
|
95
|
+
for elt in value:
|
|
96
|
+
self.append(elt)
|
|
97
|
+
return self
|
|
98
|
+
def __iter__(self):
|
|
99
|
+
self.index = 0
|
|
100
|
+
return self
|
|
101
|
+
def __next__(self):
|
|
102
|
+
if self.index < len(self):
|
|
103
|
+
rv = Attachment(handle=_whatsapp.Slice_whatsapp_Attachment_elem(self.handle, self.index))
|
|
104
|
+
self.index = self.index + 1
|
|
105
|
+
return rv
|
|
106
|
+
raise StopIteration
|
|
107
|
+
def append(self, value):
|
|
108
|
+
_whatsapp.Slice_whatsapp_Attachment_append(self.handle, value.handle)
|
|
109
|
+
def copy(self, src):
|
|
110
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
111
|
+
mx = min(len(self), len(src))
|
|
112
|
+
for i in range(mx):
|
|
113
|
+
self[i] = src[i]
|
|
114
|
+
|
|
115
|
+
# Python type for slice []whatsapp.Contact
|
|
116
|
+
class Slice_whatsapp_Contact(go.GoClass):
|
|
117
|
+
""""""
|
|
118
|
+
def __init__(self, *args, **kwargs):
|
|
119
|
+
"""
|
|
120
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
121
|
+
otherwise parameter is a python list that we copy from
|
|
122
|
+
"""
|
|
123
|
+
self.index = 0
|
|
124
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
125
|
+
self.handle = kwargs['handle']
|
|
126
|
+
_whatsapp.IncRef(self.handle)
|
|
127
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
128
|
+
self.handle = args[0].handle
|
|
129
|
+
_whatsapp.IncRef(self.handle)
|
|
130
|
+
else:
|
|
131
|
+
self.handle = _whatsapp.Slice_whatsapp_Contact_CTor()
|
|
132
|
+
_whatsapp.IncRef(self.handle)
|
|
133
|
+
if len(args) > 0:
|
|
134
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
135
|
+
raise TypeError('Slice_whatsapp_Contact.__init__ takes a sequence as argument')
|
|
136
|
+
for elt in args[0]:
|
|
137
|
+
self.append(elt)
|
|
138
|
+
def __del__(self):
|
|
139
|
+
_whatsapp.DecRef(self.handle)
|
|
140
|
+
def __str__(self):
|
|
141
|
+
s = 'whatsapp.Slice_whatsapp_Contact len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
142
|
+
if len(self) < 120:
|
|
143
|
+
s += ', '.join(map(str, self)) + ']'
|
|
144
|
+
return s
|
|
145
|
+
def __repr__(self):
|
|
146
|
+
return 'whatsapp.Slice_whatsapp_Contact([' + ', '.join(map(str, self)) + '])'
|
|
147
|
+
def __len__(self):
|
|
148
|
+
return _whatsapp.Slice_whatsapp_Contact_len(self.handle)
|
|
149
|
+
def __getitem__(self, key):
|
|
150
|
+
if isinstance(key, slice):
|
|
151
|
+
if key.step == None or key.step == 1:
|
|
152
|
+
st = key.start
|
|
153
|
+
ed = key.stop
|
|
154
|
+
if st == None:
|
|
155
|
+
st = 0
|
|
156
|
+
if ed == None:
|
|
157
|
+
ed = _whatsapp.Slice_whatsapp_Contact_len(self.handle)
|
|
158
|
+
return Slice_whatsapp_Contact(handle=_whatsapp.Slice_whatsapp_Contact_subslice(self.handle, st, ed))
|
|
159
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
160
|
+
elif isinstance(key, int):
|
|
161
|
+
if key < 0:
|
|
162
|
+
key += len(self)
|
|
163
|
+
if key < 0 or key >= len(self):
|
|
164
|
+
raise IndexError('slice index out of range')
|
|
165
|
+
return Contact(handle=_whatsapp.Slice_whatsapp_Contact_elem(self.handle, key))
|
|
166
|
+
else:
|
|
167
|
+
raise TypeError('slice index invalid type')
|
|
168
|
+
def __setitem__(self, idx, value):
|
|
169
|
+
if idx < 0:
|
|
170
|
+
idx += len(self)
|
|
171
|
+
if idx < len(self):
|
|
172
|
+
_whatsapp.Slice_whatsapp_Contact_set(self.handle, idx, value.handle)
|
|
173
|
+
return
|
|
174
|
+
raise IndexError('slice index out of range')
|
|
175
|
+
def __iadd__(self, value):
|
|
176
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
177
|
+
raise TypeError('Slice_whatsapp_Contact.__iadd__ takes a sequence as argument')
|
|
178
|
+
for elt in value:
|
|
179
|
+
self.append(elt)
|
|
180
|
+
return self
|
|
181
|
+
def __iter__(self):
|
|
182
|
+
self.index = 0
|
|
183
|
+
return self
|
|
184
|
+
def __next__(self):
|
|
185
|
+
if self.index < len(self):
|
|
186
|
+
rv = Contact(handle=_whatsapp.Slice_whatsapp_Contact_elem(self.handle, self.index))
|
|
187
|
+
self.index = self.index + 1
|
|
188
|
+
return rv
|
|
189
|
+
raise StopIteration
|
|
190
|
+
def append(self, value):
|
|
191
|
+
_whatsapp.Slice_whatsapp_Contact_append(self.handle, value.handle)
|
|
192
|
+
def copy(self, src):
|
|
193
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
194
|
+
mx = min(len(self), len(src))
|
|
195
|
+
for i in range(mx):
|
|
196
|
+
self[i] = src[i]
|
|
197
|
+
|
|
198
|
+
# Python type for slice []whatsapp.Group
|
|
199
|
+
class Slice_whatsapp_Group(go.GoClass):
|
|
200
|
+
""""""
|
|
201
|
+
def __init__(self, *args, **kwargs):
|
|
202
|
+
"""
|
|
203
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
204
|
+
otherwise parameter is a python list that we copy from
|
|
205
|
+
"""
|
|
206
|
+
self.index = 0
|
|
207
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
208
|
+
self.handle = kwargs['handle']
|
|
209
|
+
_whatsapp.IncRef(self.handle)
|
|
210
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
211
|
+
self.handle = args[0].handle
|
|
212
|
+
_whatsapp.IncRef(self.handle)
|
|
213
|
+
else:
|
|
214
|
+
self.handle = _whatsapp.Slice_whatsapp_Group_CTor()
|
|
215
|
+
_whatsapp.IncRef(self.handle)
|
|
216
|
+
if len(args) > 0:
|
|
217
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
218
|
+
raise TypeError('Slice_whatsapp_Group.__init__ takes a sequence as argument')
|
|
219
|
+
for elt in args[0]:
|
|
220
|
+
self.append(elt)
|
|
221
|
+
def __del__(self):
|
|
222
|
+
_whatsapp.DecRef(self.handle)
|
|
223
|
+
def __str__(self):
|
|
224
|
+
s = 'whatsapp.Slice_whatsapp_Group len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
225
|
+
if len(self) < 120:
|
|
226
|
+
s += ', '.join(map(str, self)) + ']'
|
|
227
|
+
return s
|
|
228
|
+
def __repr__(self):
|
|
229
|
+
return 'whatsapp.Slice_whatsapp_Group([' + ', '.join(map(str, self)) + '])'
|
|
230
|
+
def __len__(self):
|
|
231
|
+
return _whatsapp.Slice_whatsapp_Group_len(self.handle)
|
|
232
|
+
def __getitem__(self, key):
|
|
233
|
+
if isinstance(key, slice):
|
|
234
|
+
if key.step == None or key.step == 1:
|
|
235
|
+
st = key.start
|
|
236
|
+
ed = key.stop
|
|
237
|
+
if st == None:
|
|
238
|
+
st = 0
|
|
239
|
+
if ed == None:
|
|
240
|
+
ed = _whatsapp.Slice_whatsapp_Group_len(self.handle)
|
|
241
|
+
return Slice_whatsapp_Group(handle=_whatsapp.Slice_whatsapp_Group_subslice(self.handle, st, ed))
|
|
242
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
243
|
+
elif isinstance(key, int):
|
|
244
|
+
if key < 0:
|
|
245
|
+
key += len(self)
|
|
246
|
+
if key < 0 or key >= len(self):
|
|
247
|
+
raise IndexError('slice index out of range')
|
|
248
|
+
return Group(handle=_whatsapp.Slice_whatsapp_Group_elem(self.handle, key))
|
|
249
|
+
else:
|
|
250
|
+
raise TypeError('slice index invalid type')
|
|
251
|
+
def __setitem__(self, idx, value):
|
|
252
|
+
if idx < 0:
|
|
253
|
+
idx += len(self)
|
|
254
|
+
if idx < len(self):
|
|
255
|
+
_whatsapp.Slice_whatsapp_Group_set(self.handle, idx, value.handle)
|
|
256
|
+
return
|
|
257
|
+
raise IndexError('slice index out of range')
|
|
258
|
+
def __iadd__(self, value):
|
|
259
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
260
|
+
raise TypeError('Slice_whatsapp_Group.__iadd__ takes a sequence as argument')
|
|
261
|
+
for elt in value:
|
|
262
|
+
self.append(elt)
|
|
263
|
+
return self
|
|
264
|
+
def __iter__(self):
|
|
265
|
+
self.index = 0
|
|
266
|
+
return self
|
|
267
|
+
def __next__(self):
|
|
268
|
+
if self.index < len(self):
|
|
269
|
+
rv = Group(handle=_whatsapp.Slice_whatsapp_Group_elem(self.handle, self.index))
|
|
270
|
+
self.index = self.index + 1
|
|
271
|
+
return rv
|
|
272
|
+
raise StopIteration
|
|
273
|
+
def append(self, value):
|
|
274
|
+
_whatsapp.Slice_whatsapp_Group_append(self.handle, value.handle)
|
|
275
|
+
def copy(self, src):
|
|
276
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
277
|
+
mx = min(len(self), len(src))
|
|
278
|
+
for i in range(mx):
|
|
279
|
+
self[i] = src[i]
|
|
280
|
+
|
|
281
|
+
# Python type for slice []whatsapp.GroupParticipant
|
|
282
|
+
class Slice_whatsapp_GroupParticipant(go.GoClass):
|
|
283
|
+
""""""
|
|
284
|
+
def __init__(self, *args, **kwargs):
|
|
285
|
+
"""
|
|
286
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
287
|
+
otherwise parameter is a python list that we copy from
|
|
288
|
+
"""
|
|
289
|
+
self.index = 0
|
|
290
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
291
|
+
self.handle = kwargs['handle']
|
|
292
|
+
_whatsapp.IncRef(self.handle)
|
|
293
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
294
|
+
self.handle = args[0].handle
|
|
295
|
+
_whatsapp.IncRef(self.handle)
|
|
296
|
+
else:
|
|
297
|
+
self.handle = _whatsapp.Slice_whatsapp_GroupParticipant_CTor()
|
|
298
|
+
_whatsapp.IncRef(self.handle)
|
|
299
|
+
if len(args) > 0:
|
|
300
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
301
|
+
raise TypeError('Slice_whatsapp_GroupParticipant.__init__ takes a sequence as argument')
|
|
302
|
+
for elt in args[0]:
|
|
303
|
+
self.append(elt)
|
|
304
|
+
def __del__(self):
|
|
305
|
+
_whatsapp.DecRef(self.handle)
|
|
306
|
+
def __str__(self):
|
|
307
|
+
s = 'whatsapp.Slice_whatsapp_GroupParticipant len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
308
|
+
if len(self) < 120:
|
|
309
|
+
s += ', '.join(map(str, self)) + ']'
|
|
310
|
+
return s
|
|
311
|
+
def __repr__(self):
|
|
312
|
+
return 'whatsapp.Slice_whatsapp_GroupParticipant([' + ', '.join(map(str, self)) + '])'
|
|
313
|
+
def __len__(self):
|
|
314
|
+
return _whatsapp.Slice_whatsapp_GroupParticipant_len(self.handle)
|
|
315
|
+
def __getitem__(self, key):
|
|
316
|
+
if isinstance(key, slice):
|
|
317
|
+
if key.step == None or key.step == 1:
|
|
318
|
+
st = key.start
|
|
319
|
+
ed = key.stop
|
|
320
|
+
if st == None:
|
|
321
|
+
st = 0
|
|
322
|
+
if ed == None:
|
|
323
|
+
ed = _whatsapp.Slice_whatsapp_GroupParticipant_len(self.handle)
|
|
324
|
+
return Slice_whatsapp_GroupParticipant(handle=_whatsapp.Slice_whatsapp_GroupParticipant_subslice(self.handle, st, ed))
|
|
325
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
326
|
+
elif isinstance(key, int):
|
|
327
|
+
if key < 0:
|
|
328
|
+
key += len(self)
|
|
329
|
+
if key < 0 or key >= len(self):
|
|
330
|
+
raise IndexError('slice index out of range')
|
|
331
|
+
return GroupParticipant(handle=_whatsapp.Slice_whatsapp_GroupParticipant_elem(self.handle, key))
|
|
332
|
+
else:
|
|
333
|
+
raise TypeError('slice index invalid type')
|
|
334
|
+
def __setitem__(self, idx, value):
|
|
335
|
+
if idx < 0:
|
|
336
|
+
idx += len(self)
|
|
337
|
+
if idx < len(self):
|
|
338
|
+
_whatsapp.Slice_whatsapp_GroupParticipant_set(self.handle, idx, value.handle)
|
|
339
|
+
return
|
|
340
|
+
raise IndexError('slice index out of range')
|
|
341
|
+
def __iadd__(self, value):
|
|
342
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
343
|
+
raise TypeError('Slice_whatsapp_GroupParticipant.__iadd__ takes a sequence as argument')
|
|
344
|
+
for elt in value:
|
|
345
|
+
self.append(elt)
|
|
346
|
+
return self
|
|
347
|
+
def __iter__(self):
|
|
348
|
+
self.index = 0
|
|
349
|
+
return self
|
|
350
|
+
def __next__(self):
|
|
351
|
+
if self.index < len(self):
|
|
352
|
+
rv = GroupParticipant(handle=_whatsapp.Slice_whatsapp_GroupParticipant_elem(self.handle, self.index))
|
|
353
|
+
self.index = self.index + 1
|
|
354
|
+
return rv
|
|
355
|
+
raise StopIteration
|
|
356
|
+
def append(self, value):
|
|
357
|
+
_whatsapp.Slice_whatsapp_GroupParticipant_append(self.handle, value.handle)
|
|
358
|
+
def copy(self, src):
|
|
359
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
360
|
+
mx = min(len(self), len(src))
|
|
361
|
+
for i in range(mx):
|
|
362
|
+
self[i] = src[i]
|
|
363
|
+
|
|
364
|
+
# Python type for slice []whatsapp.Message
|
|
365
|
+
class Slice_whatsapp_Message(go.GoClass):
|
|
366
|
+
""""""
|
|
367
|
+
def __init__(self, *args, **kwargs):
|
|
368
|
+
"""
|
|
369
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
370
|
+
otherwise parameter is a python list that we copy from
|
|
371
|
+
"""
|
|
372
|
+
self.index = 0
|
|
373
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
374
|
+
self.handle = kwargs['handle']
|
|
375
|
+
_whatsapp.IncRef(self.handle)
|
|
376
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
377
|
+
self.handle = args[0].handle
|
|
378
|
+
_whatsapp.IncRef(self.handle)
|
|
379
|
+
else:
|
|
380
|
+
self.handle = _whatsapp.Slice_whatsapp_Message_CTor()
|
|
381
|
+
_whatsapp.IncRef(self.handle)
|
|
382
|
+
if len(args) > 0:
|
|
383
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
384
|
+
raise TypeError('Slice_whatsapp_Message.__init__ takes a sequence as argument')
|
|
385
|
+
for elt in args[0]:
|
|
386
|
+
self.append(elt)
|
|
387
|
+
def __del__(self):
|
|
388
|
+
_whatsapp.DecRef(self.handle)
|
|
389
|
+
def __str__(self):
|
|
390
|
+
s = 'whatsapp.Slice_whatsapp_Message len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
391
|
+
if len(self) < 120:
|
|
392
|
+
s += ', '.join(map(str, self)) + ']'
|
|
393
|
+
return s
|
|
394
|
+
def __repr__(self):
|
|
395
|
+
return 'whatsapp.Slice_whatsapp_Message([' + ', '.join(map(str, self)) + '])'
|
|
396
|
+
def __len__(self):
|
|
397
|
+
return _whatsapp.Slice_whatsapp_Message_len(self.handle)
|
|
398
|
+
def __getitem__(self, key):
|
|
399
|
+
if isinstance(key, slice):
|
|
400
|
+
if key.step == None or key.step == 1:
|
|
401
|
+
st = key.start
|
|
402
|
+
ed = key.stop
|
|
403
|
+
if st == None:
|
|
404
|
+
st = 0
|
|
405
|
+
if ed == None:
|
|
406
|
+
ed = _whatsapp.Slice_whatsapp_Message_len(self.handle)
|
|
407
|
+
return Slice_whatsapp_Message(handle=_whatsapp.Slice_whatsapp_Message_subslice(self.handle, st, ed))
|
|
408
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
409
|
+
elif isinstance(key, int):
|
|
410
|
+
if key < 0:
|
|
411
|
+
key += len(self)
|
|
412
|
+
if key < 0 or key >= len(self):
|
|
413
|
+
raise IndexError('slice index out of range')
|
|
414
|
+
return Message(handle=_whatsapp.Slice_whatsapp_Message_elem(self.handle, key))
|
|
415
|
+
else:
|
|
416
|
+
raise TypeError('slice index invalid type')
|
|
417
|
+
def __setitem__(self, idx, value):
|
|
418
|
+
if idx < 0:
|
|
419
|
+
idx += len(self)
|
|
420
|
+
if idx < len(self):
|
|
421
|
+
_whatsapp.Slice_whatsapp_Message_set(self.handle, idx, value.handle)
|
|
422
|
+
return
|
|
423
|
+
raise IndexError('slice index out of range')
|
|
424
|
+
def __iadd__(self, value):
|
|
425
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
426
|
+
raise TypeError('Slice_whatsapp_Message.__iadd__ takes a sequence as argument')
|
|
427
|
+
for elt in value:
|
|
428
|
+
self.append(elt)
|
|
429
|
+
return self
|
|
430
|
+
def __iter__(self):
|
|
431
|
+
self.index = 0
|
|
432
|
+
return self
|
|
433
|
+
def __next__(self):
|
|
434
|
+
if self.index < len(self):
|
|
435
|
+
rv = Message(handle=_whatsapp.Slice_whatsapp_Message_elem(self.handle, self.index))
|
|
436
|
+
self.index = self.index + 1
|
|
437
|
+
return rv
|
|
438
|
+
raise StopIteration
|
|
439
|
+
def append(self, value):
|
|
440
|
+
_whatsapp.Slice_whatsapp_Message_append(self.handle, value.handle)
|
|
441
|
+
def copy(self, src):
|
|
442
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
443
|
+
mx = min(len(self), len(src))
|
|
444
|
+
for i in range(mx):
|
|
445
|
+
self[i] = src[i]
|
|
446
|
+
|
|
447
|
+
# Python type for slice []whatsapp.Receipt
|
|
448
|
+
class Slice_whatsapp_Receipt(go.GoClass):
|
|
449
|
+
""""""
|
|
450
|
+
def __init__(self, *args, **kwargs):
|
|
451
|
+
"""
|
|
452
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
453
|
+
otherwise parameter is a python list that we copy from
|
|
454
|
+
"""
|
|
455
|
+
self.index = 0
|
|
456
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
457
|
+
self.handle = kwargs['handle']
|
|
458
|
+
_whatsapp.IncRef(self.handle)
|
|
459
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
460
|
+
self.handle = args[0].handle
|
|
461
|
+
_whatsapp.IncRef(self.handle)
|
|
462
|
+
else:
|
|
463
|
+
self.handle = _whatsapp.Slice_whatsapp_Receipt_CTor()
|
|
464
|
+
_whatsapp.IncRef(self.handle)
|
|
465
|
+
if len(args) > 0:
|
|
466
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
467
|
+
raise TypeError('Slice_whatsapp_Receipt.__init__ takes a sequence as argument')
|
|
468
|
+
for elt in args[0]:
|
|
469
|
+
self.append(elt)
|
|
470
|
+
def __del__(self):
|
|
471
|
+
_whatsapp.DecRef(self.handle)
|
|
472
|
+
def __str__(self):
|
|
473
|
+
s = 'whatsapp.Slice_whatsapp_Receipt len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
474
|
+
if len(self) < 120:
|
|
475
|
+
s += ', '.join(map(str, self)) + ']'
|
|
476
|
+
return s
|
|
477
|
+
def __repr__(self):
|
|
478
|
+
return 'whatsapp.Slice_whatsapp_Receipt([' + ', '.join(map(str, self)) + '])'
|
|
479
|
+
def __len__(self):
|
|
480
|
+
return _whatsapp.Slice_whatsapp_Receipt_len(self.handle)
|
|
481
|
+
def __getitem__(self, key):
|
|
482
|
+
if isinstance(key, slice):
|
|
483
|
+
if key.step == None or key.step == 1:
|
|
484
|
+
st = key.start
|
|
485
|
+
ed = key.stop
|
|
486
|
+
if st == None:
|
|
487
|
+
st = 0
|
|
488
|
+
if ed == None:
|
|
489
|
+
ed = _whatsapp.Slice_whatsapp_Receipt_len(self.handle)
|
|
490
|
+
return Slice_whatsapp_Receipt(handle=_whatsapp.Slice_whatsapp_Receipt_subslice(self.handle, st, ed))
|
|
491
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
492
|
+
elif isinstance(key, int):
|
|
493
|
+
if key < 0:
|
|
494
|
+
key += len(self)
|
|
495
|
+
if key < 0 or key >= len(self):
|
|
496
|
+
raise IndexError('slice index out of range')
|
|
497
|
+
return Receipt(handle=_whatsapp.Slice_whatsapp_Receipt_elem(self.handle, key))
|
|
498
|
+
else:
|
|
499
|
+
raise TypeError('slice index invalid type')
|
|
500
|
+
def __setitem__(self, idx, value):
|
|
501
|
+
if idx < 0:
|
|
502
|
+
idx += len(self)
|
|
503
|
+
if idx < len(self):
|
|
504
|
+
_whatsapp.Slice_whatsapp_Receipt_set(self.handle, idx, value.handle)
|
|
505
|
+
return
|
|
506
|
+
raise IndexError('slice index out of range')
|
|
507
|
+
def __iadd__(self, value):
|
|
508
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
509
|
+
raise TypeError('Slice_whatsapp_Receipt.__iadd__ takes a sequence as argument')
|
|
510
|
+
for elt in value:
|
|
511
|
+
self.append(elt)
|
|
512
|
+
return self
|
|
513
|
+
def __iter__(self):
|
|
514
|
+
self.index = 0
|
|
515
|
+
return self
|
|
516
|
+
def __next__(self):
|
|
517
|
+
if self.index < len(self):
|
|
518
|
+
rv = Receipt(handle=_whatsapp.Slice_whatsapp_Receipt_elem(self.handle, self.index))
|
|
519
|
+
self.index = self.index + 1
|
|
520
|
+
return rv
|
|
521
|
+
raise StopIteration
|
|
522
|
+
def append(self, value):
|
|
523
|
+
_whatsapp.Slice_whatsapp_Receipt_append(self.handle, value.handle)
|
|
524
|
+
def copy(self, src):
|
|
525
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
526
|
+
mx = min(len(self), len(src))
|
|
527
|
+
for i in range(mx):
|
|
528
|
+
self[i] = src[i]
|
|
529
|
+
|
|
530
|
+
# Python type for slice []types.GroupParticipant
|
|
531
|
+
class Slice_types_GroupParticipant(go.GoClass):
|
|
532
|
+
""""""
|
|
533
|
+
def __init__(self, *args, **kwargs):
|
|
534
|
+
"""
|
|
535
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
536
|
+
otherwise parameter is a python list that we copy from
|
|
537
|
+
"""
|
|
538
|
+
self.index = 0
|
|
539
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
540
|
+
self.handle = kwargs['handle']
|
|
541
|
+
_whatsapp.IncRef(self.handle)
|
|
542
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
543
|
+
self.handle = args[0].handle
|
|
544
|
+
_whatsapp.IncRef(self.handle)
|
|
545
|
+
else:
|
|
546
|
+
self.handle = _whatsapp.Slice_types_GroupParticipant_CTor()
|
|
547
|
+
_whatsapp.IncRef(self.handle)
|
|
548
|
+
if len(args) > 0:
|
|
549
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
550
|
+
raise TypeError('Slice_types_GroupParticipant.__init__ takes a sequence as argument')
|
|
551
|
+
for elt in args[0]:
|
|
552
|
+
self.append(elt)
|
|
553
|
+
def __del__(self):
|
|
554
|
+
_whatsapp.DecRef(self.handle)
|
|
555
|
+
def __str__(self):
|
|
556
|
+
s = 'whatsapp.Slice_types_GroupParticipant len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
557
|
+
if len(self) < 120:
|
|
558
|
+
s += ', '.join(map(str, self)) + ']'
|
|
559
|
+
return s
|
|
560
|
+
def __repr__(self):
|
|
561
|
+
return 'whatsapp.Slice_types_GroupParticipant([' + ', '.join(map(str, self)) + '])'
|
|
562
|
+
def __len__(self):
|
|
563
|
+
return _whatsapp.Slice_types_GroupParticipant_len(self.handle)
|
|
564
|
+
def __getitem__(self, key):
|
|
565
|
+
if isinstance(key, slice):
|
|
566
|
+
if key.step == None or key.step == 1:
|
|
567
|
+
st = key.start
|
|
568
|
+
ed = key.stop
|
|
569
|
+
if st == None:
|
|
570
|
+
st = 0
|
|
571
|
+
if ed == None:
|
|
572
|
+
ed = _whatsapp.Slice_types_GroupParticipant_len(self.handle)
|
|
573
|
+
return Slice_types_GroupParticipant(handle=_whatsapp.Slice_types_GroupParticipant_subslice(self.handle, st, ed))
|
|
574
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
575
|
+
elif isinstance(key, int):
|
|
576
|
+
if key < 0:
|
|
577
|
+
key += len(self)
|
|
578
|
+
if key < 0 or key >= len(self):
|
|
579
|
+
raise IndexError('slice index out of range')
|
|
580
|
+
return go.types_GroupParticipant(handle=_whatsapp.Slice_types_GroupParticipant_elem(self.handle, key))
|
|
581
|
+
else:
|
|
582
|
+
raise TypeError('slice index invalid type')
|
|
583
|
+
def __setitem__(self, idx, value):
|
|
584
|
+
if idx < 0:
|
|
585
|
+
idx += len(self)
|
|
586
|
+
if idx < len(self):
|
|
587
|
+
_whatsapp.Slice_types_GroupParticipant_set(self.handle, idx, value.handle)
|
|
588
|
+
return
|
|
589
|
+
raise IndexError('slice index out of range')
|
|
590
|
+
def __iadd__(self, value):
|
|
591
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
592
|
+
raise TypeError('Slice_types_GroupParticipant.__iadd__ takes a sequence as argument')
|
|
593
|
+
for elt in value:
|
|
594
|
+
self.append(elt)
|
|
595
|
+
return self
|
|
596
|
+
def __iter__(self):
|
|
597
|
+
self.index = 0
|
|
598
|
+
return self
|
|
599
|
+
def __next__(self):
|
|
600
|
+
if self.index < len(self):
|
|
601
|
+
rv = go.types_GroupParticipant(handle=_whatsapp.Slice_types_GroupParticipant_elem(self.handle, self.index))
|
|
602
|
+
self.index = self.index + 1
|
|
603
|
+
return rv
|
|
604
|
+
raise StopIteration
|
|
605
|
+
def append(self, value):
|
|
606
|
+
_whatsapp.Slice_types_GroupParticipant_append(self.handle, value.handle)
|
|
607
|
+
def copy(self, src):
|
|
608
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
609
|
+
mx = min(len(self), len(src))
|
|
610
|
+
for i in range(mx):
|
|
611
|
+
self[i] = src[i]
|
|
612
|
+
|
|
613
|
+
# Python type for slice []interface{}
|
|
614
|
+
class Slice_interface_(go.GoClass):
|
|
615
|
+
""""""
|
|
616
|
+
def __init__(self, *args, **kwargs):
|
|
617
|
+
"""
|
|
618
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
619
|
+
otherwise parameter is a python list that we copy from
|
|
620
|
+
"""
|
|
621
|
+
self.index = 0
|
|
622
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
623
|
+
self.handle = kwargs['handle']
|
|
624
|
+
_whatsapp.IncRef(self.handle)
|
|
625
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
626
|
+
self.handle = args[0].handle
|
|
627
|
+
_whatsapp.IncRef(self.handle)
|
|
628
|
+
else:
|
|
629
|
+
self.handle = _whatsapp.Slice_interface__CTor()
|
|
630
|
+
_whatsapp.IncRef(self.handle)
|
|
631
|
+
if len(args) > 0:
|
|
632
|
+
if not isinstance(args[0], _collections_abc.Iterable):
|
|
633
|
+
raise TypeError('Slice_interface_.__init__ takes a sequence as argument')
|
|
634
|
+
for elt in args[0]:
|
|
635
|
+
self.append(elt)
|
|
636
|
+
def __del__(self):
|
|
637
|
+
_whatsapp.DecRef(self.handle)
|
|
638
|
+
def __str__(self):
|
|
639
|
+
s = 'whatsapp.Slice_interface_ len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
|
|
640
|
+
if len(self) < 120:
|
|
641
|
+
s += ', '.join(map(str, self)) + ']'
|
|
642
|
+
return s
|
|
643
|
+
def __repr__(self):
|
|
644
|
+
return 'whatsapp.Slice_interface_([' + ', '.join(map(str, self)) + '])'
|
|
645
|
+
def __len__(self):
|
|
646
|
+
return _whatsapp.Slice_interface__len(self.handle)
|
|
647
|
+
def __getitem__(self, key):
|
|
648
|
+
if isinstance(key, slice):
|
|
649
|
+
if key.step == None or key.step == 1:
|
|
650
|
+
st = key.start
|
|
651
|
+
ed = key.stop
|
|
652
|
+
if st == None:
|
|
653
|
+
st = 0
|
|
654
|
+
if ed == None:
|
|
655
|
+
ed = _whatsapp.Slice_interface__len(self.handle)
|
|
656
|
+
return Slice_interface_(handle=_whatsapp.Slice_interface__subslice(self.handle, st, ed))
|
|
657
|
+
return [self[ii] for ii in range(*key.indices(len(self)))]
|
|
658
|
+
elif isinstance(key, int):
|
|
659
|
+
if key < 0:
|
|
660
|
+
key += len(self)
|
|
661
|
+
if key < 0 or key >= len(self):
|
|
662
|
+
raise IndexError('slice index out of range')
|
|
663
|
+
return _whatsapp.Slice_interface__elem(self.handle, key)
|
|
664
|
+
else:
|
|
665
|
+
raise TypeError('slice index invalid type')
|
|
666
|
+
def __setitem__(self, idx, value):
|
|
667
|
+
if idx < 0:
|
|
668
|
+
idx += len(self)
|
|
669
|
+
if idx < len(self):
|
|
670
|
+
_whatsapp.Slice_interface__set(self.handle, idx, value)
|
|
671
|
+
return
|
|
672
|
+
raise IndexError('slice index out of range')
|
|
673
|
+
def __iadd__(self, value):
|
|
674
|
+
if not isinstance(value, _collections_abc.Iterable):
|
|
675
|
+
raise TypeError('Slice_interface_.__iadd__ takes a sequence as argument')
|
|
676
|
+
for elt in value:
|
|
677
|
+
self.append(elt)
|
|
678
|
+
return self
|
|
679
|
+
def __iter__(self):
|
|
680
|
+
self.index = 0
|
|
681
|
+
return self
|
|
682
|
+
def __next__(self):
|
|
683
|
+
if self.index < len(self):
|
|
684
|
+
rv = _whatsapp.Slice_interface__elem(self.handle, self.index)
|
|
685
|
+
self.index = self.index + 1
|
|
686
|
+
return rv
|
|
687
|
+
raise StopIteration
|
|
688
|
+
def append(self, value):
|
|
689
|
+
_whatsapp.Slice_interface__append(self.handle, value)
|
|
690
|
+
def copy(self, src):
|
|
691
|
+
""" copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
|
|
692
|
+
mx = min(len(self), len(src))
|
|
693
|
+
for i in range(mx):
|
|
694
|
+
self[i] = src[i]
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
#---- Enums from Go (collections of consts with same type) ---
|
|
698
|
+
from enum import Enum
|
|
699
|
+
|
|
700
|
+
class CallState(Enum):
|
|
701
|
+
"""
|
|
702
|
+
CallState represents the state of the call to synchronize with.
|
|
703
|
+
|
|
704
|
+
"""
|
|
705
|
+
CallMissed = 1
|
|
706
|
+
"""
|
|
707
|
+
The call states handled by the overarching session event handler.
|
|
708
|
+
|
|
709
|
+
"""
|
|
710
|
+
|
|
711
|
+
CallMissed = 1
|
|
712
|
+
"""
|
|
713
|
+
The call states handled by the overarching session event handler.
|
|
714
|
+
|
|
715
|
+
"""
|
|
716
|
+
|
|
717
|
+
class ChatStateKind(Enum):
|
|
718
|
+
"""
|
|
719
|
+
ChatStateKind represents the different kinds of chat-states possible in WhatsApp.
|
|
720
|
+
|
|
721
|
+
"""
|
|
722
|
+
ChatStateComposing = 1
|
|
723
|
+
"""
|
|
724
|
+
The chat states handled by the overarching session event handler.
|
|
725
|
+
|
|
726
|
+
"""
|
|
727
|
+
ChatStatePaused = 2
|
|
728
|
+
"""
|
|
729
|
+
The chat states handled by the overarching session event handler.
|
|
730
|
+
|
|
731
|
+
"""
|
|
732
|
+
|
|
733
|
+
ChatStateComposing = 1
|
|
734
|
+
"""
|
|
735
|
+
The chat states handled by the overarching session event handler.
|
|
736
|
+
|
|
737
|
+
"""
|
|
738
|
+
ChatStatePaused = 2
|
|
739
|
+
"""
|
|
740
|
+
The chat states handled by the overarching session event handler.
|
|
741
|
+
|
|
742
|
+
"""
|
|
743
|
+
|
|
744
|
+
class EventKind(Enum):
|
|
745
|
+
"""
|
|
746
|
+
EventKind represents all event types recognized by the Python session adapter, as emitted by the
|
|
747
|
+
Go session adapter.
|
|
748
|
+
|
|
749
|
+
"""
|
|
750
|
+
EventUnknown = 0
|
|
751
|
+
"""
|
|
752
|
+
The event types handled by the overarching session adapter handler.
|
|
753
|
+
|
|
754
|
+
"""
|
|
755
|
+
EventQRCode = 1
|
|
756
|
+
"""
|
|
757
|
+
The event types handled by the overarching session adapter handler.
|
|
758
|
+
|
|
759
|
+
"""
|
|
760
|
+
EventPair = 2
|
|
761
|
+
"""
|
|
762
|
+
The event types handled by the overarching session adapter handler.
|
|
763
|
+
|
|
764
|
+
"""
|
|
765
|
+
EventConnected = 3
|
|
766
|
+
"""
|
|
767
|
+
The event types handled by the overarching session adapter handler.
|
|
768
|
+
|
|
769
|
+
"""
|
|
770
|
+
EventLoggedOut = 4
|
|
771
|
+
"""
|
|
772
|
+
The event types handled by the overarching session adapter handler.
|
|
773
|
+
|
|
774
|
+
"""
|
|
775
|
+
EventContact = 5
|
|
776
|
+
"""
|
|
777
|
+
The event types handled by the overarching session adapter handler.
|
|
778
|
+
|
|
779
|
+
"""
|
|
780
|
+
EventPresence = 6
|
|
781
|
+
"""
|
|
782
|
+
The event types handled by the overarching session adapter handler.
|
|
783
|
+
|
|
784
|
+
"""
|
|
785
|
+
EventMessage = 7
|
|
786
|
+
"""
|
|
787
|
+
The event types handled by the overarching session adapter handler.
|
|
788
|
+
|
|
789
|
+
"""
|
|
790
|
+
EventChatState = 8
|
|
791
|
+
"""
|
|
792
|
+
The event types handled by the overarching session adapter handler.
|
|
793
|
+
|
|
794
|
+
"""
|
|
795
|
+
EventReceipt = 9
|
|
796
|
+
"""
|
|
797
|
+
The event types handled by the overarching session adapter handler.
|
|
798
|
+
|
|
799
|
+
"""
|
|
800
|
+
EventGroup = 10
|
|
801
|
+
"""
|
|
802
|
+
The event types handled by the overarching session adapter handler.
|
|
803
|
+
|
|
804
|
+
"""
|
|
805
|
+
EventCall = 11
|
|
806
|
+
"""
|
|
807
|
+
The event types handled by the overarching session adapter handler.
|
|
808
|
+
|
|
809
|
+
"""
|
|
810
|
+
|
|
811
|
+
EventUnknown = 0
|
|
812
|
+
"""
|
|
813
|
+
The event types handled by the overarching session adapter handler.
|
|
814
|
+
|
|
815
|
+
"""
|
|
816
|
+
EventQRCode = 1
|
|
817
|
+
"""
|
|
818
|
+
The event types handled by the overarching session adapter handler.
|
|
819
|
+
|
|
820
|
+
"""
|
|
821
|
+
EventPair = 2
|
|
822
|
+
"""
|
|
823
|
+
The event types handled by the overarching session adapter handler.
|
|
824
|
+
|
|
825
|
+
"""
|
|
826
|
+
EventConnected = 3
|
|
827
|
+
"""
|
|
828
|
+
The event types handled by the overarching session adapter handler.
|
|
829
|
+
|
|
830
|
+
"""
|
|
831
|
+
EventLoggedOut = 4
|
|
832
|
+
"""
|
|
833
|
+
The event types handled by the overarching session adapter handler.
|
|
834
|
+
|
|
835
|
+
"""
|
|
836
|
+
EventContact = 5
|
|
837
|
+
"""
|
|
838
|
+
The event types handled by the overarching session adapter handler.
|
|
839
|
+
|
|
840
|
+
"""
|
|
841
|
+
EventPresence = 6
|
|
842
|
+
"""
|
|
843
|
+
The event types handled by the overarching session adapter handler.
|
|
844
|
+
|
|
845
|
+
"""
|
|
846
|
+
EventMessage = 7
|
|
847
|
+
"""
|
|
848
|
+
The event types handled by the overarching session adapter handler.
|
|
849
|
+
|
|
850
|
+
"""
|
|
851
|
+
EventChatState = 8
|
|
852
|
+
"""
|
|
853
|
+
The event types handled by the overarching session adapter handler.
|
|
854
|
+
|
|
855
|
+
"""
|
|
856
|
+
EventReceipt = 9
|
|
857
|
+
"""
|
|
858
|
+
The event types handled by the overarching session adapter handler.
|
|
859
|
+
|
|
860
|
+
"""
|
|
861
|
+
EventGroup = 10
|
|
862
|
+
"""
|
|
863
|
+
The event types handled by the overarching session adapter handler.
|
|
864
|
+
|
|
865
|
+
"""
|
|
866
|
+
EventCall = 11
|
|
867
|
+
"""
|
|
868
|
+
The event types handled by the overarching session adapter handler.
|
|
869
|
+
|
|
870
|
+
"""
|
|
871
|
+
|
|
872
|
+
class GroupAffiliation(Enum):
|
|
873
|
+
"""
|
|
874
|
+
GroupAffiliation represents the set of privilidges given to a specific participant in a group.
|
|
875
|
+
|
|
876
|
+
"""
|
|
877
|
+
GroupAffiliationNone = 0
|
|
878
|
+
GroupAffiliationAdmin = 1
|
|
879
|
+
GroupAffiliationOwner = 2
|
|
880
|
+
|
|
881
|
+
GroupAffiliationNone = 0
|
|
882
|
+
GroupAffiliationAdmin = 1
|
|
883
|
+
GroupAffiliationOwner = 2
|
|
884
|
+
|
|
885
|
+
class GroupParticipantAction(Enum):
|
|
886
|
+
"""
|
|
887
|
+
GroupParticipantAction represents the distinct set of actions that can be taken when encountering
|
|
888
|
+
a group participant, typically to add or remove.
|
|
889
|
+
|
|
890
|
+
"""
|
|
891
|
+
GroupParticipantActionAdd = 0
|
|
892
|
+
GroupParticipantActionUpdate = 1
|
|
893
|
+
GroupParticipantActionRemove = 2
|
|
894
|
+
|
|
895
|
+
GroupParticipantActionAdd = 0
|
|
896
|
+
GroupParticipantActionUpdate = 1
|
|
897
|
+
GroupParticipantActionRemove = 2
|
|
898
|
+
|
|
899
|
+
class ErrorLevel(Enum):
|
|
900
|
+
"""
|
|
901
|
+
A ErrorLevel is a value representing the severity of a log message being handled.
|
|
902
|
+
|
|
903
|
+
"""
|
|
904
|
+
LevelError = 1
|
|
905
|
+
"""
|
|
906
|
+
The log levels handled by the overarching Session logger.
|
|
907
|
+
|
|
908
|
+
"""
|
|
909
|
+
LevelWarning = 2
|
|
910
|
+
"""
|
|
911
|
+
The log levels handled by the overarching Session logger.
|
|
912
|
+
|
|
913
|
+
"""
|
|
914
|
+
LevelInfo = 3
|
|
915
|
+
"""
|
|
916
|
+
The log levels handled by the overarching Session logger.
|
|
917
|
+
|
|
918
|
+
"""
|
|
919
|
+
LevelDebug = 4
|
|
920
|
+
"""
|
|
921
|
+
The log levels handled by the overarching Session logger.
|
|
922
|
+
|
|
923
|
+
"""
|
|
924
|
+
|
|
925
|
+
LevelError = 1
|
|
926
|
+
"""
|
|
927
|
+
The log levels handled by the overarching Session logger.
|
|
928
|
+
|
|
929
|
+
"""
|
|
930
|
+
LevelWarning = 2
|
|
931
|
+
"""
|
|
932
|
+
The log levels handled by the overarching Session logger.
|
|
933
|
+
|
|
934
|
+
"""
|
|
935
|
+
LevelInfo = 3
|
|
936
|
+
"""
|
|
937
|
+
The log levels handled by the overarching Session logger.
|
|
938
|
+
|
|
939
|
+
"""
|
|
940
|
+
LevelDebug = 4
|
|
941
|
+
"""
|
|
942
|
+
The log levels handled by the overarching Session logger.
|
|
943
|
+
|
|
944
|
+
"""
|
|
945
|
+
|
|
946
|
+
class MessageKind(Enum):
|
|
947
|
+
"""
|
|
948
|
+
MessageKind represents all concrete message types (plain-text messages, edit messages, reactions)
|
|
949
|
+
recognized by the Python session adapter.
|
|
950
|
+
|
|
951
|
+
"""
|
|
952
|
+
MessagePlain = 1
|
|
953
|
+
"""
|
|
954
|
+
The message types handled by the overarching session event handler.
|
|
955
|
+
|
|
956
|
+
"""
|
|
957
|
+
MessageEdit = 2
|
|
958
|
+
"""
|
|
959
|
+
The message types handled by the overarching session event handler.
|
|
960
|
+
|
|
961
|
+
"""
|
|
962
|
+
MessageRevoke = 3
|
|
963
|
+
"""
|
|
964
|
+
The message types handled by the overarching session event handler.
|
|
965
|
+
|
|
966
|
+
"""
|
|
967
|
+
MessageReaction = 4
|
|
968
|
+
"""
|
|
969
|
+
The message types handled by the overarching session event handler.
|
|
970
|
+
|
|
971
|
+
"""
|
|
972
|
+
MessageAttachment = 5
|
|
973
|
+
"""
|
|
974
|
+
The message types handled by the overarching session event handler.
|
|
975
|
+
|
|
976
|
+
"""
|
|
977
|
+
|
|
978
|
+
MessagePlain = 1
|
|
979
|
+
"""
|
|
980
|
+
The message types handled by the overarching session event handler.
|
|
981
|
+
|
|
982
|
+
"""
|
|
983
|
+
MessageEdit = 2
|
|
984
|
+
"""
|
|
985
|
+
The message types handled by the overarching session event handler.
|
|
986
|
+
|
|
987
|
+
"""
|
|
988
|
+
MessageRevoke = 3
|
|
989
|
+
"""
|
|
990
|
+
The message types handled by the overarching session event handler.
|
|
991
|
+
|
|
992
|
+
"""
|
|
993
|
+
MessageReaction = 4
|
|
994
|
+
"""
|
|
995
|
+
The message types handled by the overarching session event handler.
|
|
996
|
+
|
|
997
|
+
"""
|
|
998
|
+
MessageAttachment = 5
|
|
999
|
+
"""
|
|
1000
|
+
The message types handled by the overarching session event handler.
|
|
1001
|
+
|
|
1002
|
+
"""
|
|
1003
|
+
|
|
1004
|
+
class PresenceKind(Enum):
|
|
1005
|
+
"""
|
|
1006
|
+
PresenceKind represents the different kinds of activity states possible in WhatsApp.
|
|
1007
|
+
|
|
1008
|
+
"""
|
|
1009
|
+
PresenceAvailable = 1
|
|
1010
|
+
"""
|
|
1011
|
+
The presences handled by the overarching session event handler.
|
|
1012
|
+
|
|
1013
|
+
"""
|
|
1014
|
+
PresenceUnavailable = 2
|
|
1015
|
+
"""
|
|
1016
|
+
The presences handled by the overarching session event handler.
|
|
1017
|
+
|
|
1018
|
+
"""
|
|
1019
|
+
|
|
1020
|
+
PresenceAvailable = 1
|
|
1021
|
+
"""
|
|
1022
|
+
The presences handled by the overarching session event handler.
|
|
1023
|
+
|
|
1024
|
+
"""
|
|
1025
|
+
PresenceUnavailable = 2
|
|
1026
|
+
"""
|
|
1027
|
+
The presences handled by the overarching session event handler.
|
|
1028
|
+
|
|
1029
|
+
"""
|
|
1030
|
+
|
|
1031
|
+
class ReceiptKind(Enum):
|
|
1032
|
+
"""
|
|
1033
|
+
ReceiptKind represents the different types of delivery receipts possible in WhatsApp.
|
|
1034
|
+
|
|
1035
|
+
"""
|
|
1036
|
+
ReceiptDelivered = 1
|
|
1037
|
+
"""
|
|
1038
|
+
The delivery receipts handled by the overarching session event handler.
|
|
1039
|
+
|
|
1040
|
+
"""
|
|
1041
|
+
ReceiptRead = 2
|
|
1042
|
+
"""
|
|
1043
|
+
The delivery receipts handled by the overarching session event handler.
|
|
1044
|
+
|
|
1045
|
+
"""
|
|
1046
|
+
|
|
1047
|
+
ReceiptDelivered = 1
|
|
1048
|
+
"""
|
|
1049
|
+
The delivery receipts handled by the overarching session event handler.
|
|
1050
|
+
|
|
1051
|
+
"""
|
|
1052
|
+
ReceiptRead = 2
|
|
1053
|
+
"""
|
|
1054
|
+
The delivery receipts handled by the overarching session event handler.
|
|
1055
|
+
|
|
1056
|
+
"""
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
#---- Constants from Go: Python can only ask that you please don't change these! ---
|
|
1061
|
+
DefaultGroupServer = "g.us"
|
|
1062
|
+
DefaultUserServer = "s.whatsapp.net"
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
# ---- Global Variables: can only use functions to access ---
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
# ---- Interfaces ---
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
# ---- Structs ---
|
|
1072
|
+
|
|
1073
|
+
# Python type for struct whatsapp.Call
|
|
1074
|
+
class Call(go.GoClass):
|
|
1075
|
+
"""A Call represents an incoming or outgoing voice/video call made over WhatsApp. Full support for\ncalls is currently not implemented, and this structure contains the bare minimum data required\nfor notifying on missed calls.\n"""
|
|
1076
|
+
def __init__(self, *args, **kwargs):
|
|
1077
|
+
"""
|
|
1078
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1079
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1080
|
+
in which case a new Go object is constructed first
|
|
1081
|
+
"""
|
|
1082
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1083
|
+
self.handle = kwargs['handle']
|
|
1084
|
+
_whatsapp.IncRef(self.handle)
|
|
1085
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1086
|
+
self.handle = args[0].handle
|
|
1087
|
+
_whatsapp.IncRef(self.handle)
|
|
1088
|
+
else:
|
|
1089
|
+
self.handle = _whatsapp.whatsapp_Call_CTor()
|
|
1090
|
+
_whatsapp.IncRef(self.handle)
|
|
1091
|
+
if 0 < len(args):
|
|
1092
|
+
self.State = args[0]
|
|
1093
|
+
if "State" in kwargs:
|
|
1094
|
+
self.State = kwargs["State"]
|
|
1095
|
+
if 1 < len(args):
|
|
1096
|
+
self.JID = args[1]
|
|
1097
|
+
if "JID" in kwargs:
|
|
1098
|
+
self.JID = kwargs["JID"]
|
|
1099
|
+
if 2 < len(args):
|
|
1100
|
+
self.Timestamp = args[2]
|
|
1101
|
+
if "Timestamp" in kwargs:
|
|
1102
|
+
self.Timestamp = kwargs["Timestamp"]
|
|
1103
|
+
def __del__(self):
|
|
1104
|
+
_whatsapp.DecRef(self.handle)
|
|
1105
|
+
def __str__(self):
|
|
1106
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1107
|
+
sv = 'whatsapp.Call{'
|
|
1108
|
+
first = True
|
|
1109
|
+
for v in pr:
|
|
1110
|
+
if callable(v[1]):
|
|
1111
|
+
continue
|
|
1112
|
+
if first:
|
|
1113
|
+
first = False
|
|
1114
|
+
else:
|
|
1115
|
+
sv += ', '
|
|
1116
|
+
sv += v[0] + '=' + str(v[1])
|
|
1117
|
+
return sv + '}'
|
|
1118
|
+
def __repr__(self):
|
|
1119
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1120
|
+
sv = 'whatsapp.Call ( '
|
|
1121
|
+
for v in pr:
|
|
1122
|
+
if not callable(v[1]):
|
|
1123
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1124
|
+
return sv + ')'
|
|
1125
|
+
@property
|
|
1126
|
+
def State(self):
|
|
1127
|
+
return _whatsapp.whatsapp_Call_State_Get(self.handle)
|
|
1128
|
+
@State.setter
|
|
1129
|
+
def State(self, value):
|
|
1130
|
+
if isinstance(value, go.GoClass):
|
|
1131
|
+
_whatsapp.whatsapp_Call_State_Set(self.handle, value.handle)
|
|
1132
|
+
else:
|
|
1133
|
+
_whatsapp.whatsapp_Call_State_Set(self.handle, value)
|
|
1134
|
+
@property
|
|
1135
|
+
def JID(self):
|
|
1136
|
+
return _whatsapp.whatsapp_Call_JID_Get(self.handle)
|
|
1137
|
+
@JID.setter
|
|
1138
|
+
def JID(self, value):
|
|
1139
|
+
if isinstance(value, go.GoClass):
|
|
1140
|
+
_whatsapp.whatsapp_Call_JID_Set(self.handle, value.handle)
|
|
1141
|
+
else:
|
|
1142
|
+
_whatsapp.whatsapp_Call_JID_Set(self.handle, value)
|
|
1143
|
+
@property
|
|
1144
|
+
def Timestamp(self):
|
|
1145
|
+
return _whatsapp.whatsapp_Call_Timestamp_Get(self.handle)
|
|
1146
|
+
@Timestamp.setter
|
|
1147
|
+
def Timestamp(self, value):
|
|
1148
|
+
if isinstance(value, go.GoClass):
|
|
1149
|
+
_whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value.handle)
|
|
1150
|
+
else:
|
|
1151
|
+
_whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value)
|
|
1152
|
+
|
|
1153
|
+
# Python type for struct whatsapp.Avatar
|
|
1154
|
+
class Avatar(go.GoClass):
|
|
1155
|
+
"""A Avatar represents a small image set for a Contact or Group.\n"""
|
|
1156
|
+
def __init__(self, *args, **kwargs):
|
|
1157
|
+
"""
|
|
1158
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1159
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1160
|
+
in which case a new Go object is constructed first
|
|
1161
|
+
"""
|
|
1162
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1163
|
+
self.handle = kwargs['handle']
|
|
1164
|
+
_whatsapp.IncRef(self.handle)
|
|
1165
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1166
|
+
self.handle = args[0].handle
|
|
1167
|
+
_whatsapp.IncRef(self.handle)
|
|
1168
|
+
else:
|
|
1169
|
+
self.handle = _whatsapp.whatsapp_Avatar_CTor()
|
|
1170
|
+
_whatsapp.IncRef(self.handle)
|
|
1171
|
+
if 0 < len(args):
|
|
1172
|
+
self.ID = args[0]
|
|
1173
|
+
if "ID" in kwargs:
|
|
1174
|
+
self.ID = kwargs["ID"]
|
|
1175
|
+
if 1 < len(args):
|
|
1176
|
+
self.URL = args[1]
|
|
1177
|
+
if "URL" in kwargs:
|
|
1178
|
+
self.URL = kwargs["URL"]
|
|
1179
|
+
def __del__(self):
|
|
1180
|
+
_whatsapp.DecRef(self.handle)
|
|
1181
|
+
def __str__(self):
|
|
1182
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1183
|
+
sv = 'whatsapp.Avatar{'
|
|
1184
|
+
first = True
|
|
1185
|
+
for v in pr:
|
|
1186
|
+
if callable(v[1]):
|
|
1187
|
+
continue
|
|
1188
|
+
if first:
|
|
1189
|
+
first = False
|
|
1190
|
+
else:
|
|
1191
|
+
sv += ', '
|
|
1192
|
+
sv += v[0] + '=' + str(v[1])
|
|
1193
|
+
return sv + '}'
|
|
1194
|
+
def __repr__(self):
|
|
1195
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1196
|
+
sv = 'whatsapp.Avatar ( '
|
|
1197
|
+
for v in pr:
|
|
1198
|
+
if not callable(v[1]):
|
|
1199
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1200
|
+
return sv + ')'
|
|
1201
|
+
@property
|
|
1202
|
+
def ID(self):
|
|
1203
|
+
return _whatsapp.whatsapp_Avatar_ID_Get(self.handle)
|
|
1204
|
+
@ID.setter
|
|
1205
|
+
def ID(self, value):
|
|
1206
|
+
if isinstance(value, go.GoClass):
|
|
1207
|
+
_whatsapp.whatsapp_Avatar_ID_Set(self.handle, value.handle)
|
|
1208
|
+
else:
|
|
1209
|
+
_whatsapp.whatsapp_Avatar_ID_Set(self.handle, value)
|
|
1210
|
+
@property
|
|
1211
|
+
def URL(self):
|
|
1212
|
+
return _whatsapp.whatsapp_Avatar_URL_Get(self.handle)
|
|
1213
|
+
@URL.setter
|
|
1214
|
+
def URL(self, value):
|
|
1215
|
+
if isinstance(value, go.GoClass):
|
|
1216
|
+
_whatsapp.whatsapp_Avatar_URL_Set(self.handle, value.handle)
|
|
1217
|
+
else:
|
|
1218
|
+
_whatsapp.whatsapp_Avatar_URL_Set(self.handle, value)
|
|
1219
|
+
|
|
1220
|
+
# Python type for struct whatsapp.Contact
|
|
1221
|
+
class Contact(go.GoClass):
|
|
1222
|
+
"""A Contact represents any entity that be communicated with directly in WhatsApp. This typically\nrepresents people, but may represent a business or bot as well, but not a group-chat.\n"""
|
|
1223
|
+
def __init__(self, *args, **kwargs):
|
|
1224
|
+
"""
|
|
1225
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1226
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1227
|
+
in which case a new Go object is constructed first
|
|
1228
|
+
"""
|
|
1229
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1230
|
+
self.handle = kwargs['handle']
|
|
1231
|
+
_whatsapp.IncRef(self.handle)
|
|
1232
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1233
|
+
self.handle = args[0].handle
|
|
1234
|
+
_whatsapp.IncRef(self.handle)
|
|
1235
|
+
else:
|
|
1236
|
+
self.handle = _whatsapp.whatsapp_Contact_CTor()
|
|
1237
|
+
_whatsapp.IncRef(self.handle)
|
|
1238
|
+
if 0 < len(args):
|
|
1239
|
+
self.JID = args[0]
|
|
1240
|
+
if "JID" in kwargs:
|
|
1241
|
+
self.JID = kwargs["JID"]
|
|
1242
|
+
if 1 < len(args):
|
|
1243
|
+
self.Name = args[1]
|
|
1244
|
+
if "Name" in kwargs:
|
|
1245
|
+
self.Name = kwargs["Name"]
|
|
1246
|
+
def __del__(self):
|
|
1247
|
+
_whatsapp.DecRef(self.handle)
|
|
1248
|
+
def __str__(self):
|
|
1249
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1250
|
+
sv = 'whatsapp.Contact{'
|
|
1251
|
+
first = True
|
|
1252
|
+
for v in pr:
|
|
1253
|
+
if callable(v[1]):
|
|
1254
|
+
continue
|
|
1255
|
+
if first:
|
|
1256
|
+
first = False
|
|
1257
|
+
else:
|
|
1258
|
+
sv += ', '
|
|
1259
|
+
sv += v[0] + '=' + str(v[1])
|
|
1260
|
+
return sv + '}'
|
|
1261
|
+
def __repr__(self):
|
|
1262
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1263
|
+
sv = 'whatsapp.Contact ( '
|
|
1264
|
+
for v in pr:
|
|
1265
|
+
if not callable(v[1]):
|
|
1266
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1267
|
+
return sv + ')'
|
|
1268
|
+
@property
|
|
1269
|
+
def JID(self):
|
|
1270
|
+
return _whatsapp.whatsapp_Contact_JID_Get(self.handle)
|
|
1271
|
+
@JID.setter
|
|
1272
|
+
def JID(self, value):
|
|
1273
|
+
if isinstance(value, go.GoClass):
|
|
1274
|
+
_whatsapp.whatsapp_Contact_JID_Set(self.handle, value.handle)
|
|
1275
|
+
else:
|
|
1276
|
+
_whatsapp.whatsapp_Contact_JID_Set(self.handle, value)
|
|
1277
|
+
@property
|
|
1278
|
+
def Name(self):
|
|
1279
|
+
return _whatsapp.whatsapp_Contact_Name_Get(self.handle)
|
|
1280
|
+
@Name.setter
|
|
1281
|
+
def Name(self, value):
|
|
1282
|
+
if isinstance(value, go.GoClass):
|
|
1283
|
+
_whatsapp.whatsapp_Contact_Name_Set(self.handle, value.handle)
|
|
1284
|
+
else:
|
|
1285
|
+
_whatsapp.whatsapp_Contact_Name_Set(self.handle, value)
|
|
1286
|
+
|
|
1287
|
+
# Python type for struct whatsapp.Group
|
|
1288
|
+
class Group(go.GoClass):
|
|
1289
|
+
"""A Group represents a named, many-to-many chat space which may be joined or left at will. All\nfields apart from the group JID are considered to be optional, and may not be set in cases where\ngroup information is being updated against previous assumed state. Groups in WhatsApp are\ngenerally invited to out-of-band with respect to overarching adaptor; see the documentation for\n[Session.GetGroups] for more information.\n"""
|
|
1290
|
+
def __init__(self, *args, **kwargs):
|
|
1291
|
+
"""
|
|
1292
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1293
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1294
|
+
in which case a new Go object is constructed first
|
|
1295
|
+
"""
|
|
1296
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1297
|
+
self.handle = kwargs['handle']
|
|
1298
|
+
_whatsapp.IncRef(self.handle)
|
|
1299
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1300
|
+
self.handle = args[0].handle
|
|
1301
|
+
_whatsapp.IncRef(self.handle)
|
|
1302
|
+
else:
|
|
1303
|
+
self.handle = _whatsapp.whatsapp_Group_CTor()
|
|
1304
|
+
_whatsapp.IncRef(self.handle)
|
|
1305
|
+
if 0 < len(args):
|
|
1306
|
+
self.JID = args[0]
|
|
1307
|
+
if "JID" in kwargs:
|
|
1308
|
+
self.JID = kwargs["JID"]
|
|
1309
|
+
if 1 < len(args):
|
|
1310
|
+
self.Name = args[1]
|
|
1311
|
+
if "Name" in kwargs:
|
|
1312
|
+
self.Name = kwargs["Name"]
|
|
1313
|
+
if 2 < len(args):
|
|
1314
|
+
self.Subject = args[2]
|
|
1315
|
+
if "Subject" in kwargs:
|
|
1316
|
+
self.Subject = kwargs["Subject"]
|
|
1317
|
+
if 3 < len(args):
|
|
1318
|
+
self.Nickname = args[3]
|
|
1319
|
+
if "Nickname" in kwargs:
|
|
1320
|
+
self.Nickname = kwargs["Nickname"]
|
|
1321
|
+
if 4 < len(args):
|
|
1322
|
+
self.Participants = args[4]
|
|
1323
|
+
if "Participants" in kwargs:
|
|
1324
|
+
self.Participants = kwargs["Participants"]
|
|
1325
|
+
def __del__(self):
|
|
1326
|
+
_whatsapp.DecRef(self.handle)
|
|
1327
|
+
def __str__(self):
|
|
1328
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1329
|
+
sv = 'whatsapp.Group{'
|
|
1330
|
+
first = True
|
|
1331
|
+
for v in pr:
|
|
1332
|
+
if callable(v[1]):
|
|
1333
|
+
continue
|
|
1334
|
+
if first:
|
|
1335
|
+
first = False
|
|
1336
|
+
else:
|
|
1337
|
+
sv += ', '
|
|
1338
|
+
sv += v[0] + '=' + str(v[1])
|
|
1339
|
+
return sv + '}'
|
|
1340
|
+
def __repr__(self):
|
|
1341
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1342
|
+
sv = 'whatsapp.Group ( '
|
|
1343
|
+
for v in pr:
|
|
1344
|
+
if not callable(v[1]):
|
|
1345
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1346
|
+
return sv + ')'
|
|
1347
|
+
@property
|
|
1348
|
+
def JID(self):
|
|
1349
|
+
return _whatsapp.whatsapp_Group_JID_Get(self.handle)
|
|
1350
|
+
@JID.setter
|
|
1351
|
+
def JID(self, value):
|
|
1352
|
+
if isinstance(value, go.GoClass):
|
|
1353
|
+
_whatsapp.whatsapp_Group_JID_Set(self.handle, value.handle)
|
|
1354
|
+
else:
|
|
1355
|
+
_whatsapp.whatsapp_Group_JID_Set(self.handle, value)
|
|
1356
|
+
@property
|
|
1357
|
+
def Name(self):
|
|
1358
|
+
return _whatsapp.whatsapp_Group_Name_Get(self.handle)
|
|
1359
|
+
@Name.setter
|
|
1360
|
+
def Name(self, value):
|
|
1361
|
+
if isinstance(value, go.GoClass):
|
|
1362
|
+
_whatsapp.whatsapp_Group_Name_Set(self.handle, value.handle)
|
|
1363
|
+
else:
|
|
1364
|
+
_whatsapp.whatsapp_Group_Name_Set(self.handle, value)
|
|
1365
|
+
@property
|
|
1366
|
+
def Subject(self):
|
|
1367
|
+
return GroupSubject(handle=_whatsapp.whatsapp_Group_Subject_Get(self.handle))
|
|
1368
|
+
@Subject.setter
|
|
1369
|
+
def Subject(self, value):
|
|
1370
|
+
if isinstance(value, go.GoClass):
|
|
1371
|
+
_whatsapp.whatsapp_Group_Subject_Set(self.handle, value.handle)
|
|
1372
|
+
else:
|
|
1373
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
1374
|
+
@property
|
|
1375
|
+
def Nickname(self):
|
|
1376
|
+
return _whatsapp.whatsapp_Group_Nickname_Get(self.handle)
|
|
1377
|
+
@Nickname.setter
|
|
1378
|
+
def Nickname(self, value):
|
|
1379
|
+
if isinstance(value, go.GoClass):
|
|
1380
|
+
_whatsapp.whatsapp_Group_Nickname_Set(self.handle, value.handle)
|
|
1381
|
+
else:
|
|
1382
|
+
_whatsapp.whatsapp_Group_Nickname_Set(self.handle, value)
|
|
1383
|
+
@property
|
|
1384
|
+
def Participants(self):
|
|
1385
|
+
return Slice_whatsapp_GroupParticipant(handle=_whatsapp.whatsapp_Group_Participants_Get(self.handle))
|
|
1386
|
+
@Participants.setter
|
|
1387
|
+
def Participants(self, value):
|
|
1388
|
+
if isinstance(value, go.GoClass):
|
|
1389
|
+
_whatsapp.whatsapp_Group_Participants_Set(self.handle, value.handle)
|
|
1390
|
+
else:
|
|
1391
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
1392
|
+
|
|
1393
|
+
# Python type for struct whatsapp.GroupParticipant
|
|
1394
|
+
class GroupParticipant(go.GoClass):
|
|
1395
|
+
"""A GroupParticipant represents a contact who is currently joined in a given group. Participants in\nWhatsApp can always be derived back to their individual [Contact]; there are no anonymous groups\nin WhatsApp.\n"""
|
|
1396
|
+
def __init__(self, *args, **kwargs):
|
|
1397
|
+
"""
|
|
1398
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1399
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1400
|
+
in which case a new Go object is constructed first
|
|
1401
|
+
"""
|
|
1402
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1403
|
+
self.handle = kwargs['handle']
|
|
1404
|
+
_whatsapp.IncRef(self.handle)
|
|
1405
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1406
|
+
self.handle = args[0].handle
|
|
1407
|
+
_whatsapp.IncRef(self.handle)
|
|
1408
|
+
else:
|
|
1409
|
+
self.handle = _whatsapp.whatsapp_GroupParticipant_CTor()
|
|
1410
|
+
_whatsapp.IncRef(self.handle)
|
|
1411
|
+
if 0 < len(args):
|
|
1412
|
+
self.JID = args[0]
|
|
1413
|
+
if "JID" in kwargs:
|
|
1414
|
+
self.JID = kwargs["JID"]
|
|
1415
|
+
if 1 < len(args):
|
|
1416
|
+
self.Affiliation = args[1]
|
|
1417
|
+
if "Affiliation" in kwargs:
|
|
1418
|
+
self.Affiliation = kwargs["Affiliation"]
|
|
1419
|
+
if 2 < len(args):
|
|
1420
|
+
self.Action = args[2]
|
|
1421
|
+
if "Action" in kwargs:
|
|
1422
|
+
self.Action = kwargs["Action"]
|
|
1423
|
+
def __del__(self):
|
|
1424
|
+
_whatsapp.DecRef(self.handle)
|
|
1425
|
+
def __str__(self):
|
|
1426
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1427
|
+
sv = 'whatsapp.GroupParticipant{'
|
|
1428
|
+
first = True
|
|
1429
|
+
for v in pr:
|
|
1430
|
+
if callable(v[1]):
|
|
1431
|
+
continue
|
|
1432
|
+
if first:
|
|
1433
|
+
first = False
|
|
1434
|
+
else:
|
|
1435
|
+
sv += ', '
|
|
1436
|
+
sv += v[0] + '=' + str(v[1])
|
|
1437
|
+
return sv + '}'
|
|
1438
|
+
def __repr__(self):
|
|
1439
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1440
|
+
sv = 'whatsapp.GroupParticipant ( '
|
|
1441
|
+
for v in pr:
|
|
1442
|
+
if not callable(v[1]):
|
|
1443
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1444
|
+
return sv + ')'
|
|
1445
|
+
@property
|
|
1446
|
+
def JID(self):
|
|
1447
|
+
return _whatsapp.whatsapp_GroupParticipant_JID_Get(self.handle)
|
|
1448
|
+
@JID.setter
|
|
1449
|
+
def JID(self, value):
|
|
1450
|
+
if isinstance(value, go.GoClass):
|
|
1451
|
+
_whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value.handle)
|
|
1452
|
+
else:
|
|
1453
|
+
_whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value)
|
|
1454
|
+
@property
|
|
1455
|
+
def Affiliation(self):
|
|
1456
|
+
return _whatsapp.whatsapp_GroupParticipant_Affiliation_Get(self.handle)
|
|
1457
|
+
@Affiliation.setter
|
|
1458
|
+
def Affiliation(self, value):
|
|
1459
|
+
if isinstance(value, go.GoClass):
|
|
1460
|
+
_whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value.handle)
|
|
1461
|
+
else:
|
|
1462
|
+
_whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value)
|
|
1463
|
+
@property
|
|
1464
|
+
def Action(self):
|
|
1465
|
+
return _whatsapp.whatsapp_GroupParticipant_Action_Get(self.handle)
|
|
1466
|
+
@Action.setter
|
|
1467
|
+
def Action(self, value):
|
|
1468
|
+
if isinstance(value, go.GoClass):
|
|
1469
|
+
_whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value.handle)
|
|
1470
|
+
else:
|
|
1471
|
+
_whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value)
|
|
1472
|
+
|
|
1473
|
+
# Python type for struct whatsapp.Attachment
|
|
1474
|
+
class Attachment(go.GoClass):
|
|
1475
|
+
"""A Attachment represents additional binary data (e.g. images, videos, documents) provided alongside\na message, for display or storage on the recepient client.\n"""
|
|
1476
|
+
def __init__(self, *args, **kwargs):
|
|
1477
|
+
"""
|
|
1478
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1479
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1480
|
+
in which case a new Go object is constructed first
|
|
1481
|
+
"""
|
|
1482
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1483
|
+
self.handle = kwargs['handle']
|
|
1484
|
+
_whatsapp.IncRef(self.handle)
|
|
1485
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1486
|
+
self.handle = args[0].handle
|
|
1487
|
+
_whatsapp.IncRef(self.handle)
|
|
1488
|
+
else:
|
|
1489
|
+
self.handle = _whatsapp.whatsapp_Attachment_CTor()
|
|
1490
|
+
_whatsapp.IncRef(self.handle)
|
|
1491
|
+
if 0 < len(args):
|
|
1492
|
+
self.MIME = args[0]
|
|
1493
|
+
if "MIME" in kwargs:
|
|
1494
|
+
self.MIME = kwargs["MIME"]
|
|
1495
|
+
if 1 < len(args):
|
|
1496
|
+
self.Filename = args[1]
|
|
1497
|
+
if "Filename" in kwargs:
|
|
1498
|
+
self.Filename = kwargs["Filename"]
|
|
1499
|
+
if 2 < len(args):
|
|
1500
|
+
self.Caption = args[2]
|
|
1501
|
+
if "Caption" in kwargs:
|
|
1502
|
+
self.Caption = kwargs["Caption"]
|
|
1503
|
+
if 3 < len(args):
|
|
1504
|
+
self.Path = args[3]
|
|
1505
|
+
if "Path" in kwargs:
|
|
1506
|
+
self.Path = kwargs["Path"]
|
|
1507
|
+
def __del__(self):
|
|
1508
|
+
_whatsapp.DecRef(self.handle)
|
|
1509
|
+
def __str__(self):
|
|
1510
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1511
|
+
sv = 'whatsapp.Attachment{'
|
|
1512
|
+
first = True
|
|
1513
|
+
for v in pr:
|
|
1514
|
+
if callable(v[1]):
|
|
1515
|
+
continue
|
|
1516
|
+
if first:
|
|
1517
|
+
first = False
|
|
1518
|
+
else:
|
|
1519
|
+
sv += ', '
|
|
1520
|
+
sv += v[0] + '=' + str(v[1])
|
|
1521
|
+
return sv + '}'
|
|
1522
|
+
def __repr__(self):
|
|
1523
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1524
|
+
sv = 'whatsapp.Attachment ( '
|
|
1525
|
+
for v in pr:
|
|
1526
|
+
if not callable(v[1]):
|
|
1527
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1528
|
+
return sv + ')'
|
|
1529
|
+
@property
|
|
1530
|
+
def MIME(self):
|
|
1531
|
+
return _whatsapp.whatsapp_Attachment_MIME_Get(self.handle)
|
|
1532
|
+
@MIME.setter
|
|
1533
|
+
def MIME(self, value):
|
|
1534
|
+
if isinstance(value, go.GoClass):
|
|
1535
|
+
_whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value.handle)
|
|
1536
|
+
else:
|
|
1537
|
+
_whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value)
|
|
1538
|
+
@property
|
|
1539
|
+
def Filename(self):
|
|
1540
|
+
return _whatsapp.whatsapp_Attachment_Filename_Get(self.handle)
|
|
1541
|
+
@Filename.setter
|
|
1542
|
+
def Filename(self, value):
|
|
1543
|
+
if isinstance(value, go.GoClass):
|
|
1544
|
+
_whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value.handle)
|
|
1545
|
+
else:
|
|
1546
|
+
_whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value)
|
|
1547
|
+
@property
|
|
1548
|
+
def Caption(self):
|
|
1549
|
+
return _whatsapp.whatsapp_Attachment_Caption_Get(self.handle)
|
|
1550
|
+
@Caption.setter
|
|
1551
|
+
def Caption(self, value):
|
|
1552
|
+
if isinstance(value, go.GoClass):
|
|
1553
|
+
_whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value.handle)
|
|
1554
|
+
else:
|
|
1555
|
+
_whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value)
|
|
1556
|
+
@property
|
|
1557
|
+
def Path(self):
|
|
1558
|
+
return _whatsapp.whatsapp_Attachment_Path_Get(self.handle)
|
|
1559
|
+
@Path.setter
|
|
1560
|
+
def Path(self, value):
|
|
1561
|
+
if isinstance(value, go.GoClass):
|
|
1562
|
+
_whatsapp.whatsapp_Attachment_Path_Set(self.handle, value.handle)
|
|
1563
|
+
else:
|
|
1564
|
+
_whatsapp.whatsapp_Attachment_Path_Set(self.handle, value)
|
|
1565
|
+
|
|
1566
|
+
# Python type for struct whatsapp.LinkedDevice
|
|
1567
|
+
class LinkedDevice(go.GoClass):
|
|
1568
|
+
"""A LinkedDevice represents a unique pairing session between the gateway and WhatsApp. It is not\nunique to the underlying \"main\" device (or phone number), as multiple linked devices may be paired\nwith any main device.\n"""
|
|
1569
|
+
def __init__(self, *args, **kwargs):
|
|
1570
|
+
"""
|
|
1571
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1572
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1573
|
+
in which case a new Go object is constructed first
|
|
1574
|
+
"""
|
|
1575
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1576
|
+
self.handle = kwargs['handle']
|
|
1577
|
+
_whatsapp.IncRef(self.handle)
|
|
1578
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1579
|
+
self.handle = args[0].handle
|
|
1580
|
+
_whatsapp.IncRef(self.handle)
|
|
1581
|
+
else:
|
|
1582
|
+
self.handle = _whatsapp.whatsapp_LinkedDevice_CTor()
|
|
1583
|
+
_whatsapp.IncRef(self.handle)
|
|
1584
|
+
if 0 < len(args):
|
|
1585
|
+
self.ID = args[0]
|
|
1586
|
+
if "ID" in kwargs:
|
|
1587
|
+
self.ID = kwargs["ID"]
|
|
1588
|
+
def __del__(self):
|
|
1589
|
+
_whatsapp.DecRef(self.handle)
|
|
1590
|
+
def __str__(self):
|
|
1591
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1592
|
+
sv = 'whatsapp.LinkedDevice{'
|
|
1593
|
+
first = True
|
|
1594
|
+
for v in pr:
|
|
1595
|
+
if callable(v[1]):
|
|
1596
|
+
continue
|
|
1597
|
+
if first:
|
|
1598
|
+
first = False
|
|
1599
|
+
else:
|
|
1600
|
+
sv += ', '
|
|
1601
|
+
sv += v[0] + '=' + str(v[1])
|
|
1602
|
+
return sv + '}'
|
|
1603
|
+
def __repr__(self):
|
|
1604
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1605
|
+
sv = 'whatsapp.LinkedDevice ( '
|
|
1606
|
+
for v in pr:
|
|
1607
|
+
if not callable(v[1]):
|
|
1608
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1609
|
+
return sv + ')'
|
|
1610
|
+
@property
|
|
1611
|
+
def ID(self):
|
|
1612
|
+
"""ID is an opaque string identifying this LinkedDevice to the Session. Noted that this string
|
|
1613
|
+
is currently equivalent to a password, and needs to be protected accordingly.
|
|
1614
|
+
"""
|
|
1615
|
+
return _whatsapp.whatsapp_LinkedDevice_ID_Get(self.handle)
|
|
1616
|
+
@ID.setter
|
|
1617
|
+
def ID(self, value):
|
|
1618
|
+
if isinstance(value, go.GoClass):
|
|
1619
|
+
_whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value.handle)
|
|
1620
|
+
else:
|
|
1621
|
+
_whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value)
|
|
1622
|
+
def JID(self):
|
|
1623
|
+
"""JID() object
|
|
1624
|
+
|
|
1625
|
+
JID returns the WhatsApp JID corresponding to the LinkedDevice ID. Empty or invalid device IDs
|
|
1626
|
+
may return invalid JIDs, and this function does not handle errors.
|
|
1627
|
+
"""
|
|
1628
|
+
return go.types_JID(handle=_whatsapp.whatsapp_LinkedDevice_JID(self.handle))
|
|
1629
|
+
|
|
1630
|
+
# Python type for struct whatsapp.Message
|
|
1631
|
+
class Message(go.GoClass):
|
|
1632
|
+
"""A Message represents one of many kinds of bidirectional communication payloads, for example, a\ntext message, a file (image, video) attachment, an emoji reaction, etc. Messages of different\nkinds are denoted as such, and re-use fields where the semantics overlap.\n"""
|
|
1633
|
+
def __init__(self, *args, **kwargs):
|
|
1634
|
+
"""
|
|
1635
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1636
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1637
|
+
in which case a new Go object is constructed first
|
|
1638
|
+
"""
|
|
1639
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1640
|
+
self.handle = kwargs['handle']
|
|
1641
|
+
_whatsapp.IncRef(self.handle)
|
|
1642
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1643
|
+
self.handle = args[0].handle
|
|
1644
|
+
_whatsapp.IncRef(self.handle)
|
|
1645
|
+
else:
|
|
1646
|
+
self.handle = _whatsapp.whatsapp_Message_CTor()
|
|
1647
|
+
_whatsapp.IncRef(self.handle)
|
|
1648
|
+
if 0 < len(args):
|
|
1649
|
+
self.Kind = args[0]
|
|
1650
|
+
if "Kind" in kwargs:
|
|
1651
|
+
self.Kind = kwargs["Kind"]
|
|
1652
|
+
if 1 < len(args):
|
|
1653
|
+
self.ID = args[1]
|
|
1654
|
+
if "ID" in kwargs:
|
|
1655
|
+
self.ID = kwargs["ID"]
|
|
1656
|
+
if 2 < len(args):
|
|
1657
|
+
self.JID = args[2]
|
|
1658
|
+
if "JID" in kwargs:
|
|
1659
|
+
self.JID = kwargs["JID"]
|
|
1660
|
+
if 3 < len(args):
|
|
1661
|
+
self.GroupJID = args[3]
|
|
1662
|
+
if "GroupJID" in kwargs:
|
|
1663
|
+
self.GroupJID = kwargs["GroupJID"]
|
|
1664
|
+
if 4 < len(args):
|
|
1665
|
+
self.OriginJID = args[4]
|
|
1666
|
+
if "OriginJID" in kwargs:
|
|
1667
|
+
self.OriginJID = kwargs["OriginJID"]
|
|
1668
|
+
if 5 < len(args):
|
|
1669
|
+
self.Body = args[5]
|
|
1670
|
+
if "Body" in kwargs:
|
|
1671
|
+
self.Body = kwargs["Body"]
|
|
1672
|
+
if 6 < len(args):
|
|
1673
|
+
self.Timestamp = args[6]
|
|
1674
|
+
if "Timestamp" in kwargs:
|
|
1675
|
+
self.Timestamp = kwargs["Timestamp"]
|
|
1676
|
+
if 7 < len(args):
|
|
1677
|
+
self.IsCarbon = args[7]
|
|
1678
|
+
if "IsCarbon" in kwargs:
|
|
1679
|
+
self.IsCarbon = kwargs["IsCarbon"]
|
|
1680
|
+
if 8 < len(args):
|
|
1681
|
+
self.ReplyID = args[8]
|
|
1682
|
+
if "ReplyID" in kwargs:
|
|
1683
|
+
self.ReplyID = kwargs["ReplyID"]
|
|
1684
|
+
if 9 < len(args):
|
|
1685
|
+
self.ReplyBody = args[9]
|
|
1686
|
+
if "ReplyBody" in kwargs:
|
|
1687
|
+
self.ReplyBody = kwargs["ReplyBody"]
|
|
1688
|
+
if 10 < len(args):
|
|
1689
|
+
self.Attachments = args[10]
|
|
1690
|
+
if "Attachments" in kwargs:
|
|
1691
|
+
self.Attachments = kwargs["Attachments"]
|
|
1692
|
+
if 11 < len(args):
|
|
1693
|
+
self.Preview = args[11]
|
|
1694
|
+
if "Preview" in kwargs:
|
|
1695
|
+
self.Preview = kwargs["Preview"]
|
|
1696
|
+
if 12 < len(args):
|
|
1697
|
+
self.MentionJIDs = args[12]
|
|
1698
|
+
if "MentionJIDs" in kwargs:
|
|
1699
|
+
self.MentionJIDs = kwargs["MentionJIDs"]
|
|
1700
|
+
if 13 < len(args):
|
|
1701
|
+
self.Receipts = args[13]
|
|
1702
|
+
if "Receipts" in kwargs:
|
|
1703
|
+
self.Receipts = kwargs["Receipts"]
|
|
1704
|
+
if 14 < len(args):
|
|
1705
|
+
self.Reactions = args[14]
|
|
1706
|
+
if "Reactions" in kwargs:
|
|
1707
|
+
self.Reactions = kwargs["Reactions"]
|
|
1708
|
+
def __del__(self):
|
|
1709
|
+
_whatsapp.DecRef(self.handle)
|
|
1710
|
+
def __str__(self):
|
|
1711
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1712
|
+
sv = 'whatsapp.Message{'
|
|
1713
|
+
first = True
|
|
1714
|
+
for v in pr:
|
|
1715
|
+
if callable(v[1]):
|
|
1716
|
+
continue
|
|
1717
|
+
if first:
|
|
1718
|
+
first = False
|
|
1719
|
+
else:
|
|
1720
|
+
sv += ', '
|
|
1721
|
+
sv += v[0] + '=' + str(v[1])
|
|
1722
|
+
return sv + '}'
|
|
1723
|
+
def __repr__(self):
|
|
1724
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1725
|
+
sv = 'whatsapp.Message ( '
|
|
1726
|
+
for v in pr:
|
|
1727
|
+
if not callable(v[1]):
|
|
1728
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1729
|
+
return sv + ')'
|
|
1730
|
+
@property
|
|
1731
|
+
def Kind(self):
|
|
1732
|
+
return _whatsapp.whatsapp_Message_Kind_Get(self.handle)
|
|
1733
|
+
@Kind.setter
|
|
1734
|
+
def Kind(self, value):
|
|
1735
|
+
if isinstance(value, go.GoClass):
|
|
1736
|
+
_whatsapp.whatsapp_Message_Kind_Set(self.handle, value.handle)
|
|
1737
|
+
else:
|
|
1738
|
+
_whatsapp.whatsapp_Message_Kind_Set(self.handle, value)
|
|
1739
|
+
@property
|
|
1740
|
+
def ID(self):
|
|
1741
|
+
return _whatsapp.whatsapp_Message_ID_Get(self.handle)
|
|
1742
|
+
@ID.setter
|
|
1743
|
+
def ID(self, value):
|
|
1744
|
+
if isinstance(value, go.GoClass):
|
|
1745
|
+
_whatsapp.whatsapp_Message_ID_Set(self.handle, value.handle)
|
|
1746
|
+
else:
|
|
1747
|
+
_whatsapp.whatsapp_Message_ID_Set(self.handle, value)
|
|
1748
|
+
@property
|
|
1749
|
+
def JID(self):
|
|
1750
|
+
return _whatsapp.whatsapp_Message_JID_Get(self.handle)
|
|
1751
|
+
@JID.setter
|
|
1752
|
+
def JID(self, value):
|
|
1753
|
+
if isinstance(value, go.GoClass):
|
|
1754
|
+
_whatsapp.whatsapp_Message_JID_Set(self.handle, value.handle)
|
|
1755
|
+
else:
|
|
1756
|
+
_whatsapp.whatsapp_Message_JID_Set(self.handle, value)
|
|
1757
|
+
@property
|
|
1758
|
+
def GroupJID(self):
|
|
1759
|
+
return _whatsapp.whatsapp_Message_GroupJID_Get(self.handle)
|
|
1760
|
+
@GroupJID.setter
|
|
1761
|
+
def GroupJID(self, value):
|
|
1762
|
+
if isinstance(value, go.GoClass):
|
|
1763
|
+
_whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value.handle)
|
|
1764
|
+
else:
|
|
1765
|
+
_whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value)
|
|
1766
|
+
@property
|
|
1767
|
+
def OriginJID(self):
|
|
1768
|
+
return _whatsapp.whatsapp_Message_OriginJID_Get(self.handle)
|
|
1769
|
+
@OriginJID.setter
|
|
1770
|
+
def OriginJID(self, value):
|
|
1771
|
+
if isinstance(value, go.GoClass):
|
|
1772
|
+
_whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value.handle)
|
|
1773
|
+
else:
|
|
1774
|
+
_whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value)
|
|
1775
|
+
@property
|
|
1776
|
+
def Body(self):
|
|
1777
|
+
return _whatsapp.whatsapp_Message_Body_Get(self.handle)
|
|
1778
|
+
@Body.setter
|
|
1779
|
+
def Body(self, value):
|
|
1780
|
+
if isinstance(value, go.GoClass):
|
|
1781
|
+
_whatsapp.whatsapp_Message_Body_Set(self.handle, value.handle)
|
|
1782
|
+
else:
|
|
1783
|
+
_whatsapp.whatsapp_Message_Body_Set(self.handle, value)
|
|
1784
|
+
@property
|
|
1785
|
+
def Timestamp(self):
|
|
1786
|
+
return _whatsapp.whatsapp_Message_Timestamp_Get(self.handle)
|
|
1787
|
+
@Timestamp.setter
|
|
1788
|
+
def Timestamp(self, value):
|
|
1789
|
+
if isinstance(value, go.GoClass):
|
|
1790
|
+
_whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value.handle)
|
|
1791
|
+
else:
|
|
1792
|
+
_whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value)
|
|
1793
|
+
@property
|
|
1794
|
+
def IsCarbon(self):
|
|
1795
|
+
return _whatsapp.whatsapp_Message_IsCarbon_Get(self.handle)
|
|
1796
|
+
@IsCarbon.setter
|
|
1797
|
+
def IsCarbon(self, value):
|
|
1798
|
+
if isinstance(value, go.GoClass):
|
|
1799
|
+
_whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value.handle)
|
|
1800
|
+
else:
|
|
1801
|
+
_whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value)
|
|
1802
|
+
@property
|
|
1803
|
+
def ReplyID(self):
|
|
1804
|
+
return _whatsapp.whatsapp_Message_ReplyID_Get(self.handle)
|
|
1805
|
+
@ReplyID.setter
|
|
1806
|
+
def ReplyID(self, value):
|
|
1807
|
+
if isinstance(value, go.GoClass):
|
|
1808
|
+
_whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value.handle)
|
|
1809
|
+
else:
|
|
1810
|
+
_whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value)
|
|
1811
|
+
@property
|
|
1812
|
+
def ReplyBody(self):
|
|
1813
|
+
return _whatsapp.whatsapp_Message_ReplyBody_Get(self.handle)
|
|
1814
|
+
@ReplyBody.setter
|
|
1815
|
+
def ReplyBody(self, value):
|
|
1816
|
+
if isinstance(value, go.GoClass):
|
|
1817
|
+
_whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value.handle)
|
|
1818
|
+
else:
|
|
1819
|
+
_whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value)
|
|
1820
|
+
@property
|
|
1821
|
+
def Attachments(self):
|
|
1822
|
+
return Slice_whatsapp_Attachment(handle=_whatsapp.whatsapp_Message_Attachments_Get(self.handle))
|
|
1823
|
+
@Attachments.setter
|
|
1824
|
+
def Attachments(self, value):
|
|
1825
|
+
if isinstance(value, go.GoClass):
|
|
1826
|
+
_whatsapp.whatsapp_Message_Attachments_Set(self.handle, value.handle)
|
|
1827
|
+
else:
|
|
1828
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
1829
|
+
@property
|
|
1830
|
+
def Preview(self):
|
|
1831
|
+
return Preview(handle=_whatsapp.whatsapp_Message_Preview_Get(self.handle))
|
|
1832
|
+
@Preview.setter
|
|
1833
|
+
def Preview(self, value):
|
|
1834
|
+
if isinstance(value, go.GoClass):
|
|
1835
|
+
_whatsapp.whatsapp_Message_Preview_Set(self.handle, value.handle)
|
|
1836
|
+
else:
|
|
1837
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
1838
|
+
@property
|
|
1839
|
+
def MentionJIDs(self):
|
|
1840
|
+
return go.Slice_string(handle=_whatsapp.whatsapp_Message_MentionJIDs_Get(self.handle))
|
|
1841
|
+
@MentionJIDs.setter
|
|
1842
|
+
def MentionJIDs(self, value):
|
|
1843
|
+
if isinstance(value, go.GoClass):
|
|
1844
|
+
_whatsapp.whatsapp_Message_MentionJIDs_Set(self.handle, value.handle)
|
|
1845
|
+
else:
|
|
1846
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
1847
|
+
@property
|
|
1848
|
+
def Receipts(self):
|
|
1849
|
+
return Slice_whatsapp_Receipt(handle=_whatsapp.whatsapp_Message_Receipts_Get(self.handle))
|
|
1850
|
+
@Receipts.setter
|
|
1851
|
+
def Receipts(self, value):
|
|
1852
|
+
if isinstance(value, go.GoClass):
|
|
1853
|
+
_whatsapp.whatsapp_Message_Receipts_Set(self.handle, value.handle)
|
|
1854
|
+
else:
|
|
1855
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
1856
|
+
@property
|
|
1857
|
+
def Reactions(self):
|
|
1858
|
+
return Slice_whatsapp_Message(handle=_whatsapp.whatsapp_Message_Reactions_Get(self.handle))
|
|
1859
|
+
@Reactions.setter
|
|
1860
|
+
def Reactions(self, value):
|
|
1861
|
+
if isinstance(value, go.GoClass):
|
|
1862
|
+
_whatsapp.whatsapp_Message_Reactions_Set(self.handle, value.handle)
|
|
1863
|
+
else:
|
|
1864
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
1865
|
+
|
|
1866
|
+
# Python type for struct whatsapp.Preview
|
|
1867
|
+
class Preview(go.GoClass):
|
|
1868
|
+
"""A Preview represents a short description for a URL provided in a message body, as usually derived\nfrom the content of the page pointed at.\n"""
|
|
1869
|
+
def __init__(self, *args, **kwargs):
|
|
1870
|
+
"""
|
|
1871
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1872
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1873
|
+
in which case a new Go object is constructed first
|
|
1874
|
+
"""
|
|
1875
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1876
|
+
self.handle = kwargs['handle']
|
|
1877
|
+
_whatsapp.IncRef(self.handle)
|
|
1878
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1879
|
+
self.handle = args[0].handle
|
|
1880
|
+
_whatsapp.IncRef(self.handle)
|
|
1881
|
+
else:
|
|
1882
|
+
self.handle = _whatsapp.whatsapp_Preview_CTor()
|
|
1883
|
+
_whatsapp.IncRef(self.handle)
|
|
1884
|
+
if 0 < len(args):
|
|
1885
|
+
self.URL = args[0]
|
|
1886
|
+
if "URL" in kwargs:
|
|
1887
|
+
self.URL = kwargs["URL"]
|
|
1888
|
+
if 1 < len(args):
|
|
1889
|
+
self.Title = args[1]
|
|
1890
|
+
if "Title" in kwargs:
|
|
1891
|
+
self.Title = kwargs["Title"]
|
|
1892
|
+
if 2 < len(args):
|
|
1893
|
+
self.Description = args[2]
|
|
1894
|
+
if "Description" in kwargs:
|
|
1895
|
+
self.Description = kwargs["Description"]
|
|
1896
|
+
if 3 < len(args):
|
|
1897
|
+
self.ImagePath = args[3]
|
|
1898
|
+
if "ImagePath" in kwargs:
|
|
1899
|
+
self.ImagePath = kwargs["ImagePath"]
|
|
1900
|
+
def __del__(self):
|
|
1901
|
+
_whatsapp.DecRef(self.handle)
|
|
1902
|
+
def __str__(self):
|
|
1903
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1904
|
+
sv = 'whatsapp.Preview{'
|
|
1905
|
+
first = True
|
|
1906
|
+
for v in pr:
|
|
1907
|
+
if callable(v[1]):
|
|
1908
|
+
continue
|
|
1909
|
+
if first:
|
|
1910
|
+
first = False
|
|
1911
|
+
else:
|
|
1912
|
+
sv += ', '
|
|
1913
|
+
sv += v[0] + '=' + str(v[1])
|
|
1914
|
+
return sv + '}'
|
|
1915
|
+
def __repr__(self):
|
|
1916
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
1917
|
+
sv = 'whatsapp.Preview ( '
|
|
1918
|
+
for v in pr:
|
|
1919
|
+
if not callable(v[1]):
|
|
1920
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
1921
|
+
return sv + ')'
|
|
1922
|
+
@property
|
|
1923
|
+
def URL(self):
|
|
1924
|
+
return _whatsapp.whatsapp_Preview_URL_Get(self.handle)
|
|
1925
|
+
@URL.setter
|
|
1926
|
+
def URL(self, value):
|
|
1927
|
+
if isinstance(value, go.GoClass):
|
|
1928
|
+
_whatsapp.whatsapp_Preview_URL_Set(self.handle, value.handle)
|
|
1929
|
+
else:
|
|
1930
|
+
_whatsapp.whatsapp_Preview_URL_Set(self.handle, value)
|
|
1931
|
+
@property
|
|
1932
|
+
def Title(self):
|
|
1933
|
+
return _whatsapp.whatsapp_Preview_Title_Get(self.handle)
|
|
1934
|
+
@Title.setter
|
|
1935
|
+
def Title(self, value):
|
|
1936
|
+
if isinstance(value, go.GoClass):
|
|
1937
|
+
_whatsapp.whatsapp_Preview_Title_Set(self.handle, value.handle)
|
|
1938
|
+
else:
|
|
1939
|
+
_whatsapp.whatsapp_Preview_Title_Set(self.handle, value)
|
|
1940
|
+
@property
|
|
1941
|
+
def Description(self):
|
|
1942
|
+
return _whatsapp.whatsapp_Preview_Description_Get(self.handle)
|
|
1943
|
+
@Description.setter
|
|
1944
|
+
def Description(self, value):
|
|
1945
|
+
if isinstance(value, go.GoClass):
|
|
1946
|
+
_whatsapp.whatsapp_Preview_Description_Set(self.handle, value.handle)
|
|
1947
|
+
else:
|
|
1948
|
+
_whatsapp.whatsapp_Preview_Description_Set(self.handle, value)
|
|
1949
|
+
@property
|
|
1950
|
+
def ImagePath(self):
|
|
1951
|
+
return _whatsapp.whatsapp_Preview_ImagePath_Get(self.handle)
|
|
1952
|
+
@ImagePath.setter
|
|
1953
|
+
def ImagePath(self, value):
|
|
1954
|
+
if isinstance(value, go.GoClass):
|
|
1955
|
+
_whatsapp.whatsapp_Preview_ImagePath_Set(self.handle, value.handle)
|
|
1956
|
+
else:
|
|
1957
|
+
_whatsapp.whatsapp_Preview_ImagePath_Set(self.handle, value)
|
|
1958
|
+
|
|
1959
|
+
# Python type for struct whatsapp.Receipt
|
|
1960
|
+
class Receipt(go.GoClass):
|
|
1961
|
+
"""A Receipt represents a notice of delivery or presentation for [Message] instances sent or\nreceived. Receipts can be delivered for many messages at once, but are generally all delivered\nunder one specific state at a time.\n"""
|
|
1962
|
+
def __init__(self, *args, **kwargs):
|
|
1963
|
+
"""
|
|
1964
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
1965
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
1966
|
+
in which case a new Go object is constructed first
|
|
1967
|
+
"""
|
|
1968
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
1969
|
+
self.handle = kwargs['handle']
|
|
1970
|
+
_whatsapp.IncRef(self.handle)
|
|
1971
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
1972
|
+
self.handle = args[0].handle
|
|
1973
|
+
_whatsapp.IncRef(self.handle)
|
|
1974
|
+
else:
|
|
1975
|
+
self.handle = _whatsapp.whatsapp_Receipt_CTor()
|
|
1976
|
+
_whatsapp.IncRef(self.handle)
|
|
1977
|
+
if 0 < len(args):
|
|
1978
|
+
self.Kind = args[0]
|
|
1979
|
+
if "Kind" in kwargs:
|
|
1980
|
+
self.Kind = kwargs["Kind"]
|
|
1981
|
+
if 1 < len(args):
|
|
1982
|
+
self.MessageIDs = args[1]
|
|
1983
|
+
if "MessageIDs" in kwargs:
|
|
1984
|
+
self.MessageIDs = kwargs["MessageIDs"]
|
|
1985
|
+
if 2 < len(args):
|
|
1986
|
+
self.JID = args[2]
|
|
1987
|
+
if "JID" in kwargs:
|
|
1988
|
+
self.JID = kwargs["JID"]
|
|
1989
|
+
if 3 < len(args):
|
|
1990
|
+
self.GroupJID = args[3]
|
|
1991
|
+
if "GroupJID" in kwargs:
|
|
1992
|
+
self.GroupJID = kwargs["GroupJID"]
|
|
1993
|
+
if 4 < len(args):
|
|
1994
|
+
self.Timestamp = args[4]
|
|
1995
|
+
if "Timestamp" in kwargs:
|
|
1996
|
+
self.Timestamp = kwargs["Timestamp"]
|
|
1997
|
+
if 5 < len(args):
|
|
1998
|
+
self.IsCarbon = args[5]
|
|
1999
|
+
if "IsCarbon" in kwargs:
|
|
2000
|
+
self.IsCarbon = kwargs["IsCarbon"]
|
|
2001
|
+
def __del__(self):
|
|
2002
|
+
_whatsapp.DecRef(self.handle)
|
|
2003
|
+
def __str__(self):
|
|
2004
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2005
|
+
sv = 'whatsapp.Receipt{'
|
|
2006
|
+
first = True
|
|
2007
|
+
for v in pr:
|
|
2008
|
+
if callable(v[1]):
|
|
2009
|
+
continue
|
|
2010
|
+
if first:
|
|
2011
|
+
first = False
|
|
2012
|
+
else:
|
|
2013
|
+
sv += ', '
|
|
2014
|
+
sv += v[0] + '=' + str(v[1])
|
|
2015
|
+
return sv + '}'
|
|
2016
|
+
def __repr__(self):
|
|
2017
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2018
|
+
sv = 'whatsapp.Receipt ( '
|
|
2019
|
+
for v in pr:
|
|
2020
|
+
if not callable(v[1]):
|
|
2021
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2022
|
+
return sv + ')'
|
|
2023
|
+
@property
|
|
2024
|
+
def Kind(self):
|
|
2025
|
+
return _whatsapp.whatsapp_Receipt_Kind_Get(self.handle)
|
|
2026
|
+
@Kind.setter
|
|
2027
|
+
def Kind(self, value):
|
|
2028
|
+
if isinstance(value, go.GoClass):
|
|
2029
|
+
_whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value.handle)
|
|
2030
|
+
else:
|
|
2031
|
+
_whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value)
|
|
2032
|
+
@property
|
|
2033
|
+
def MessageIDs(self):
|
|
2034
|
+
return go.Slice_string(handle=_whatsapp.whatsapp_Receipt_MessageIDs_Get(self.handle))
|
|
2035
|
+
@MessageIDs.setter
|
|
2036
|
+
def MessageIDs(self, value):
|
|
2037
|
+
if isinstance(value, go.GoClass):
|
|
2038
|
+
_whatsapp.whatsapp_Receipt_MessageIDs_Set(self.handle, value.handle)
|
|
2039
|
+
else:
|
|
2040
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2041
|
+
@property
|
|
2042
|
+
def JID(self):
|
|
2043
|
+
return _whatsapp.whatsapp_Receipt_JID_Get(self.handle)
|
|
2044
|
+
@JID.setter
|
|
2045
|
+
def JID(self, value):
|
|
2046
|
+
if isinstance(value, go.GoClass):
|
|
2047
|
+
_whatsapp.whatsapp_Receipt_JID_Set(self.handle, value.handle)
|
|
2048
|
+
else:
|
|
2049
|
+
_whatsapp.whatsapp_Receipt_JID_Set(self.handle, value)
|
|
2050
|
+
@property
|
|
2051
|
+
def GroupJID(self):
|
|
2052
|
+
return _whatsapp.whatsapp_Receipt_GroupJID_Get(self.handle)
|
|
2053
|
+
@GroupJID.setter
|
|
2054
|
+
def GroupJID(self, value):
|
|
2055
|
+
if isinstance(value, go.GoClass):
|
|
2056
|
+
_whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value.handle)
|
|
2057
|
+
else:
|
|
2058
|
+
_whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value)
|
|
2059
|
+
@property
|
|
2060
|
+
def Timestamp(self):
|
|
2061
|
+
return _whatsapp.whatsapp_Receipt_Timestamp_Get(self.handle)
|
|
2062
|
+
@Timestamp.setter
|
|
2063
|
+
def Timestamp(self, value):
|
|
2064
|
+
if isinstance(value, go.GoClass):
|
|
2065
|
+
_whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value.handle)
|
|
2066
|
+
else:
|
|
2067
|
+
_whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value)
|
|
2068
|
+
@property
|
|
2069
|
+
def IsCarbon(self):
|
|
2070
|
+
return _whatsapp.whatsapp_Receipt_IsCarbon_Get(self.handle)
|
|
2071
|
+
@IsCarbon.setter
|
|
2072
|
+
def IsCarbon(self, value):
|
|
2073
|
+
if isinstance(value, go.GoClass):
|
|
2074
|
+
_whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value.handle)
|
|
2075
|
+
else:
|
|
2076
|
+
_whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value)
|
|
2077
|
+
|
|
2078
|
+
# Python type for struct whatsapp.Session
|
|
2079
|
+
class Session(go.GoClass):
|
|
2080
|
+
"""A Session represents a connection (active or not) between a linked device and WhatsApp. Active\nsessions need to be established by logging in, after which incoming events will be forwarded to\nthe adapter event handler, and outgoing events will be forwarded to WhatsApp.\n"""
|
|
2081
|
+
def __init__(self, *args, **kwargs):
|
|
2082
|
+
"""
|
|
2083
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
2084
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
2085
|
+
in which case a new Go object is constructed first
|
|
2086
|
+
"""
|
|
2087
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
2088
|
+
self.handle = kwargs['handle']
|
|
2089
|
+
_whatsapp.IncRef(self.handle)
|
|
2090
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
2091
|
+
self.handle = args[0].handle
|
|
2092
|
+
_whatsapp.IncRef(self.handle)
|
|
2093
|
+
else:
|
|
2094
|
+
self.handle = _whatsapp.whatsapp_Session_CTor()
|
|
2095
|
+
_whatsapp.IncRef(self.handle)
|
|
2096
|
+
def __del__(self):
|
|
2097
|
+
_whatsapp.DecRef(self.handle)
|
|
2098
|
+
def __str__(self):
|
|
2099
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2100
|
+
sv = 'whatsapp.Session{'
|
|
2101
|
+
first = True
|
|
2102
|
+
for v in pr:
|
|
2103
|
+
if callable(v[1]):
|
|
2104
|
+
continue
|
|
2105
|
+
if first:
|
|
2106
|
+
first = False
|
|
2107
|
+
else:
|
|
2108
|
+
sv += ', '
|
|
2109
|
+
sv += v[0] + '=' + str(v[1])
|
|
2110
|
+
return sv + '}'
|
|
2111
|
+
def __repr__(self):
|
|
2112
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2113
|
+
sv = 'whatsapp.Session ( '
|
|
2114
|
+
for v in pr:
|
|
2115
|
+
if not callable(v[1]):
|
|
2116
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2117
|
+
return sv + ')'
|
|
2118
|
+
def Login(self):
|
|
2119
|
+
"""Login() str
|
|
2120
|
+
|
|
2121
|
+
Login attempts to authenticate the given [Session], either by re-using the [LinkedDevice] attached
|
|
2122
|
+
or by initiating a pairing session for a new linked device. Callers are expected to have set an
|
|
2123
|
+
event handler in order to receive any incoming events from the underlying WhatsApp session.
|
|
2124
|
+
"""
|
|
2125
|
+
return _whatsapp.whatsapp_Session_Login(self.handle)
|
|
2126
|
+
def Logout(self):
|
|
2127
|
+
"""Logout() str
|
|
2128
|
+
|
|
2129
|
+
Logout disconnects and removes the current linked device locally and initiates a logout remotely.
|
|
2130
|
+
"""
|
|
2131
|
+
return _whatsapp.whatsapp_Session_Logout(self.handle)
|
|
2132
|
+
def Disconnect(self):
|
|
2133
|
+
"""Disconnect() str
|
|
2134
|
+
|
|
2135
|
+
Disconnects detaches the current connection to WhatsApp without removing any linked device state.
|
|
2136
|
+
"""
|
|
2137
|
+
return _whatsapp.whatsapp_Session_Disconnect(self.handle)
|
|
2138
|
+
def PairPhone(self, phone):
|
|
2139
|
+
"""PairPhone(str phone) str, str
|
|
2140
|
+
|
|
2141
|
+
PairPhone returns a one-time code from WhatsApp, used for pairing this [Session] against the
|
|
2142
|
+
user's primary device, as identified by the given phone number. This will return an error if the
|
|
2143
|
+
[Session] is already paired, or if the phone number given is empty or invalid.
|
|
2144
|
+
"""
|
|
2145
|
+
return _whatsapp.whatsapp_Session_PairPhone(self.handle, phone)
|
|
2146
|
+
def SendMessage(self, message):
|
|
2147
|
+
"""SendMessage(object message) str
|
|
2148
|
+
|
|
2149
|
+
SendMessage processes the given Message and sends a WhatsApp message for the kind and contact JID
|
|
2150
|
+
specified within. In general, different message kinds require different fields to be set; see the
|
|
2151
|
+
documentation for the [Message] type for more information.
|
|
2152
|
+
"""
|
|
2153
|
+
return _whatsapp.whatsapp_Session_SendMessage(self.handle, message.handle)
|
|
2154
|
+
def GenerateMessageID(self):
|
|
2155
|
+
"""GenerateMessageID() str
|
|
2156
|
+
|
|
2157
|
+
GenerateMessageID returns a valid, pseudo-random message ID for use in outgoing messages.
|
|
2158
|
+
"""
|
|
2159
|
+
return _whatsapp.whatsapp_Session_GenerateMessageID(self.handle)
|
|
2160
|
+
def SendChatState(self, state):
|
|
2161
|
+
"""SendChatState(object state) str
|
|
2162
|
+
|
|
2163
|
+
SendChatState sends the given chat state notification (e.g. composing message) to WhatsApp for the
|
|
2164
|
+
contact specified within.
|
|
2165
|
+
"""
|
|
2166
|
+
return _whatsapp.whatsapp_Session_SendChatState(self.handle, state.handle)
|
|
2167
|
+
def SendReceipt(self, receipt):
|
|
2168
|
+
"""SendReceipt(object receipt) str
|
|
2169
|
+
|
|
2170
|
+
SendReceipt sends a read receipt to WhatsApp for the message IDs specified within.
|
|
2171
|
+
"""
|
|
2172
|
+
return _whatsapp.whatsapp_Session_SendReceipt(self.handle, receipt.handle)
|
|
2173
|
+
def SendPresence(self, presence, statusMessage):
|
|
2174
|
+
"""SendPresence(int presence, str statusMessage) str
|
|
2175
|
+
|
|
2176
|
+
SendPresence sets the activity state and (optional) status message for the current session and
|
|
2177
|
+
user. An error is returned if setting availability fails for any reason.
|
|
2178
|
+
"""
|
|
2179
|
+
return _whatsapp.whatsapp_Session_SendPresence(self.handle, presence, statusMessage)
|
|
2180
|
+
def GetContacts(self, refresh):
|
|
2181
|
+
"""GetContacts(bool refresh) []object, str
|
|
2182
|
+
|
|
2183
|
+
GetContacts subscribes to the WhatsApp roster currently stored in the Session's internal state.
|
|
2184
|
+
If `refresh` is `true`, FetchRoster will pull application state from the remote service and
|
|
2185
|
+
synchronize any contacts found with the adapter.
|
|
2186
|
+
"""
|
|
2187
|
+
return Slice_whatsapp_Contact(handle=_whatsapp.whatsapp_Session_GetContacts(self.handle, refresh))
|
|
2188
|
+
def GetGroups(self):
|
|
2189
|
+
"""GetGroups() []object, str
|
|
2190
|
+
|
|
2191
|
+
GetGroups returns a list of all group-chats currently joined in WhatsApp, along with additional
|
|
2192
|
+
information on present participants.
|
|
2193
|
+
"""
|
|
2194
|
+
return Slice_whatsapp_Group(handle=_whatsapp.whatsapp_Session_GetGroups(self.handle))
|
|
2195
|
+
def CreateGroup(self, name, participants):
|
|
2196
|
+
"""CreateGroup(str name, []str participants) object, str
|
|
2197
|
+
|
|
2198
|
+
CreateGroup attempts to create a new WhatsApp group for the given human-readable name and
|
|
2199
|
+
participant JIDs given.
|
|
2200
|
+
"""
|
|
2201
|
+
return Group(handle=_whatsapp.whatsapp_Session_CreateGroup(self.handle, name, participants.handle))
|
|
2202
|
+
def GetAvatar(self, resourceID, avatarID):
|
|
2203
|
+
"""GetAvatar(str resourceID, str avatarID) object, str
|
|
2204
|
+
|
|
2205
|
+
GetAvatar fetches a profile picture for the Contact or Group JID given. If a non-empty `avatarID`
|
|
2206
|
+
is also given, GetAvatar will return an empty [Avatar] instance with no error if the remote state
|
|
2207
|
+
for the given ID has not changed.
|
|
2208
|
+
"""
|
|
2209
|
+
return Avatar(handle=_whatsapp.whatsapp_Session_GetAvatar(self.handle, resourceID, avatarID))
|
|
2210
|
+
def SetAvatar(self, resourceID, avatarPath):
|
|
2211
|
+
"""SetAvatar(str resourceID, str avatarPath) str, str
|
|
2212
|
+
|
|
2213
|
+
SetAvatar updates the profile picture for the Contact or Group JID given; it can also update the
|
|
2214
|
+
profile picture for our own user by providing an empty JID. The unique picture ID is returned,
|
|
2215
|
+
typically used as a cache reference or in providing to future calls for [Session.GetAvatar].
|
|
2216
|
+
"""
|
|
2217
|
+
return _whatsapp.whatsapp_Session_SetAvatar(self.handle, resourceID, avatarPath)
|
|
2218
|
+
def SetGroupName(self, resourceID, name):
|
|
2219
|
+
"""SetGroupName(str resourceID, str name) str
|
|
2220
|
+
|
|
2221
|
+
SetGroupName updates the name of a WhatsApp group
|
|
2222
|
+
"""
|
|
2223
|
+
return _whatsapp.whatsapp_Session_SetGroupName(self.handle, resourceID, name)
|
|
2224
|
+
def SetGroupTopic(self, resourceID, topic):
|
|
2225
|
+
"""SetGroupTopic(str resourceID, str topic) str
|
|
2226
|
+
|
|
2227
|
+
SetGroupTopic updates the topic of a WhatsApp group
|
|
2228
|
+
"""
|
|
2229
|
+
return _whatsapp.whatsapp_Session_SetGroupTopic(self.handle, resourceID, topic)
|
|
2230
|
+
def SetAffiliation(self, groupID, participantID, change):
|
|
2231
|
+
"""SetAffiliation(str groupID, str participantID, str change) []object, str"""
|
|
2232
|
+
return Slice_types_GroupParticipant(handle=_whatsapp.whatsapp_Session_SetAffiliation(self.handle, groupID, participantID, change))
|
|
2233
|
+
def FindContact(self, phone):
|
|
2234
|
+
"""FindContact(str phone) object, str
|
|
2235
|
+
|
|
2236
|
+
FindContact attempts to check for a registered contact on WhatsApp corresponding to the given
|
|
2237
|
+
phone number, returning a concrete instance if found; typically, only the contact JID is set. No
|
|
2238
|
+
error is returned if no contact was found, but any unexpected errors will otherwise be returned
|
|
2239
|
+
directly.
|
|
2240
|
+
"""
|
|
2241
|
+
return Contact(handle=_whatsapp.whatsapp_Session_FindContact(self.handle, phone))
|
|
2242
|
+
def RequestMessageHistory(self, resourceID, oldestMessage):
|
|
2243
|
+
"""RequestMessageHistory(str resourceID, object oldestMessage) str
|
|
2244
|
+
|
|
2245
|
+
RequestMessageHistory sends and asynchronous request for message history related to the given
|
|
2246
|
+
resource (e.g. Contact or Group JID), ending at the oldest message given. Messages returned from
|
|
2247
|
+
history should then be handled as a `HistorySync` event of type `ON_DEMAND`, in the session-wide
|
|
2248
|
+
event handler. An error will be returned if requesting history fails for any reason.
|
|
2249
|
+
"""
|
|
2250
|
+
return _whatsapp.whatsapp_Session_RequestMessageHistory(self.handle, resourceID, oldestMessage.handle)
|
|
2251
|
+
def SetEventHandler(self, h, goRun=False):
|
|
2252
|
+
"""SetEventHandler(callable h)
|
|
2253
|
+
|
|
2254
|
+
SetEventHandler assigns the given handler function for propagating internal events into the Python
|
|
2255
|
+
gateway. Note that the event handler function is not entirely safe to use directly, and all calls
|
|
2256
|
+
should instead be made via the [propagateEvent] function.
|
|
2257
|
+
"""
|
|
2258
|
+
_whatsapp.whatsapp_Session_SetEventHandler(self.handle, h, goRun)
|
|
2259
|
+
|
|
2260
|
+
# Python type for struct whatsapp.ChatState
|
|
2261
|
+
class ChatState(go.GoClass):
|
|
2262
|
+
"""A ChatState represents the activity of a contact within a certain discussion, for instance,\nwhether the contact is currently composing a message. This is separate to the concept of a\nPresence, which is the contact's general state across all discussions.\n"""
|
|
2263
|
+
def __init__(self, *args, **kwargs):
|
|
2264
|
+
"""
|
|
2265
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
2266
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
2267
|
+
in which case a new Go object is constructed first
|
|
2268
|
+
"""
|
|
2269
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
2270
|
+
self.handle = kwargs['handle']
|
|
2271
|
+
_whatsapp.IncRef(self.handle)
|
|
2272
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
2273
|
+
self.handle = args[0].handle
|
|
2274
|
+
_whatsapp.IncRef(self.handle)
|
|
2275
|
+
else:
|
|
2276
|
+
self.handle = _whatsapp.whatsapp_ChatState_CTor()
|
|
2277
|
+
_whatsapp.IncRef(self.handle)
|
|
2278
|
+
if 0 < len(args):
|
|
2279
|
+
self.Kind = args[0]
|
|
2280
|
+
if "Kind" in kwargs:
|
|
2281
|
+
self.Kind = kwargs["Kind"]
|
|
2282
|
+
if 1 < len(args):
|
|
2283
|
+
self.JID = args[1]
|
|
2284
|
+
if "JID" in kwargs:
|
|
2285
|
+
self.JID = kwargs["JID"]
|
|
2286
|
+
if 2 < len(args):
|
|
2287
|
+
self.GroupJID = args[2]
|
|
2288
|
+
if "GroupJID" in kwargs:
|
|
2289
|
+
self.GroupJID = kwargs["GroupJID"]
|
|
2290
|
+
def __del__(self):
|
|
2291
|
+
_whatsapp.DecRef(self.handle)
|
|
2292
|
+
def __str__(self):
|
|
2293
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2294
|
+
sv = 'whatsapp.ChatState{'
|
|
2295
|
+
first = True
|
|
2296
|
+
for v in pr:
|
|
2297
|
+
if callable(v[1]):
|
|
2298
|
+
continue
|
|
2299
|
+
if first:
|
|
2300
|
+
first = False
|
|
2301
|
+
else:
|
|
2302
|
+
sv += ', '
|
|
2303
|
+
sv += v[0] + '=' + str(v[1])
|
|
2304
|
+
return sv + '}'
|
|
2305
|
+
def __repr__(self):
|
|
2306
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2307
|
+
sv = 'whatsapp.ChatState ( '
|
|
2308
|
+
for v in pr:
|
|
2309
|
+
if not callable(v[1]):
|
|
2310
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2311
|
+
return sv + ')'
|
|
2312
|
+
@property
|
|
2313
|
+
def Kind(self):
|
|
2314
|
+
return _whatsapp.whatsapp_ChatState_Kind_Get(self.handle)
|
|
2315
|
+
@Kind.setter
|
|
2316
|
+
def Kind(self, value):
|
|
2317
|
+
if isinstance(value, go.GoClass):
|
|
2318
|
+
_whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value.handle)
|
|
2319
|
+
else:
|
|
2320
|
+
_whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value)
|
|
2321
|
+
@property
|
|
2322
|
+
def JID(self):
|
|
2323
|
+
return _whatsapp.whatsapp_ChatState_JID_Get(self.handle)
|
|
2324
|
+
@JID.setter
|
|
2325
|
+
def JID(self, value):
|
|
2326
|
+
if isinstance(value, go.GoClass):
|
|
2327
|
+
_whatsapp.whatsapp_ChatState_JID_Set(self.handle, value.handle)
|
|
2328
|
+
else:
|
|
2329
|
+
_whatsapp.whatsapp_ChatState_JID_Set(self.handle, value)
|
|
2330
|
+
@property
|
|
2331
|
+
def GroupJID(self):
|
|
2332
|
+
return _whatsapp.whatsapp_ChatState_GroupJID_Get(self.handle)
|
|
2333
|
+
@GroupJID.setter
|
|
2334
|
+
def GroupJID(self, value):
|
|
2335
|
+
if isinstance(value, go.GoClass):
|
|
2336
|
+
_whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value.handle)
|
|
2337
|
+
else:
|
|
2338
|
+
_whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value)
|
|
2339
|
+
|
|
2340
|
+
# Python type for struct whatsapp.Gateway
|
|
2341
|
+
class Gateway(go.GoClass):
|
|
2342
|
+
"""A Gateway represents a persistent process for establishing individual sessions between linked\ndevices and WhatsApp.\n"""
|
|
2343
|
+
def __init__(self, *args, **kwargs):
|
|
2344
|
+
"""
|
|
2345
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
2346
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
2347
|
+
in which case a new Go object is constructed first
|
|
2348
|
+
"""
|
|
2349
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
2350
|
+
self.handle = kwargs['handle']
|
|
2351
|
+
_whatsapp.IncRef(self.handle)
|
|
2352
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
2353
|
+
self.handle = args[0].handle
|
|
2354
|
+
_whatsapp.IncRef(self.handle)
|
|
2355
|
+
else:
|
|
2356
|
+
self.handle = _whatsapp.whatsapp_Gateway_CTor()
|
|
2357
|
+
_whatsapp.IncRef(self.handle)
|
|
2358
|
+
if 0 < len(args):
|
|
2359
|
+
self.DBPath = args[0]
|
|
2360
|
+
if "DBPath" in kwargs:
|
|
2361
|
+
self.DBPath = kwargs["DBPath"]
|
|
2362
|
+
if 1 < len(args):
|
|
2363
|
+
self.Name = args[1]
|
|
2364
|
+
if "Name" in kwargs:
|
|
2365
|
+
self.Name = kwargs["Name"]
|
|
2366
|
+
if 2 < len(args):
|
|
2367
|
+
self.TempDir = args[2]
|
|
2368
|
+
if "TempDir" in kwargs:
|
|
2369
|
+
self.TempDir = kwargs["TempDir"]
|
|
2370
|
+
def __del__(self):
|
|
2371
|
+
_whatsapp.DecRef(self.handle)
|
|
2372
|
+
def __str__(self):
|
|
2373
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2374
|
+
sv = 'whatsapp.Gateway{'
|
|
2375
|
+
first = True
|
|
2376
|
+
for v in pr:
|
|
2377
|
+
if callable(v[1]):
|
|
2378
|
+
continue
|
|
2379
|
+
if first:
|
|
2380
|
+
first = False
|
|
2381
|
+
else:
|
|
2382
|
+
sv += ', '
|
|
2383
|
+
sv += v[0] + '=' + str(v[1])
|
|
2384
|
+
return sv + '}'
|
|
2385
|
+
def __repr__(self):
|
|
2386
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2387
|
+
sv = 'whatsapp.Gateway ( '
|
|
2388
|
+
for v in pr:
|
|
2389
|
+
if not callable(v[1]):
|
|
2390
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2391
|
+
return sv + ')'
|
|
2392
|
+
@property
|
|
2393
|
+
def DBPath(self):
|
|
2394
|
+
return _whatsapp.whatsapp_Gateway_DBPath_Get(self.handle)
|
|
2395
|
+
@DBPath.setter
|
|
2396
|
+
def DBPath(self, value):
|
|
2397
|
+
if isinstance(value, go.GoClass):
|
|
2398
|
+
_whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value.handle)
|
|
2399
|
+
else:
|
|
2400
|
+
_whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value)
|
|
2401
|
+
@property
|
|
2402
|
+
def Name(self):
|
|
2403
|
+
return _whatsapp.whatsapp_Gateway_Name_Get(self.handle)
|
|
2404
|
+
@Name.setter
|
|
2405
|
+
def Name(self, value):
|
|
2406
|
+
if isinstance(value, go.GoClass):
|
|
2407
|
+
_whatsapp.whatsapp_Gateway_Name_Set(self.handle, value.handle)
|
|
2408
|
+
else:
|
|
2409
|
+
_whatsapp.whatsapp_Gateway_Name_Set(self.handle, value)
|
|
2410
|
+
@property
|
|
2411
|
+
def TempDir(self):
|
|
2412
|
+
return _whatsapp.whatsapp_Gateway_TempDir_Get(self.handle)
|
|
2413
|
+
@TempDir.setter
|
|
2414
|
+
def TempDir(self, value):
|
|
2415
|
+
if isinstance(value, go.GoClass):
|
|
2416
|
+
_whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value.handle)
|
|
2417
|
+
else:
|
|
2418
|
+
_whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value)
|
|
2419
|
+
def SetLogHandler(self, h, goRun=False):
|
|
2420
|
+
"""SetLogHandler(callable h)
|
|
2421
|
+
|
|
2422
|
+
SetLogHandler specifies the log handling function to use for all [Gateway] and [Session] operations.
|
|
2423
|
+
"""
|
|
2424
|
+
_whatsapp.whatsapp_Gateway_SetLogHandler(self.handle, h, goRun)
|
|
2425
|
+
def Init(self):
|
|
2426
|
+
"""Init() str
|
|
2427
|
+
|
|
2428
|
+
Init performs initialization procedures for the Gateway, and is expected to be run before any
|
|
2429
|
+
calls to [Gateway.Session].
|
|
2430
|
+
"""
|
|
2431
|
+
return _whatsapp.whatsapp_Gateway_Init(self.handle)
|
|
2432
|
+
def NewSession(self, device):
|
|
2433
|
+
"""NewSession(object device) object
|
|
2434
|
+
|
|
2435
|
+
NewSession returns a new [Session] for the LinkedDevice given. If the linked device does not have
|
|
2436
|
+
a valid ID, a pair operation will be required, as described in [Session.Login].
|
|
2437
|
+
"""
|
|
2438
|
+
return Session(handle=_whatsapp.whatsapp_Gateway_NewSession(self.handle, device.handle))
|
|
2439
|
+
def CleanupSession(self, device):
|
|
2440
|
+
"""CleanupSession(object device) str
|
|
2441
|
+
|
|
2442
|
+
CleanupSession will remove all invalid and obsolete references to the given device, and should be
|
|
2443
|
+
used when pairing a new device or unregistering from the Gateway.
|
|
2444
|
+
"""
|
|
2445
|
+
return _whatsapp.whatsapp_Gateway_CleanupSession(self.handle, device.handle)
|
|
2446
|
+
|
|
2447
|
+
# Python type for struct whatsapp.GroupSubject
|
|
2448
|
+
class GroupSubject(go.GoClass):
|
|
2449
|
+
"""A GroupSubject represents the user-defined group description and attached metadata thereof, for a\ngiven [Group].\n"""
|
|
2450
|
+
def __init__(self, *args, **kwargs):
|
|
2451
|
+
"""
|
|
2452
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
2453
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
2454
|
+
in which case a new Go object is constructed first
|
|
2455
|
+
"""
|
|
2456
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
2457
|
+
self.handle = kwargs['handle']
|
|
2458
|
+
_whatsapp.IncRef(self.handle)
|
|
2459
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
2460
|
+
self.handle = args[0].handle
|
|
2461
|
+
_whatsapp.IncRef(self.handle)
|
|
2462
|
+
else:
|
|
2463
|
+
self.handle = _whatsapp.whatsapp_GroupSubject_CTor()
|
|
2464
|
+
_whatsapp.IncRef(self.handle)
|
|
2465
|
+
if 0 < len(args):
|
|
2466
|
+
self.Subject = args[0]
|
|
2467
|
+
if "Subject" in kwargs:
|
|
2468
|
+
self.Subject = kwargs["Subject"]
|
|
2469
|
+
if 1 < len(args):
|
|
2470
|
+
self.SetAt = args[1]
|
|
2471
|
+
if "SetAt" in kwargs:
|
|
2472
|
+
self.SetAt = kwargs["SetAt"]
|
|
2473
|
+
if 2 < len(args):
|
|
2474
|
+
self.SetByJID = args[2]
|
|
2475
|
+
if "SetByJID" in kwargs:
|
|
2476
|
+
self.SetByJID = kwargs["SetByJID"]
|
|
2477
|
+
def __del__(self):
|
|
2478
|
+
_whatsapp.DecRef(self.handle)
|
|
2479
|
+
def __str__(self):
|
|
2480
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2481
|
+
sv = 'whatsapp.GroupSubject{'
|
|
2482
|
+
first = True
|
|
2483
|
+
for v in pr:
|
|
2484
|
+
if callable(v[1]):
|
|
2485
|
+
continue
|
|
2486
|
+
if first:
|
|
2487
|
+
first = False
|
|
2488
|
+
else:
|
|
2489
|
+
sv += ', '
|
|
2490
|
+
sv += v[0] + '=' + str(v[1])
|
|
2491
|
+
return sv + '}'
|
|
2492
|
+
def __repr__(self):
|
|
2493
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2494
|
+
sv = 'whatsapp.GroupSubject ( '
|
|
2495
|
+
for v in pr:
|
|
2496
|
+
if not callable(v[1]):
|
|
2497
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2498
|
+
return sv + ')'
|
|
2499
|
+
@property
|
|
2500
|
+
def Subject(self):
|
|
2501
|
+
return _whatsapp.whatsapp_GroupSubject_Subject_Get(self.handle)
|
|
2502
|
+
@Subject.setter
|
|
2503
|
+
def Subject(self, value):
|
|
2504
|
+
if isinstance(value, go.GoClass):
|
|
2505
|
+
_whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value.handle)
|
|
2506
|
+
else:
|
|
2507
|
+
_whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value)
|
|
2508
|
+
@property
|
|
2509
|
+
def SetAt(self):
|
|
2510
|
+
return _whatsapp.whatsapp_GroupSubject_SetAt_Get(self.handle)
|
|
2511
|
+
@SetAt.setter
|
|
2512
|
+
def SetAt(self, value):
|
|
2513
|
+
if isinstance(value, go.GoClass):
|
|
2514
|
+
_whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value.handle)
|
|
2515
|
+
else:
|
|
2516
|
+
_whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value)
|
|
2517
|
+
@property
|
|
2518
|
+
def SetByJID(self):
|
|
2519
|
+
return _whatsapp.whatsapp_GroupSubject_SetByJID_Get(self.handle)
|
|
2520
|
+
@SetByJID.setter
|
|
2521
|
+
def SetByJID(self, value):
|
|
2522
|
+
if isinstance(value, go.GoClass):
|
|
2523
|
+
_whatsapp.whatsapp_GroupSubject_SetByJID_Set(self.handle, value.handle)
|
|
2524
|
+
else:
|
|
2525
|
+
_whatsapp.whatsapp_GroupSubject_SetByJID_Set(self.handle, value)
|
|
2526
|
+
|
|
2527
|
+
# Python type for struct whatsapp.Presence
|
|
2528
|
+
class Presence(go.GoClass):
|
|
2529
|
+
"""Precence represents a contact's general state of activity, and is periodically updated as\ncontacts start or stop paying attention to their client of choice.\n"""
|
|
2530
|
+
def __init__(self, *args, **kwargs):
|
|
2531
|
+
"""
|
|
2532
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
2533
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
2534
|
+
in which case a new Go object is constructed first
|
|
2535
|
+
"""
|
|
2536
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
2537
|
+
self.handle = kwargs['handle']
|
|
2538
|
+
_whatsapp.IncRef(self.handle)
|
|
2539
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
2540
|
+
self.handle = args[0].handle
|
|
2541
|
+
_whatsapp.IncRef(self.handle)
|
|
2542
|
+
else:
|
|
2543
|
+
self.handle = _whatsapp.whatsapp_Presence_CTor()
|
|
2544
|
+
_whatsapp.IncRef(self.handle)
|
|
2545
|
+
if 0 < len(args):
|
|
2546
|
+
self.JID = args[0]
|
|
2547
|
+
if "JID" in kwargs:
|
|
2548
|
+
self.JID = kwargs["JID"]
|
|
2549
|
+
if 1 < len(args):
|
|
2550
|
+
self.Kind = args[1]
|
|
2551
|
+
if "Kind" in kwargs:
|
|
2552
|
+
self.Kind = kwargs["Kind"]
|
|
2553
|
+
if 2 < len(args):
|
|
2554
|
+
self.LastSeen = args[2]
|
|
2555
|
+
if "LastSeen" in kwargs:
|
|
2556
|
+
self.LastSeen = kwargs["LastSeen"]
|
|
2557
|
+
def __del__(self):
|
|
2558
|
+
_whatsapp.DecRef(self.handle)
|
|
2559
|
+
def __str__(self):
|
|
2560
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2561
|
+
sv = 'whatsapp.Presence{'
|
|
2562
|
+
first = True
|
|
2563
|
+
for v in pr:
|
|
2564
|
+
if callable(v[1]):
|
|
2565
|
+
continue
|
|
2566
|
+
if first:
|
|
2567
|
+
first = False
|
|
2568
|
+
else:
|
|
2569
|
+
sv += ', '
|
|
2570
|
+
sv += v[0] + '=' + str(v[1])
|
|
2571
|
+
return sv + '}'
|
|
2572
|
+
def __repr__(self):
|
|
2573
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2574
|
+
sv = 'whatsapp.Presence ( '
|
|
2575
|
+
for v in pr:
|
|
2576
|
+
if not callable(v[1]):
|
|
2577
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2578
|
+
return sv + ')'
|
|
2579
|
+
@property
|
|
2580
|
+
def JID(self):
|
|
2581
|
+
return _whatsapp.whatsapp_Presence_JID_Get(self.handle)
|
|
2582
|
+
@JID.setter
|
|
2583
|
+
def JID(self, value):
|
|
2584
|
+
if isinstance(value, go.GoClass):
|
|
2585
|
+
_whatsapp.whatsapp_Presence_JID_Set(self.handle, value.handle)
|
|
2586
|
+
else:
|
|
2587
|
+
_whatsapp.whatsapp_Presence_JID_Set(self.handle, value)
|
|
2588
|
+
@property
|
|
2589
|
+
def Kind(self):
|
|
2590
|
+
return _whatsapp.whatsapp_Presence_Kind_Get(self.handle)
|
|
2591
|
+
@Kind.setter
|
|
2592
|
+
def Kind(self, value):
|
|
2593
|
+
if isinstance(value, go.GoClass):
|
|
2594
|
+
_whatsapp.whatsapp_Presence_Kind_Set(self.handle, value.handle)
|
|
2595
|
+
else:
|
|
2596
|
+
_whatsapp.whatsapp_Presence_Kind_Set(self.handle, value)
|
|
2597
|
+
@property
|
|
2598
|
+
def LastSeen(self):
|
|
2599
|
+
return _whatsapp.whatsapp_Presence_LastSeen_Get(self.handle)
|
|
2600
|
+
@LastSeen.setter
|
|
2601
|
+
def LastSeen(self, value):
|
|
2602
|
+
if isinstance(value, go.GoClass):
|
|
2603
|
+
_whatsapp.whatsapp_Presence_LastSeen_Set(self.handle, value.handle)
|
|
2604
|
+
else:
|
|
2605
|
+
_whatsapp.whatsapp_Presence_LastSeen_Set(self.handle, value)
|
|
2606
|
+
|
|
2607
|
+
# Python type for struct whatsapp.EventPayload
|
|
2608
|
+
class EventPayload(go.GoClass):
|
|
2609
|
+
"""EventPayload represents the collected payloads for all event types handled by the overarching\nsession adapter handler. Only specific fields will be populated in events emitted by internal\nhandlers, see documentation for specific types for more information.\n"""
|
|
2610
|
+
def __init__(self, *args, **kwargs):
|
|
2611
|
+
"""
|
|
2612
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
2613
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
2614
|
+
in which case a new Go object is constructed first
|
|
2615
|
+
"""
|
|
2616
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
2617
|
+
self.handle = kwargs['handle']
|
|
2618
|
+
_whatsapp.IncRef(self.handle)
|
|
2619
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
2620
|
+
self.handle = args[0].handle
|
|
2621
|
+
_whatsapp.IncRef(self.handle)
|
|
2622
|
+
else:
|
|
2623
|
+
self.handle = _whatsapp.whatsapp_EventPayload_CTor()
|
|
2624
|
+
_whatsapp.IncRef(self.handle)
|
|
2625
|
+
if 0 < len(args):
|
|
2626
|
+
self.QRCode = args[0]
|
|
2627
|
+
if "QRCode" in kwargs:
|
|
2628
|
+
self.QRCode = kwargs["QRCode"]
|
|
2629
|
+
if 1 < len(args):
|
|
2630
|
+
self.PairDeviceID = args[1]
|
|
2631
|
+
if "PairDeviceID" in kwargs:
|
|
2632
|
+
self.PairDeviceID = kwargs["PairDeviceID"]
|
|
2633
|
+
if 2 < len(args):
|
|
2634
|
+
self.ConnectedJID = args[2]
|
|
2635
|
+
if "ConnectedJID" in kwargs:
|
|
2636
|
+
self.ConnectedJID = kwargs["ConnectedJID"]
|
|
2637
|
+
if 3 < len(args):
|
|
2638
|
+
self.Contact = args[3]
|
|
2639
|
+
if "Contact" in kwargs:
|
|
2640
|
+
self.Contact = kwargs["Contact"]
|
|
2641
|
+
if 4 < len(args):
|
|
2642
|
+
self.Presence = args[4]
|
|
2643
|
+
if "Presence" in kwargs:
|
|
2644
|
+
self.Presence = kwargs["Presence"]
|
|
2645
|
+
if 5 < len(args):
|
|
2646
|
+
self.Message = args[5]
|
|
2647
|
+
if "Message" in kwargs:
|
|
2648
|
+
self.Message = kwargs["Message"]
|
|
2649
|
+
if 6 < len(args):
|
|
2650
|
+
self.ChatState = args[6]
|
|
2651
|
+
if "ChatState" in kwargs:
|
|
2652
|
+
self.ChatState = kwargs["ChatState"]
|
|
2653
|
+
if 7 < len(args):
|
|
2654
|
+
self.Receipt = args[7]
|
|
2655
|
+
if "Receipt" in kwargs:
|
|
2656
|
+
self.Receipt = kwargs["Receipt"]
|
|
2657
|
+
if 8 < len(args):
|
|
2658
|
+
self.Group = args[8]
|
|
2659
|
+
if "Group" in kwargs:
|
|
2660
|
+
self.Group = kwargs["Group"]
|
|
2661
|
+
if 9 < len(args):
|
|
2662
|
+
self.Call = args[9]
|
|
2663
|
+
if "Call" in kwargs:
|
|
2664
|
+
self.Call = kwargs["Call"]
|
|
2665
|
+
def __del__(self):
|
|
2666
|
+
_whatsapp.DecRef(self.handle)
|
|
2667
|
+
def __str__(self):
|
|
2668
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2669
|
+
sv = 'whatsapp.EventPayload{'
|
|
2670
|
+
first = True
|
|
2671
|
+
for v in pr:
|
|
2672
|
+
if callable(v[1]):
|
|
2673
|
+
continue
|
|
2674
|
+
if first:
|
|
2675
|
+
first = False
|
|
2676
|
+
else:
|
|
2677
|
+
sv += ', '
|
|
2678
|
+
sv += v[0] + '=' + str(v[1])
|
|
2679
|
+
return sv + '}'
|
|
2680
|
+
def __repr__(self):
|
|
2681
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2682
|
+
sv = 'whatsapp.EventPayload ( '
|
|
2683
|
+
for v in pr:
|
|
2684
|
+
if not callable(v[1]):
|
|
2685
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2686
|
+
return sv + ')'
|
|
2687
|
+
@property
|
|
2688
|
+
def QRCode(self):
|
|
2689
|
+
return _whatsapp.whatsapp_EventPayload_QRCode_Get(self.handle)
|
|
2690
|
+
@QRCode.setter
|
|
2691
|
+
def QRCode(self, value):
|
|
2692
|
+
if isinstance(value, go.GoClass):
|
|
2693
|
+
_whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value.handle)
|
|
2694
|
+
else:
|
|
2695
|
+
_whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value)
|
|
2696
|
+
@property
|
|
2697
|
+
def PairDeviceID(self):
|
|
2698
|
+
return _whatsapp.whatsapp_EventPayload_PairDeviceID_Get(self.handle)
|
|
2699
|
+
@PairDeviceID.setter
|
|
2700
|
+
def PairDeviceID(self, value):
|
|
2701
|
+
if isinstance(value, go.GoClass):
|
|
2702
|
+
_whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value.handle)
|
|
2703
|
+
else:
|
|
2704
|
+
_whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value)
|
|
2705
|
+
@property
|
|
2706
|
+
def ConnectedJID(self):
|
|
2707
|
+
return _whatsapp.whatsapp_EventPayload_ConnectedJID_Get(self.handle)
|
|
2708
|
+
@ConnectedJID.setter
|
|
2709
|
+
def ConnectedJID(self, value):
|
|
2710
|
+
if isinstance(value, go.GoClass):
|
|
2711
|
+
_whatsapp.whatsapp_EventPayload_ConnectedJID_Set(self.handle, value.handle)
|
|
2712
|
+
else:
|
|
2713
|
+
_whatsapp.whatsapp_EventPayload_ConnectedJID_Set(self.handle, value)
|
|
2714
|
+
@property
|
|
2715
|
+
def Contact(self):
|
|
2716
|
+
return Contact(handle=_whatsapp.whatsapp_EventPayload_Contact_Get(self.handle))
|
|
2717
|
+
@Contact.setter
|
|
2718
|
+
def Contact(self, value):
|
|
2719
|
+
if isinstance(value, go.GoClass):
|
|
2720
|
+
_whatsapp.whatsapp_EventPayload_Contact_Set(self.handle, value.handle)
|
|
2721
|
+
else:
|
|
2722
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2723
|
+
@property
|
|
2724
|
+
def Presence(self):
|
|
2725
|
+
return Presence(handle=_whatsapp.whatsapp_EventPayload_Presence_Get(self.handle))
|
|
2726
|
+
@Presence.setter
|
|
2727
|
+
def Presence(self, value):
|
|
2728
|
+
if isinstance(value, go.GoClass):
|
|
2729
|
+
_whatsapp.whatsapp_EventPayload_Presence_Set(self.handle, value.handle)
|
|
2730
|
+
else:
|
|
2731
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2732
|
+
@property
|
|
2733
|
+
def Message(self):
|
|
2734
|
+
return Message(handle=_whatsapp.whatsapp_EventPayload_Message_Get(self.handle))
|
|
2735
|
+
@Message.setter
|
|
2736
|
+
def Message(self, value):
|
|
2737
|
+
if isinstance(value, go.GoClass):
|
|
2738
|
+
_whatsapp.whatsapp_EventPayload_Message_Set(self.handle, value.handle)
|
|
2739
|
+
else:
|
|
2740
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2741
|
+
@property
|
|
2742
|
+
def ChatState(self):
|
|
2743
|
+
return ChatState(handle=_whatsapp.whatsapp_EventPayload_ChatState_Get(self.handle))
|
|
2744
|
+
@ChatState.setter
|
|
2745
|
+
def ChatState(self, value):
|
|
2746
|
+
if isinstance(value, go.GoClass):
|
|
2747
|
+
_whatsapp.whatsapp_EventPayload_ChatState_Set(self.handle, value.handle)
|
|
2748
|
+
else:
|
|
2749
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2750
|
+
@property
|
|
2751
|
+
def Receipt(self):
|
|
2752
|
+
return Receipt(handle=_whatsapp.whatsapp_EventPayload_Receipt_Get(self.handle))
|
|
2753
|
+
@Receipt.setter
|
|
2754
|
+
def Receipt(self, value):
|
|
2755
|
+
if isinstance(value, go.GoClass):
|
|
2756
|
+
_whatsapp.whatsapp_EventPayload_Receipt_Set(self.handle, value.handle)
|
|
2757
|
+
else:
|
|
2758
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2759
|
+
@property
|
|
2760
|
+
def Group(self):
|
|
2761
|
+
return Group(handle=_whatsapp.whatsapp_EventPayload_Group_Get(self.handle))
|
|
2762
|
+
@Group.setter
|
|
2763
|
+
def Group(self, value):
|
|
2764
|
+
if isinstance(value, go.GoClass):
|
|
2765
|
+
_whatsapp.whatsapp_EventPayload_Group_Set(self.handle, value.handle)
|
|
2766
|
+
else:
|
|
2767
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2768
|
+
@property
|
|
2769
|
+
def Call(self):
|
|
2770
|
+
return Call(handle=_whatsapp.whatsapp_EventPayload_Call_Get(self.handle))
|
|
2771
|
+
@Call.setter
|
|
2772
|
+
def Call(self, value):
|
|
2773
|
+
if isinstance(value, go.GoClass):
|
|
2774
|
+
_whatsapp.whatsapp_EventPayload_Call_Set(self.handle, value.handle)
|
|
2775
|
+
else:
|
|
2776
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2777
|
+
|
|
2778
|
+
|
|
2779
|
+
# ---- Slices ---
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
# ---- Maps ---
|
|
2783
|
+
|
|
2784
|
+
|
|
2785
|
+
# ---- Constructors ---
|
|
2786
|
+
def NewGateway():
|
|
2787
|
+
"""NewGateway() object
|
|
2788
|
+
|
|
2789
|
+
NewGateway returns a new, un-initialized Gateway. This function should always be followed by calls
|
|
2790
|
+
to [Gateway.Init], assuming a valid [Gateway.DBPath] is set.
|
|
2791
|
+
"""
|
|
2792
|
+
return Gateway(handle=_whatsapp.whatsapp_NewGateway())
|
|
2793
|
+
|
|
2794
|
+
|
|
2795
|
+
# ---- Functions ---
|
|
2796
|
+
|
|
2797
|
+
|