slidge-whatsapp 0.2.2__cp312-cp312-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.

@@ -0,0 +1,2911 @@
1
+
2
+ # python wrapper for package codeberg.org/slidge/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
+
531
+ #---- Enums from Go (collections of consts with same type) ---
532
+ from enum import Enum
533
+
534
+ class CallState(Enum):
535
+ """
536
+ CallState represents the state of the call to synchronize with.
537
+
538
+ """
539
+ CallUnknown = 0
540
+ """
541
+ The call states handled by the overarching session event handler.
542
+
543
+ """
544
+ CallIncoming = 1
545
+ """
546
+ The call states handled by the overarching session event handler.
547
+
548
+ """
549
+ CallMissed = 2
550
+ """
551
+ The call states handled by the overarching session event handler.
552
+
553
+ """
554
+
555
+ CallUnknown = 0
556
+ """
557
+ The call states handled by the overarching session event handler.
558
+
559
+ """
560
+ CallIncoming = 1
561
+ """
562
+ The call states handled by the overarching session event handler.
563
+
564
+ """
565
+ CallMissed = 2
566
+ """
567
+ The call states handled by the overarching session event handler.
568
+
569
+ """
570
+
571
+ class ChatStateKind(Enum):
572
+ """
573
+ ChatStateKind represents the different kinds of chat-states possible in WhatsApp.
574
+
575
+ """
576
+ ChatStateUnknown = 0
577
+ """
578
+ The chat states handled by the overarching session event handler.
579
+
580
+ """
581
+ ChatStateComposing = 1
582
+ """
583
+ The chat states handled by the overarching session event handler.
584
+
585
+ """
586
+ ChatStatePaused = 2
587
+ """
588
+ The chat states handled by the overarching session event handler.
589
+
590
+ """
591
+
592
+ ChatStateUnknown = 0
593
+ """
594
+ The chat states handled by the overarching session event handler.
595
+
596
+ """
597
+ ChatStateComposing = 1
598
+ """
599
+ The chat states handled by the overarching session event handler.
600
+
601
+ """
602
+ ChatStatePaused = 2
603
+ """
604
+ The chat states handled by the overarching session event handler.
605
+
606
+ """
607
+
608
+ class EventKind(Enum):
609
+ """
610
+ EventKind represents all event types recognized by the Python session adapter, as emitted by the
611
+ Go session adapter.
612
+
613
+ """
614
+ EventUnknown = 0
615
+ """
616
+ The event types handled by the overarching session adapter handler.
617
+
618
+ """
619
+ EventQRCode = 1
620
+ """
621
+ The event types handled by the overarching session adapter handler.
622
+
623
+ """
624
+ EventPair = 2
625
+ """
626
+ The event types handled by the overarching session adapter handler.
627
+
628
+ """
629
+ EventConnect = 3
630
+ """
631
+ The event types handled by the overarching session adapter handler.
632
+
633
+ """
634
+ EventLoggedOut = 4
635
+ """
636
+ The event types handled by the overarching session adapter handler.
637
+
638
+ """
639
+ EventContact = 5
640
+ """
641
+ The event types handled by the overarching session adapter handler.
642
+
643
+ """
644
+ EventPresence = 6
645
+ """
646
+ The event types handled by the overarching session adapter handler.
647
+
648
+ """
649
+ EventMessage = 7
650
+ """
651
+ The event types handled by the overarching session adapter handler.
652
+
653
+ """
654
+ EventChatState = 8
655
+ """
656
+ The event types handled by the overarching session adapter handler.
657
+
658
+ """
659
+ EventReceipt = 9
660
+ """
661
+ The event types handled by the overarching session adapter handler.
662
+
663
+ """
664
+ EventGroup = 10
665
+ """
666
+ The event types handled by the overarching session adapter handler.
667
+
668
+ """
669
+ EventCall = 11
670
+ """
671
+ The event types handled by the overarching session adapter handler.
672
+
673
+ """
674
+
675
+ EventUnknown = 0
676
+ """
677
+ The event types handled by the overarching session adapter handler.
678
+
679
+ """
680
+ EventQRCode = 1
681
+ """
682
+ The event types handled by the overarching session adapter handler.
683
+
684
+ """
685
+ EventPair = 2
686
+ """
687
+ The event types handled by the overarching session adapter handler.
688
+
689
+ """
690
+ EventConnect = 3
691
+ """
692
+ The event types handled by the overarching session adapter handler.
693
+
694
+ """
695
+ EventLoggedOut = 4
696
+ """
697
+ The event types handled by the overarching session adapter handler.
698
+
699
+ """
700
+ EventContact = 5
701
+ """
702
+ The event types handled by the overarching session adapter handler.
703
+
704
+ """
705
+ EventPresence = 6
706
+ """
707
+ The event types handled by the overarching session adapter handler.
708
+
709
+ """
710
+ EventMessage = 7
711
+ """
712
+ The event types handled by the overarching session adapter handler.
713
+
714
+ """
715
+ EventChatState = 8
716
+ """
717
+ The event types handled by the overarching session adapter handler.
718
+
719
+ """
720
+ EventReceipt = 9
721
+ """
722
+ The event types handled by the overarching session adapter handler.
723
+
724
+ """
725
+ EventGroup = 10
726
+ """
727
+ The event types handled by the overarching session adapter handler.
728
+
729
+ """
730
+ EventCall = 11
731
+ """
732
+ The event types handled by the overarching session adapter handler.
733
+
734
+ """
735
+
736
+ class GroupAffiliation(Enum):
737
+ """
738
+ GroupAffiliation represents the set of privilidges given to a specific participant in a group.
739
+
740
+ """
741
+ GroupAffiliationNone = 0
742
+ GroupAffiliationAdmin = 1
743
+ GroupAffiliationOwner = 2
744
+
745
+ GroupAffiliationNone = 0
746
+ GroupAffiliationAdmin = 1
747
+ GroupAffiliationOwner = 2
748
+
749
+ class GroupParticipantAction(Enum):
750
+ """
751
+ GroupParticipantAction represents the distinct set of actions that can be taken when encountering
752
+ a group participant, typically to add or remove.
753
+
754
+ """
755
+ GroupParticipantActionAdd = 0
756
+ GroupParticipantActionRemove = 1
757
+ GroupParticipantActionPromote = 2
758
+ GroupParticipantActionDemote = 3
759
+
760
+ GroupParticipantActionAdd = 0
761
+ GroupParticipantActionRemove = 1
762
+ GroupParticipantActionPromote = 2
763
+ GroupParticipantActionDemote = 3
764
+
765
+ class MessageKind(Enum):
766
+ """
767
+ MessageKind represents all concrete message types (plain-text messages, edit messages, reactions)
768
+ recognized by the Python session adapter.
769
+
770
+ """
771
+ MessagePlain = 0
772
+ """
773
+ The message types handled by the overarching session event handler.
774
+
775
+ """
776
+ MessageEdit = 1
777
+ """
778
+ The message types handled by the overarching session event handler.
779
+
780
+ """
781
+ MessageRevoke = 2
782
+ """
783
+ The message types handled by the overarching session event handler.
784
+
785
+ """
786
+ MessageReaction = 3
787
+ """
788
+ The message types handled by the overarching session event handler.
789
+
790
+ """
791
+ MessageAttachment = 4
792
+ """
793
+ The message types handled by the overarching session event handler.
794
+
795
+ """
796
+
797
+ MessagePlain = 0
798
+ """
799
+ The message types handled by the overarching session event handler.
800
+
801
+ """
802
+ MessageEdit = 1
803
+ """
804
+ The message types handled by the overarching session event handler.
805
+
806
+ """
807
+ MessageRevoke = 2
808
+ """
809
+ The message types handled by the overarching session event handler.
810
+
811
+ """
812
+ MessageReaction = 3
813
+ """
814
+ The message types handled by the overarching session event handler.
815
+
816
+ """
817
+ MessageAttachment = 4
818
+ """
819
+ The message types handled by the overarching session event handler.
820
+
821
+ """
822
+
823
+ class PresenceKind(Enum):
824
+ """
825
+ PresenceKind represents the different kinds of activity states possible in WhatsApp.
826
+
827
+ """
828
+ PresenceUnknown = 0
829
+ """
830
+ The presences handled by the overarching session event handler.
831
+
832
+ """
833
+ PresenceAvailable = 1
834
+ """
835
+ The presences handled by the overarching session event handler.
836
+
837
+ """
838
+ PresenceUnavailable = 2
839
+ """
840
+ The presences handled by the overarching session event handler.
841
+
842
+ """
843
+
844
+ PresenceUnknown = 0
845
+ """
846
+ The presences handled by the overarching session event handler.
847
+
848
+ """
849
+ PresenceAvailable = 1
850
+ """
851
+ The presences handled by the overarching session event handler.
852
+
853
+ """
854
+ PresenceUnavailable = 2
855
+ """
856
+ The presences handled by the overarching session event handler.
857
+
858
+ """
859
+
860
+ class PreviewKind(Enum):
861
+ """
862
+ PreviewKind represents different ways of previewingadditional data inline with messages.
863
+
864
+ """
865
+ PreviewPlain = 0
866
+ PreviewVideo = 1
867
+
868
+ PreviewPlain = 0
869
+ PreviewVideo = 1
870
+
871
+ class ReceiptKind(Enum):
872
+ """
873
+ ReceiptKind represents the different types of delivery receipts possible in WhatsApp.
874
+
875
+ """
876
+ ReceiptUnknown = 0
877
+ """
878
+ The delivery receipts handled by the overarching session event handler.
879
+
880
+ """
881
+ ReceiptDelivered = 1
882
+ """
883
+ The delivery receipts handled by the overarching session event handler.
884
+
885
+ """
886
+ ReceiptRead = 2
887
+ """
888
+ The delivery receipts handled by the overarching session event handler.
889
+
890
+ """
891
+
892
+ ReceiptUnknown = 0
893
+ """
894
+ The delivery receipts handled by the overarching session event handler.
895
+
896
+ """
897
+ ReceiptDelivered = 1
898
+ """
899
+ The delivery receipts handled by the overarching session event handler.
900
+
901
+ """
902
+ ReceiptRead = 2
903
+ """
904
+ The delivery receipts handled by the overarching session event handler.
905
+
906
+ """
907
+
908
+
909
+
910
+ #---- Constants from Go: Python can only ask that you please don't change these! ---
911
+ DefaultGroupServer = "g.us"
912
+ DefaultUserServer = "s.whatsapp.net"
913
+
914
+
915
+ # ---- Global Variables: can only use functions to access ---
916
+
917
+
918
+ # ---- Interfaces ---
919
+
920
+
921
+ # ---- Structs ---
922
+
923
+ # Python type for struct whatsapp.Gateway
924
+ class Gateway(go.GoClass):
925
+ """A Gateway represents a persistent process for establishing individual sessions between linked\ndevices and WhatsApp.\n"""
926
+ def __init__(self, *args, **kwargs):
927
+ """
928
+ handle=A Go-side object is always initialized with an explicit handle=arg
929
+ otherwise parameters can be unnamed in order of field names or named fields
930
+ in which case a new Go object is constructed first
931
+ """
932
+ if len(kwargs) == 1 and 'handle' in kwargs:
933
+ self.handle = kwargs['handle']
934
+ _whatsapp.IncRef(self.handle)
935
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
936
+ self.handle = args[0].handle
937
+ _whatsapp.IncRef(self.handle)
938
+ else:
939
+ self.handle = _whatsapp.whatsapp_Gateway_CTor()
940
+ _whatsapp.IncRef(self.handle)
941
+ if 0 < len(args):
942
+ self.DBPath = args[0]
943
+ if "DBPath" in kwargs:
944
+ self.DBPath = kwargs["DBPath"]
945
+ if 1 < len(args):
946
+ self.Name = args[1]
947
+ if "Name" in kwargs:
948
+ self.Name = kwargs["Name"]
949
+ if 2 < len(args):
950
+ self.LogLevel = args[2]
951
+ if "LogLevel" in kwargs:
952
+ self.LogLevel = kwargs["LogLevel"]
953
+ if 3 < len(args):
954
+ self.TempDir = args[3]
955
+ if "TempDir" in kwargs:
956
+ self.TempDir = kwargs["TempDir"]
957
+ def __del__(self):
958
+ _whatsapp.DecRef(self.handle)
959
+ def __str__(self):
960
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
961
+ sv = 'whatsapp.Gateway{'
962
+ first = True
963
+ for v in pr:
964
+ if callable(v[1]):
965
+ continue
966
+ if first:
967
+ first = False
968
+ else:
969
+ sv += ', '
970
+ sv += v[0] + '=' + str(v[1])
971
+ return sv + '}'
972
+ def __repr__(self):
973
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
974
+ sv = 'whatsapp.Gateway ( '
975
+ for v in pr:
976
+ if not callable(v[1]):
977
+ sv += v[0] + '=' + str(v[1]) + ', '
978
+ return sv + ')'
979
+ @property
980
+ def DBPath(self):
981
+ return _whatsapp.whatsapp_Gateway_DBPath_Get(self.handle)
982
+ @DBPath.setter
983
+ def DBPath(self, value):
984
+ if isinstance(value, go.GoClass):
985
+ _whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value.handle)
986
+ else:
987
+ _whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value)
988
+ @property
989
+ def Name(self):
990
+ return _whatsapp.whatsapp_Gateway_Name_Get(self.handle)
991
+ @Name.setter
992
+ def Name(self, value):
993
+ if isinstance(value, go.GoClass):
994
+ _whatsapp.whatsapp_Gateway_Name_Set(self.handle, value.handle)
995
+ else:
996
+ _whatsapp.whatsapp_Gateway_Name_Set(self.handle, value)
997
+ @property
998
+ def LogLevel(self):
999
+ return _whatsapp.whatsapp_Gateway_LogLevel_Get(self.handle)
1000
+ @LogLevel.setter
1001
+ def LogLevel(self, value):
1002
+ if isinstance(value, go.GoClass):
1003
+ _whatsapp.whatsapp_Gateway_LogLevel_Set(self.handle, value.handle)
1004
+ else:
1005
+ _whatsapp.whatsapp_Gateway_LogLevel_Set(self.handle, value)
1006
+ @property
1007
+ def TempDir(self):
1008
+ return _whatsapp.whatsapp_Gateway_TempDir_Get(self.handle)
1009
+ @TempDir.setter
1010
+ def TempDir(self, value):
1011
+ if isinstance(value, go.GoClass):
1012
+ _whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value.handle)
1013
+ else:
1014
+ _whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value)
1015
+ def Init(self):
1016
+ """Init() str
1017
+
1018
+ Init performs initialization procedures for the Gateway, and is expected to be run before any
1019
+ calls to [Gateway.Session].
1020
+ """
1021
+ return _whatsapp.whatsapp_Gateway_Init(self.handle)
1022
+ def NewSession(self, device):
1023
+ """NewSession(object device) object
1024
+
1025
+ NewSession returns a new [Session] for the LinkedDevice given. If the linked device does not have
1026
+ a valid ID, a pair operation will be required, as described in [Session.Login].
1027
+ """
1028
+ return Session(handle=_whatsapp.whatsapp_Gateway_NewSession(self.handle, device.handle))
1029
+ def CleanupSession(self, device):
1030
+ """CleanupSession(object device) str
1031
+
1032
+ CleanupSession will remove all invalid and obsolete references to the given device, and should be
1033
+ used when pairing a new device or unregistering from the Gateway.
1034
+ """
1035
+ return _whatsapp.whatsapp_Gateway_CleanupSession(self.handle, device.handle)
1036
+
1037
+ # Python type for struct whatsapp.Location
1038
+ class Location(go.GoClass):
1039
+ """A Location represents additional metadata given to location messages.\n"""
1040
+ def __init__(self, *args, **kwargs):
1041
+ """
1042
+ handle=A Go-side object is always initialized with an explicit handle=arg
1043
+ otherwise parameters can be unnamed in order of field names or named fields
1044
+ in which case a new Go object is constructed first
1045
+ """
1046
+ if len(kwargs) == 1 and 'handle' in kwargs:
1047
+ self.handle = kwargs['handle']
1048
+ _whatsapp.IncRef(self.handle)
1049
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1050
+ self.handle = args[0].handle
1051
+ _whatsapp.IncRef(self.handle)
1052
+ else:
1053
+ self.handle = _whatsapp.whatsapp_Location_CTor()
1054
+ _whatsapp.IncRef(self.handle)
1055
+ if 0 < len(args):
1056
+ self.Latitude = args[0]
1057
+ if "Latitude" in kwargs:
1058
+ self.Latitude = kwargs["Latitude"]
1059
+ if 1 < len(args):
1060
+ self.Longitude = args[1]
1061
+ if "Longitude" in kwargs:
1062
+ self.Longitude = kwargs["Longitude"]
1063
+ if 2 < len(args):
1064
+ self.Accuracy = args[2]
1065
+ if "Accuracy" in kwargs:
1066
+ self.Accuracy = kwargs["Accuracy"]
1067
+ if 3 < len(args):
1068
+ self.IsLive = args[3]
1069
+ if "IsLive" in kwargs:
1070
+ self.IsLive = kwargs["IsLive"]
1071
+ if 4 < len(args):
1072
+ self.Name = args[4]
1073
+ if "Name" in kwargs:
1074
+ self.Name = kwargs["Name"]
1075
+ if 5 < len(args):
1076
+ self.Address = args[5]
1077
+ if "Address" in kwargs:
1078
+ self.Address = kwargs["Address"]
1079
+ if 6 < len(args):
1080
+ self.URL = args[6]
1081
+ if "URL" in kwargs:
1082
+ self.URL = kwargs["URL"]
1083
+ def __del__(self):
1084
+ _whatsapp.DecRef(self.handle)
1085
+ def __str__(self):
1086
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1087
+ sv = 'whatsapp.Location{'
1088
+ first = True
1089
+ for v in pr:
1090
+ if callable(v[1]):
1091
+ continue
1092
+ if first:
1093
+ first = False
1094
+ else:
1095
+ sv += ', '
1096
+ sv += v[0] + '=' + str(v[1])
1097
+ return sv + '}'
1098
+ def __repr__(self):
1099
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1100
+ sv = 'whatsapp.Location ( '
1101
+ for v in pr:
1102
+ if not callable(v[1]):
1103
+ sv += v[0] + '=' + str(v[1]) + ', '
1104
+ return sv + ')'
1105
+ @property
1106
+ def Latitude(self):
1107
+ return _whatsapp.whatsapp_Location_Latitude_Get(self.handle)
1108
+ @Latitude.setter
1109
+ def Latitude(self, value):
1110
+ if isinstance(value, go.GoClass):
1111
+ _whatsapp.whatsapp_Location_Latitude_Set(self.handle, value.handle)
1112
+ else:
1113
+ _whatsapp.whatsapp_Location_Latitude_Set(self.handle, value)
1114
+ @property
1115
+ def Longitude(self):
1116
+ return _whatsapp.whatsapp_Location_Longitude_Get(self.handle)
1117
+ @Longitude.setter
1118
+ def Longitude(self, value):
1119
+ if isinstance(value, go.GoClass):
1120
+ _whatsapp.whatsapp_Location_Longitude_Set(self.handle, value.handle)
1121
+ else:
1122
+ _whatsapp.whatsapp_Location_Longitude_Set(self.handle, value)
1123
+ @property
1124
+ def Accuracy(self):
1125
+ return _whatsapp.whatsapp_Location_Accuracy_Get(self.handle)
1126
+ @Accuracy.setter
1127
+ def Accuracy(self, value):
1128
+ if isinstance(value, go.GoClass):
1129
+ _whatsapp.whatsapp_Location_Accuracy_Set(self.handle, value.handle)
1130
+ else:
1131
+ _whatsapp.whatsapp_Location_Accuracy_Set(self.handle, value)
1132
+ @property
1133
+ def IsLive(self):
1134
+ return _whatsapp.whatsapp_Location_IsLive_Get(self.handle)
1135
+ @IsLive.setter
1136
+ def IsLive(self, value):
1137
+ if isinstance(value, go.GoClass):
1138
+ _whatsapp.whatsapp_Location_IsLive_Set(self.handle, value.handle)
1139
+ else:
1140
+ _whatsapp.whatsapp_Location_IsLive_Set(self.handle, value)
1141
+ @property
1142
+ def Name(self):
1143
+ """Optional fields given for named locations.
1144
+ """
1145
+ return _whatsapp.whatsapp_Location_Name_Get(self.handle)
1146
+ @Name.setter
1147
+ def Name(self, value):
1148
+ if isinstance(value, go.GoClass):
1149
+ _whatsapp.whatsapp_Location_Name_Set(self.handle, value.handle)
1150
+ else:
1151
+ _whatsapp.whatsapp_Location_Name_Set(self.handle, value)
1152
+ @property
1153
+ def Address(self):
1154
+ return _whatsapp.whatsapp_Location_Address_Get(self.handle)
1155
+ @Address.setter
1156
+ def Address(self, value):
1157
+ if isinstance(value, go.GoClass):
1158
+ _whatsapp.whatsapp_Location_Address_Set(self.handle, value.handle)
1159
+ else:
1160
+ _whatsapp.whatsapp_Location_Address_Set(self.handle, value)
1161
+ @property
1162
+ def URL(self):
1163
+ return _whatsapp.whatsapp_Location_URL_Get(self.handle)
1164
+ @URL.setter
1165
+ def URL(self, value):
1166
+ if isinstance(value, go.GoClass):
1167
+ _whatsapp.whatsapp_Location_URL_Set(self.handle, value.handle)
1168
+ else:
1169
+ _whatsapp.whatsapp_Location_URL_Set(self.handle, value)
1170
+
1171
+ # Python type for struct whatsapp.Presence
1172
+ class Presence(go.GoClass):
1173
+ """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"""
1174
+ def __init__(self, *args, **kwargs):
1175
+ """
1176
+ handle=A Go-side object is always initialized with an explicit handle=arg
1177
+ otherwise parameters can be unnamed in order of field names or named fields
1178
+ in which case a new Go object is constructed first
1179
+ """
1180
+ if len(kwargs) == 1 and 'handle' in kwargs:
1181
+ self.handle = kwargs['handle']
1182
+ _whatsapp.IncRef(self.handle)
1183
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1184
+ self.handle = args[0].handle
1185
+ _whatsapp.IncRef(self.handle)
1186
+ else:
1187
+ self.handle = _whatsapp.whatsapp_Presence_CTor()
1188
+ _whatsapp.IncRef(self.handle)
1189
+ if 0 < len(args):
1190
+ self.JID = args[0]
1191
+ if "JID" in kwargs:
1192
+ self.JID = kwargs["JID"]
1193
+ if 1 < len(args):
1194
+ self.Kind = args[1]
1195
+ if "Kind" in kwargs:
1196
+ self.Kind = kwargs["Kind"]
1197
+ if 2 < len(args):
1198
+ self.LastSeen = args[2]
1199
+ if "LastSeen" in kwargs:
1200
+ self.LastSeen = kwargs["LastSeen"]
1201
+ def __del__(self):
1202
+ _whatsapp.DecRef(self.handle)
1203
+ def __str__(self):
1204
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1205
+ sv = 'whatsapp.Presence{'
1206
+ first = True
1207
+ for v in pr:
1208
+ if callable(v[1]):
1209
+ continue
1210
+ if first:
1211
+ first = False
1212
+ else:
1213
+ sv += ', '
1214
+ sv += v[0] + '=' + str(v[1])
1215
+ return sv + '}'
1216
+ def __repr__(self):
1217
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1218
+ sv = 'whatsapp.Presence ( '
1219
+ for v in pr:
1220
+ if not callable(v[1]):
1221
+ sv += v[0] + '=' + str(v[1]) + ', '
1222
+ return sv + ')'
1223
+ @property
1224
+ def JID(self):
1225
+ return _whatsapp.whatsapp_Presence_JID_Get(self.handle)
1226
+ @JID.setter
1227
+ def JID(self, value):
1228
+ if isinstance(value, go.GoClass):
1229
+ _whatsapp.whatsapp_Presence_JID_Set(self.handle, value.handle)
1230
+ else:
1231
+ _whatsapp.whatsapp_Presence_JID_Set(self.handle, value)
1232
+ @property
1233
+ def Kind(self):
1234
+ return _whatsapp.whatsapp_Presence_Kind_Get(self.handle)
1235
+ @Kind.setter
1236
+ def Kind(self, value):
1237
+ if isinstance(value, go.GoClass):
1238
+ _whatsapp.whatsapp_Presence_Kind_Set(self.handle, value.handle)
1239
+ else:
1240
+ _whatsapp.whatsapp_Presence_Kind_Set(self.handle, value)
1241
+ @property
1242
+ def LastSeen(self):
1243
+ return _whatsapp.whatsapp_Presence_LastSeen_Get(self.handle)
1244
+ @LastSeen.setter
1245
+ def LastSeen(self, value):
1246
+ if isinstance(value, go.GoClass):
1247
+ _whatsapp.whatsapp_Presence_LastSeen_Set(self.handle, value.handle)
1248
+ else:
1249
+ _whatsapp.whatsapp_Presence_LastSeen_Set(self.handle, value)
1250
+
1251
+ # Python type for struct whatsapp.Preview
1252
+ class Preview(go.GoClass):
1253
+ """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"""
1254
+ def __init__(self, *args, **kwargs):
1255
+ """
1256
+ handle=A Go-side object is always initialized with an explicit handle=arg
1257
+ otherwise parameters can be unnamed in order of field names or named fields
1258
+ in which case a new Go object is constructed first
1259
+ """
1260
+ if len(kwargs) == 1 and 'handle' in kwargs:
1261
+ self.handle = kwargs['handle']
1262
+ _whatsapp.IncRef(self.handle)
1263
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1264
+ self.handle = args[0].handle
1265
+ _whatsapp.IncRef(self.handle)
1266
+ else:
1267
+ self.handle = _whatsapp.whatsapp_Preview_CTor()
1268
+ _whatsapp.IncRef(self.handle)
1269
+ if 0 < len(args):
1270
+ self.Kind = args[0]
1271
+ if "Kind" in kwargs:
1272
+ self.Kind = kwargs["Kind"]
1273
+ if 1 < len(args):
1274
+ self.URL = args[1]
1275
+ if "URL" in kwargs:
1276
+ self.URL = kwargs["URL"]
1277
+ if 2 < len(args):
1278
+ self.Title = args[2]
1279
+ if "Title" in kwargs:
1280
+ self.Title = kwargs["Title"]
1281
+ if 3 < len(args):
1282
+ self.Description = args[3]
1283
+ if "Description" in kwargs:
1284
+ self.Description = kwargs["Description"]
1285
+ if 4 < len(args):
1286
+ self.Thumbnail = args[4]
1287
+ if "Thumbnail" in kwargs:
1288
+ self.Thumbnail = kwargs["Thumbnail"]
1289
+ def __del__(self):
1290
+ _whatsapp.DecRef(self.handle)
1291
+ def __str__(self):
1292
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1293
+ sv = 'whatsapp.Preview{'
1294
+ first = True
1295
+ for v in pr:
1296
+ if callable(v[1]):
1297
+ continue
1298
+ if first:
1299
+ first = False
1300
+ else:
1301
+ sv += ', '
1302
+ sv += v[0] + '=' + str(v[1])
1303
+ return sv + '}'
1304
+ def __repr__(self):
1305
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1306
+ sv = 'whatsapp.Preview ( '
1307
+ for v in pr:
1308
+ if not callable(v[1]):
1309
+ sv += v[0] + '=' + str(v[1]) + ', '
1310
+ return sv + ')'
1311
+ @property
1312
+ def Kind(self):
1313
+ return _whatsapp.whatsapp_Preview_Kind_Get(self.handle)
1314
+ @Kind.setter
1315
+ def Kind(self, value):
1316
+ if isinstance(value, go.GoClass):
1317
+ _whatsapp.whatsapp_Preview_Kind_Set(self.handle, value.handle)
1318
+ else:
1319
+ _whatsapp.whatsapp_Preview_Kind_Set(self.handle, value)
1320
+ @property
1321
+ def URL(self):
1322
+ return _whatsapp.whatsapp_Preview_URL_Get(self.handle)
1323
+ @URL.setter
1324
+ def URL(self, value):
1325
+ if isinstance(value, go.GoClass):
1326
+ _whatsapp.whatsapp_Preview_URL_Set(self.handle, value.handle)
1327
+ else:
1328
+ _whatsapp.whatsapp_Preview_URL_Set(self.handle, value)
1329
+ @property
1330
+ def Title(self):
1331
+ return _whatsapp.whatsapp_Preview_Title_Get(self.handle)
1332
+ @Title.setter
1333
+ def Title(self, value):
1334
+ if isinstance(value, go.GoClass):
1335
+ _whatsapp.whatsapp_Preview_Title_Set(self.handle, value.handle)
1336
+ else:
1337
+ _whatsapp.whatsapp_Preview_Title_Set(self.handle, value)
1338
+ @property
1339
+ def Description(self):
1340
+ return _whatsapp.whatsapp_Preview_Description_Get(self.handle)
1341
+ @Description.setter
1342
+ def Description(self, value):
1343
+ if isinstance(value, go.GoClass):
1344
+ _whatsapp.whatsapp_Preview_Description_Set(self.handle, value.handle)
1345
+ else:
1346
+ _whatsapp.whatsapp_Preview_Description_Set(self.handle, value)
1347
+ @property
1348
+ def Thumbnail(self):
1349
+ return go.Slice_byte(handle=_whatsapp.whatsapp_Preview_Thumbnail_Get(self.handle))
1350
+ @Thumbnail.setter
1351
+ def Thumbnail(self, value):
1352
+ if isinstance(value, go.GoClass):
1353
+ _whatsapp.whatsapp_Preview_Thumbnail_Set(self.handle, value.handle)
1354
+ else:
1355
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1356
+
1357
+ # Python type for struct whatsapp.Avatar
1358
+ class Avatar(go.GoClass):
1359
+ """A Avatar represents a small image set for a Contact or Group.\n"""
1360
+ def __init__(self, *args, **kwargs):
1361
+ """
1362
+ handle=A Go-side object is always initialized with an explicit handle=arg
1363
+ otherwise parameters can be unnamed in order of field names or named fields
1364
+ in which case a new Go object is constructed first
1365
+ """
1366
+ if len(kwargs) == 1 and 'handle' in kwargs:
1367
+ self.handle = kwargs['handle']
1368
+ _whatsapp.IncRef(self.handle)
1369
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1370
+ self.handle = args[0].handle
1371
+ _whatsapp.IncRef(self.handle)
1372
+ else:
1373
+ self.handle = _whatsapp.whatsapp_Avatar_CTor()
1374
+ _whatsapp.IncRef(self.handle)
1375
+ if 0 < len(args):
1376
+ self.ID = args[0]
1377
+ if "ID" in kwargs:
1378
+ self.ID = kwargs["ID"]
1379
+ if 1 < len(args):
1380
+ self.URL = args[1]
1381
+ if "URL" in kwargs:
1382
+ self.URL = kwargs["URL"]
1383
+ def __del__(self):
1384
+ _whatsapp.DecRef(self.handle)
1385
+ def __str__(self):
1386
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1387
+ sv = 'whatsapp.Avatar{'
1388
+ first = True
1389
+ for v in pr:
1390
+ if callable(v[1]):
1391
+ continue
1392
+ if first:
1393
+ first = False
1394
+ else:
1395
+ sv += ', '
1396
+ sv += v[0] + '=' + str(v[1])
1397
+ return sv + '}'
1398
+ def __repr__(self):
1399
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1400
+ sv = 'whatsapp.Avatar ( '
1401
+ for v in pr:
1402
+ if not callable(v[1]):
1403
+ sv += v[0] + '=' + str(v[1]) + ', '
1404
+ return sv + ')'
1405
+ @property
1406
+ def ID(self):
1407
+ return _whatsapp.whatsapp_Avatar_ID_Get(self.handle)
1408
+ @ID.setter
1409
+ def ID(self, value):
1410
+ if isinstance(value, go.GoClass):
1411
+ _whatsapp.whatsapp_Avatar_ID_Set(self.handle, value.handle)
1412
+ else:
1413
+ _whatsapp.whatsapp_Avatar_ID_Set(self.handle, value)
1414
+ @property
1415
+ def URL(self):
1416
+ return _whatsapp.whatsapp_Avatar_URL_Get(self.handle)
1417
+ @URL.setter
1418
+ def URL(self, value):
1419
+ if isinstance(value, go.GoClass):
1420
+ _whatsapp.whatsapp_Avatar_URL_Set(self.handle, value.handle)
1421
+ else:
1422
+ _whatsapp.whatsapp_Avatar_URL_Set(self.handle, value)
1423
+
1424
+ # Python type for struct whatsapp.EventPayload
1425
+ class EventPayload(go.GoClass):
1426
+ """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"""
1427
+ def __init__(self, *args, **kwargs):
1428
+ """
1429
+ handle=A Go-side object is always initialized with an explicit handle=arg
1430
+ otherwise parameters can be unnamed in order of field names or named fields
1431
+ in which case a new Go object is constructed first
1432
+ """
1433
+ if len(kwargs) == 1 and 'handle' in kwargs:
1434
+ self.handle = kwargs['handle']
1435
+ _whatsapp.IncRef(self.handle)
1436
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1437
+ self.handle = args[0].handle
1438
+ _whatsapp.IncRef(self.handle)
1439
+ else:
1440
+ self.handle = _whatsapp.whatsapp_EventPayload_CTor()
1441
+ _whatsapp.IncRef(self.handle)
1442
+ if 0 < len(args):
1443
+ self.QRCode = args[0]
1444
+ if "QRCode" in kwargs:
1445
+ self.QRCode = kwargs["QRCode"]
1446
+ if 1 < len(args):
1447
+ self.PairDeviceID = args[1]
1448
+ if "PairDeviceID" in kwargs:
1449
+ self.PairDeviceID = kwargs["PairDeviceID"]
1450
+ if 2 < len(args):
1451
+ self.Connect = args[2]
1452
+ if "Connect" in kwargs:
1453
+ self.Connect = kwargs["Connect"]
1454
+ if 3 < len(args):
1455
+ self.Contact = args[3]
1456
+ if "Contact" in kwargs:
1457
+ self.Contact = kwargs["Contact"]
1458
+ if 4 < len(args):
1459
+ self.Presence = args[4]
1460
+ if "Presence" in kwargs:
1461
+ self.Presence = kwargs["Presence"]
1462
+ if 5 < len(args):
1463
+ self.Message = args[5]
1464
+ if "Message" in kwargs:
1465
+ self.Message = kwargs["Message"]
1466
+ if 6 < len(args):
1467
+ self.ChatState = args[6]
1468
+ if "ChatState" in kwargs:
1469
+ self.ChatState = kwargs["ChatState"]
1470
+ if 7 < len(args):
1471
+ self.Receipt = args[7]
1472
+ if "Receipt" in kwargs:
1473
+ self.Receipt = kwargs["Receipt"]
1474
+ if 8 < len(args):
1475
+ self.Group = args[8]
1476
+ if "Group" in kwargs:
1477
+ self.Group = kwargs["Group"]
1478
+ if 9 < len(args):
1479
+ self.Call = args[9]
1480
+ if "Call" in kwargs:
1481
+ self.Call = kwargs["Call"]
1482
+ def __del__(self):
1483
+ _whatsapp.DecRef(self.handle)
1484
+ def __str__(self):
1485
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1486
+ sv = 'whatsapp.EventPayload{'
1487
+ first = True
1488
+ for v in pr:
1489
+ if callable(v[1]):
1490
+ continue
1491
+ if first:
1492
+ first = False
1493
+ else:
1494
+ sv += ', '
1495
+ sv += v[0] + '=' + str(v[1])
1496
+ return sv + '}'
1497
+ def __repr__(self):
1498
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1499
+ sv = 'whatsapp.EventPayload ( '
1500
+ for v in pr:
1501
+ if not callable(v[1]):
1502
+ sv += v[0] + '=' + str(v[1]) + ', '
1503
+ return sv + ')'
1504
+ @property
1505
+ def QRCode(self):
1506
+ return _whatsapp.whatsapp_EventPayload_QRCode_Get(self.handle)
1507
+ @QRCode.setter
1508
+ def QRCode(self, value):
1509
+ if isinstance(value, go.GoClass):
1510
+ _whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value.handle)
1511
+ else:
1512
+ _whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value)
1513
+ @property
1514
+ def PairDeviceID(self):
1515
+ return _whatsapp.whatsapp_EventPayload_PairDeviceID_Get(self.handle)
1516
+ @PairDeviceID.setter
1517
+ def PairDeviceID(self, value):
1518
+ if isinstance(value, go.GoClass):
1519
+ _whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value.handle)
1520
+ else:
1521
+ _whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value)
1522
+ @property
1523
+ def Connect(self):
1524
+ return Connect(handle=_whatsapp.whatsapp_EventPayload_Connect_Get(self.handle))
1525
+ @Connect.setter
1526
+ def Connect(self, value):
1527
+ if isinstance(value, go.GoClass):
1528
+ _whatsapp.whatsapp_EventPayload_Connect_Set(self.handle, value.handle)
1529
+ else:
1530
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1531
+ @property
1532
+ def Contact(self):
1533
+ return Contact(handle=_whatsapp.whatsapp_EventPayload_Contact_Get(self.handle))
1534
+ @Contact.setter
1535
+ def Contact(self, value):
1536
+ if isinstance(value, go.GoClass):
1537
+ _whatsapp.whatsapp_EventPayload_Contact_Set(self.handle, value.handle)
1538
+ else:
1539
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1540
+ @property
1541
+ def Presence(self):
1542
+ return Presence(handle=_whatsapp.whatsapp_EventPayload_Presence_Get(self.handle))
1543
+ @Presence.setter
1544
+ def Presence(self, value):
1545
+ if isinstance(value, go.GoClass):
1546
+ _whatsapp.whatsapp_EventPayload_Presence_Set(self.handle, value.handle)
1547
+ else:
1548
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1549
+ @property
1550
+ def Message(self):
1551
+ return Message(handle=_whatsapp.whatsapp_EventPayload_Message_Get(self.handle))
1552
+ @Message.setter
1553
+ def Message(self, value):
1554
+ if isinstance(value, go.GoClass):
1555
+ _whatsapp.whatsapp_EventPayload_Message_Set(self.handle, value.handle)
1556
+ else:
1557
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1558
+ @property
1559
+ def ChatState(self):
1560
+ return ChatState(handle=_whatsapp.whatsapp_EventPayload_ChatState_Get(self.handle))
1561
+ @ChatState.setter
1562
+ def ChatState(self, value):
1563
+ if isinstance(value, go.GoClass):
1564
+ _whatsapp.whatsapp_EventPayload_ChatState_Set(self.handle, value.handle)
1565
+ else:
1566
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1567
+ @property
1568
+ def Receipt(self):
1569
+ return Receipt(handle=_whatsapp.whatsapp_EventPayload_Receipt_Get(self.handle))
1570
+ @Receipt.setter
1571
+ def Receipt(self, value):
1572
+ if isinstance(value, go.GoClass):
1573
+ _whatsapp.whatsapp_EventPayload_Receipt_Set(self.handle, value.handle)
1574
+ else:
1575
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1576
+ @property
1577
+ def Group(self):
1578
+ return Group(handle=_whatsapp.whatsapp_EventPayload_Group_Get(self.handle))
1579
+ @Group.setter
1580
+ def Group(self, value):
1581
+ if isinstance(value, go.GoClass):
1582
+ _whatsapp.whatsapp_EventPayload_Group_Set(self.handle, value.handle)
1583
+ else:
1584
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1585
+ @property
1586
+ def Call(self):
1587
+ return Call(handle=_whatsapp.whatsapp_EventPayload_Call_Get(self.handle))
1588
+ @Call.setter
1589
+ def Call(self, value):
1590
+ if isinstance(value, go.GoClass):
1591
+ _whatsapp.whatsapp_EventPayload_Call_Set(self.handle, value.handle)
1592
+ else:
1593
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1594
+
1595
+ # Python type for struct whatsapp.LinkedDevice
1596
+ class LinkedDevice(go.GoClass):
1597
+ """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"""
1598
+ def __init__(self, *args, **kwargs):
1599
+ """
1600
+ handle=A Go-side object is always initialized with an explicit handle=arg
1601
+ otherwise parameters can be unnamed in order of field names or named fields
1602
+ in which case a new Go object is constructed first
1603
+ """
1604
+ if len(kwargs) == 1 and 'handle' in kwargs:
1605
+ self.handle = kwargs['handle']
1606
+ _whatsapp.IncRef(self.handle)
1607
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1608
+ self.handle = args[0].handle
1609
+ _whatsapp.IncRef(self.handle)
1610
+ else:
1611
+ self.handle = _whatsapp.whatsapp_LinkedDevice_CTor()
1612
+ _whatsapp.IncRef(self.handle)
1613
+ if 0 < len(args):
1614
+ self.ID = args[0]
1615
+ if "ID" in kwargs:
1616
+ self.ID = kwargs["ID"]
1617
+ def __del__(self):
1618
+ _whatsapp.DecRef(self.handle)
1619
+ def __str__(self):
1620
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1621
+ sv = 'whatsapp.LinkedDevice{'
1622
+ first = True
1623
+ for v in pr:
1624
+ if callable(v[1]):
1625
+ continue
1626
+ if first:
1627
+ first = False
1628
+ else:
1629
+ sv += ', '
1630
+ sv += v[0] + '=' + str(v[1])
1631
+ return sv + '}'
1632
+ def __repr__(self):
1633
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1634
+ sv = 'whatsapp.LinkedDevice ( '
1635
+ for v in pr:
1636
+ if not callable(v[1]):
1637
+ sv += v[0] + '=' + str(v[1]) + ', '
1638
+ return sv + ')'
1639
+ @property
1640
+ def ID(self):
1641
+ """ID is an opaque string identifying this LinkedDevice to the Session. Noted that this string
1642
+ is currently equivalent to a password, and needs to be protected accordingly.
1643
+ """
1644
+ return _whatsapp.whatsapp_LinkedDevice_ID_Get(self.handle)
1645
+ @ID.setter
1646
+ def ID(self, value):
1647
+ if isinstance(value, go.GoClass):
1648
+ _whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value.handle)
1649
+ else:
1650
+ _whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value)
1651
+ def JID(self):
1652
+ """JID() object
1653
+
1654
+ JID returns the WhatsApp JID corresponding to the LinkedDevice ID. Empty or invalid device IDs
1655
+ may return invalid JIDs, and this function does not handle errors.
1656
+ """
1657
+ return go.types_JID(handle=_whatsapp.whatsapp_LinkedDevice_JID(self.handle))
1658
+
1659
+ # Python type for struct whatsapp.Session
1660
+ class Session(go.GoClass):
1661
+ """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"""
1662
+ def __init__(self, *args, **kwargs):
1663
+ """
1664
+ handle=A Go-side object is always initialized with an explicit handle=arg
1665
+ otherwise parameters can be unnamed in order of field names or named fields
1666
+ in which case a new Go object is constructed first
1667
+ """
1668
+ if len(kwargs) == 1 and 'handle' in kwargs:
1669
+ self.handle = kwargs['handle']
1670
+ _whatsapp.IncRef(self.handle)
1671
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1672
+ self.handle = args[0].handle
1673
+ _whatsapp.IncRef(self.handle)
1674
+ else:
1675
+ self.handle = _whatsapp.whatsapp_Session_CTor()
1676
+ _whatsapp.IncRef(self.handle)
1677
+ def __del__(self):
1678
+ _whatsapp.DecRef(self.handle)
1679
+ def __str__(self):
1680
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1681
+ sv = 'whatsapp.Session{'
1682
+ first = True
1683
+ for v in pr:
1684
+ if callable(v[1]):
1685
+ continue
1686
+ if first:
1687
+ first = False
1688
+ else:
1689
+ sv += ', '
1690
+ sv += v[0] + '=' + str(v[1])
1691
+ return sv + '}'
1692
+ def __repr__(self):
1693
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1694
+ sv = 'whatsapp.Session ( '
1695
+ for v in pr:
1696
+ if not callable(v[1]):
1697
+ sv += v[0] + '=' + str(v[1]) + ', '
1698
+ return sv + ')'
1699
+ def Login(self):
1700
+ """Login() str
1701
+
1702
+ Login attempts to authenticate the given [Session], either by re-using the [LinkedDevice] attached
1703
+ or by initiating a pairing session for a new linked device. Callers are expected to have set an
1704
+ event handler in order to receive any incoming events from the underlying WhatsApp session.
1705
+ """
1706
+ return _whatsapp.whatsapp_Session_Login(self.handle)
1707
+ def Logout(self):
1708
+ """Logout() str
1709
+
1710
+ Logout disconnects and removes the current linked device locally and initiates a logout remotely.
1711
+ """
1712
+ return _whatsapp.whatsapp_Session_Logout(self.handle)
1713
+ def Disconnect(self):
1714
+ """Disconnect() str
1715
+
1716
+ Disconnects detaches the current connection to WhatsApp without removing any linked device state.
1717
+ """
1718
+ return _whatsapp.whatsapp_Session_Disconnect(self.handle)
1719
+ def PairPhone(self, phone):
1720
+ """PairPhone(str phone) str, str
1721
+
1722
+ PairPhone returns a one-time code from WhatsApp, used for pairing this [Session] against the
1723
+ user's primary device, as identified by the given phone number. This will return an error if the
1724
+ [Session] is already paired, or if the phone number given is empty or invalid.
1725
+ """
1726
+ return _whatsapp.whatsapp_Session_PairPhone(self.handle, phone)
1727
+ def SendMessage(self, message):
1728
+ """SendMessage(object message) str
1729
+
1730
+ SendMessage processes the given Message and sends a WhatsApp message for the kind and contact JID
1731
+ specified within. In general, different message kinds require different fields to be set; see the
1732
+ documentation for the [Message] type for more information.
1733
+ """
1734
+ return _whatsapp.whatsapp_Session_SendMessage(self.handle, message.handle)
1735
+ def GenerateMessageID(self):
1736
+ """GenerateMessageID() str
1737
+
1738
+ GenerateMessageID returns a valid, pseudo-random message ID for use in outgoing messages.
1739
+ """
1740
+ return _whatsapp.whatsapp_Session_GenerateMessageID(self.handle)
1741
+ def SendChatState(self, state):
1742
+ """SendChatState(object state) str
1743
+
1744
+ SendChatState sends the given chat state notification (e.g. composing message) to WhatsApp for the
1745
+ contact specified within.
1746
+ """
1747
+ return _whatsapp.whatsapp_Session_SendChatState(self.handle, state.handle)
1748
+ def SendReceipt(self, receipt):
1749
+ """SendReceipt(object receipt) str
1750
+
1751
+ SendReceipt sends a read receipt to WhatsApp for the message IDs specified within.
1752
+ """
1753
+ return _whatsapp.whatsapp_Session_SendReceipt(self.handle, receipt.handle)
1754
+ def SendPresence(self, presence, statusMessage):
1755
+ """SendPresence(int presence, str statusMessage) str
1756
+
1757
+ SendPresence sets the activity state and (optional) status message for the current session and
1758
+ user. An error is returned if setting availability fails for any reason.
1759
+ """
1760
+ return _whatsapp.whatsapp_Session_SendPresence(self.handle, presence, statusMessage)
1761
+ def GetContacts(self, refresh):
1762
+ """GetContacts(bool refresh) []object, str
1763
+
1764
+ GetContacts subscribes to the WhatsApp roster currently stored in the Session's internal state.
1765
+ If `refresh` is `true`, FetchRoster will pull application state from the remote service and
1766
+ synchronize any contacts found with the adapter.
1767
+ """
1768
+ return Slice_whatsapp_Contact(handle=_whatsapp.whatsapp_Session_GetContacts(self.handle, refresh))
1769
+ def GetGroups(self):
1770
+ """GetGroups() []object, str
1771
+
1772
+ GetGroups returns a list of all group-chats currently joined in WhatsApp, along with additional
1773
+ information on present participants.
1774
+ """
1775
+ return Slice_whatsapp_Group(handle=_whatsapp.whatsapp_Session_GetGroups(self.handle))
1776
+ def CreateGroup(self, name, participants):
1777
+ """CreateGroup(str name, []str participants) object, str
1778
+
1779
+ CreateGroup attempts to create a new WhatsApp group for the given human-readable name and
1780
+ participant JIDs given.
1781
+ """
1782
+ return Group(handle=_whatsapp.whatsapp_Session_CreateGroup(self.handle, name, participants.handle))
1783
+ def LeaveGroup(self, resourceID):
1784
+ """LeaveGroup(str resourceID) str
1785
+
1786
+ LeaveGroup attempts to remove our own user from the given WhatsApp group, for the JID given.
1787
+ """
1788
+ return _whatsapp.whatsapp_Session_LeaveGroup(self.handle, resourceID)
1789
+ def GetAvatar(self, resourceID, avatarID):
1790
+ """GetAvatar(str resourceID, str avatarID) object, str
1791
+
1792
+ GetAvatar fetches a profile picture for the Contact or Group JID given. If a non-empty `avatarID`
1793
+ is also given, GetAvatar will return an empty [Avatar] instance with no error if the remote state
1794
+ for the given ID has not changed.
1795
+ """
1796
+ return Avatar(handle=_whatsapp.whatsapp_Session_GetAvatar(self.handle, resourceID, avatarID))
1797
+ def SetAvatar(self, resourceID, avatar):
1798
+ """SetAvatar(str resourceID, []int avatar) str, str
1799
+
1800
+ SetAvatar updates the profile picture for the Contact or Group JID given; it can also update the
1801
+ profile picture for our own user by providing an empty JID. The unique picture ID is returned,
1802
+ typically used as a cache reference or in providing to future calls for [Session.GetAvatar].
1803
+ """
1804
+ return _whatsapp.whatsapp_Session_SetAvatar(self.handle, resourceID, avatar.handle)
1805
+ def SetGroupName(self, resourceID, name):
1806
+ """SetGroupName(str resourceID, str name) str
1807
+
1808
+ SetGroupName updates the name of a WhatsApp group for the Group JID given.
1809
+ """
1810
+ return _whatsapp.whatsapp_Session_SetGroupName(self.handle, resourceID, name)
1811
+ def SetGroupTopic(self, resourceID, topic):
1812
+ """SetGroupTopic(str resourceID, str topic) str
1813
+
1814
+ SetGroupName updates the topic of a WhatsApp group for the Group JID given.
1815
+ """
1816
+ return _whatsapp.whatsapp_Session_SetGroupTopic(self.handle, resourceID, topic)
1817
+ def UpdateGroupParticipants(self, resourceID, participants):
1818
+ """UpdateGroupParticipants(str resourceID, []object participants) []object, str
1819
+
1820
+ UpdateGroupParticipants processes changes to the given group's participants, including additions,
1821
+ removals, and changes to privileges. Participant JIDs given must be part of the authenticated
1822
+ session's roster at least, and must also be active group participants for other types of changes.
1823
+ """
1824
+ return Slice_whatsapp_GroupParticipant(handle=_whatsapp.whatsapp_Session_UpdateGroupParticipants(self.handle, resourceID, participants.handle))
1825
+ def FindContact(self, phone):
1826
+ """FindContact(str phone) object, str
1827
+
1828
+ FindContact attempts to check for a registered contact on WhatsApp corresponding to the given
1829
+ phone number, returning a concrete instance if found; typically, only the contact JID is set. No
1830
+ error is returned if no contact was found, but any unexpected errors will otherwise be returned
1831
+ directly.
1832
+ """
1833
+ return Contact(handle=_whatsapp.whatsapp_Session_FindContact(self.handle, phone))
1834
+ def RequestMessageHistory(self, resourceID, oldestMessage):
1835
+ """RequestMessageHistory(str resourceID, object oldestMessage) str
1836
+
1837
+ RequestMessageHistory sends and asynchronous request for message history related to the given
1838
+ resource (e.g. Contact or Group JID), ending at the oldest message given. Messages returned from
1839
+ history should then be handled as a `HistorySync` event of type `ON_DEMAND`, in the session-wide
1840
+ event handler. An error will be returned if requesting history fails for any reason.
1841
+ """
1842
+ return _whatsapp.whatsapp_Session_RequestMessageHistory(self.handle, resourceID, oldestMessage.handle)
1843
+ def SetEventHandler(self, h, goRun=False):
1844
+ """SetEventHandler(callable h)
1845
+
1846
+ SetEventHandler assigns the given handler function for propagating internal events into the Python
1847
+ gateway. Note that the event handler function is not entirely safe to use directly, and all calls
1848
+ should instead be sent to the [Gateway] via its internal call channel.
1849
+ """
1850
+ _whatsapp.whatsapp_Session_SetEventHandler(self.handle, h, goRun)
1851
+
1852
+ # Python type for struct whatsapp.ChatState
1853
+ class ChatState(go.GoClass):
1854
+ """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"""
1855
+ def __init__(self, *args, **kwargs):
1856
+ """
1857
+ handle=A Go-side object is always initialized with an explicit handle=arg
1858
+ otherwise parameters can be unnamed in order of field names or named fields
1859
+ in which case a new Go object is constructed first
1860
+ """
1861
+ if len(kwargs) == 1 and 'handle' in kwargs:
1862
+ self.handle = kwargs['handle']
1863
+ _whatsapp.IncRef(self.handle)
1864
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1865
+ self.handle = args[0].handle
1866
+ _whatsapp.IncRef(self.handle)
1867
+ else:
1868
+ self.handle = _whatsapp.whatsapp_ChatState_CTor()
1869
+ _whatsapp.IncRef(self.handle)
1870
+ if 0 < len(args):
1871
+ self.Kind = args[0]
1872
+ if "Kind" in kwargs:
1873
+ self.Kind = kwargs["Kind"]
1874
+ if 1 < len(args):
1875
+ self.JID = args[1]
1876
+ if "JID" in kwargs:
1877
+ self.JID = kwargs["JID"]
1878
+ if 2 < len(args):
1879
+ self.GroupJID = args[2]
1880
+ if "GroupJID" in kwargs:
1881
+ self.GroupJID = kwargs["GroupJID"]
1882
+ def __del__(self):
1883
+ _whatsapp.DecRef(self.handle)
1884
+ def __str__(self):
1885
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1886
+ sv = 'whatsapp.ChatState{'
1887
+ first = True
1888
+ for v in pr:
1889
+ if callable(v[1]):
1890
+ continue
1891
+ if first:
1892
+ first = False
1893
+ else:
1894
+ sv += ', '
1895
+ sv += v[0] + '=' + str(v[1])
1896
+ return sv + '}'
1897
+ def __repr__(self):
1898
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1899
+ sv = 'whatsapp.ChatState ( '
1900
+ for v in pr:
1901
+ if not callable(v[1]):
1902
+ sv += v[0] + '=' + str(v[1]) + ', '
1903
+ return sv + ')'
1904
+ @property
1905
+ def Kind(self):
1906
+ return _whatsapp.whatsapp_ChatState_Kind_Get(self.handle)
1907
+ @Kind.setter
1908
+ def Kind(self, value):
1909
+ if isinstance(value, go.GoClass):
1910
+ _whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value.handle)
1911
+ else:
1912
+ _whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value)
1913
+ @property
1914
+ def JID(self):
1915
+ return _whatsapp.whatsapp_ChatState_JID_Get(self.handle)
1916
+ @JID.setter
1917
+ def JID(self, value):
1918
+ if isinstance(value, go.GoClass):
1919
+ _whatsapp.whatsapp_ChatState_JID_Set(self.handle, value.handle)
1920
+ else:
1921
+ _whatsapp.whatsapp_ChatState_JID_Set(self.handle, value)
1922
+ @property
1923
+ def GroupJID(self):
1924
+ return _whatsapp.whatsapp_ChatState_GroupJID_Get(self.handle)
1925
+ @GroupJID.setter
1926
+ def GroupJID(self, value):
1927
+ if isinstance(value, go.GoClass):
1928
+ _whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value.handle)
1929
+ else:
1930
+ _whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value)
1931
+
1932
+ # Python type for struct whatsapp.Contact
1933
+ class Contact(go.GoClass):
1934
+ """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"""
1935
+ def __init__(self, *args, **kwargs):
1936
+ """
1937
+ handle=A Go-side object is always initialized with an explicit handle=arg
1938
+ otherwise parameters can be unnamed in order of field names or named fields
1939
+ in which case a new Go object is constructed first
1940
+ """
1941
+ if len(kwargs) == 1 and 'handle' in kwargs:
1942
+ self.handle = kwargs['handle']
1943
+ _whatsapp.IncRef(self.handle)
1944
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1945
+ self.handle = args[0].handle
1946
+ _whatsapp.IncRef(self.handle)
1947
+ else:
1948
+ self.handle = _whatsapp.whatsapp_Contact_CTor()
1949
+ _whatsapp.IncRef(self.handle)
1950
+ if 0 < len(args):
1951
+ self.JID = args[0]
1952
+ if "JID" in kwargs:
1953
+ self.JID = kwargs["JID"]
1954
+ if 1 < len(args):
1955
+ self.Name = args[1]
1956
+ if "Name" in kwargs:
1957
+ self.Name = kwargs["Name"]
1958
+ def __del__(self):
1959
+ _whatsapp.DecRef(self.handle)
1960
+ def __str__(self):
1961
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1962
+ sv = 'whatsapp.Contact{'
1963
+ first = True
1964
+ for v in pr:
1965
+ if callable(v[1]):
1966
+ continue
1967
+ if first:
1968
+ first = False
1969
+ else:
1970
+ sv += ', '
1971
+ sv += v[0] + '=' + str(v[1])
1972
+ return sv + '}'
1973
+ def __repr__(self):
1974
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1975
+ sv = 'whatsapp.Contact ( '
1976
+ for v in pr:
1977
+ if not callable(v[1]):
1978
+ sv += v[0] + '=' + str(v[1]) + ', '
1979
+ return sv + ')'
1980
+ @property
1981
+ def JID(self):
1982
+ return _whatsapp.whatsapp_Contact_JID_Get(self.handle)
1983
+ @JID.setter
1984
+ def JID(self, value):
1985
+ if isinstance(value, go.GoClass):
1986
+ _whatsapp.whatsapp_Contact_JID_Set(self.handle, value.handle)
1987
+ else:
1988
+ _whatsapp.whatsapp_Contact_JID_Set(self.handle, value)
1989
+ @property
1990
+ def Name(self):
1991
+ return _whatsapp.whatsapp_Contact_Name_Get(self.handle)
1992
+ @Name.setter
1993
+ def Name(self, value):
1994
+ if isinstance(value, go.GoClass):
1995
+ _whatsapp.whatsapp_Contact_Name_Set(self.handle, value.handle)
1996
+ else:
1997
+ _whatsapp.whatsapp_Contact_Name_Set(self.handle, value)
1998
+
1999
+ # Python type for struct whatsapp.Group
2000
+ class Group(go.GoClass):
2001
+ """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"""
2002
+ def __init__(self, *args, **kwargs):
2003
+ """
2004
+ handle=A Go-side object is always initialized with an explicit handle=arg
2005
+ otherwise parameters can be unnamed in order of field names or named fields
2006
+ in which case a new Go object is constructed first
2007
+ """
2008
+ if len(kwargs) == 1 and 'handle' in kwargs:
2009
+ self.handle = kwargs['handle']
2010
+ _whatsapp.IncRef(self.handle)
2011
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2012
+ self.handle = args[0].handle
2013
+ _whatsapp.IncRef(self.handle)
2014
+ else:
2015
+ self.handle = _whatsapp.whatsapp_Group_CTor()
2016
+ _whatsapp.IncRef(self.handle)
2017
+ if 0 < len(args):
2018
+ self.JID = args[0]
2019
+ if "JID" in kwargs:
2020
+ self.JID = kwargs["JID"]
2021
+ if 1 < len(args):
2022
+ self.Name = args[1]
2023
+ if "Name" in kwargs:
2024
+ self.Name = kwargs["Name"]
2025
+ if 2 < len(args):
2026
+ self.Subject = args[2]
2027
+ if "Subject" in kwargs:
2028
+ self.Subject = kwargs["Subject"]
2029
+ if 3 < len(args):
2030
+ self.Nickname = args[3]
2031
+ if "Nickname" in kwargs:
2032
+ self.Nickname = kwargs["Nickname"]
2033
+ if 4 < len(args):
2034
+ self.Participants = args[4]
2035
+ if "Participants" in kwargs:
2036
+ self.Participants = kwargs["Participants"]
2037
+ def __del__(self):
2038
+ _whatsapp.DecRef(self.handle)
2039
+ def __str__(self):
2040
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2041
+ sv = 'whatsapp.Group{'
2042
+ first = True
2043
+ for v in pr:
2044
+ if callable(v[1]):
2045
+ continue
2046
+ if first:
2047
+ first = False
2048
+ else:
2049
+ sv += ', '
2050
+ sv += v[0] + '=' + str(v[1])
2051
+ return sv + '}'
2052
+ def __repr__(self):
2053
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2054
+ sv = 'whatsapp.Group ( '
2055
+ for v in pr:
2056
+ if not callable(v[1]):
2057
+ sv += v[0] + '=' + str(v[1]) + ', '
2058
+ return sv + ')'
2059
+ @property
2060
+ def JID(self):
2061
+ return _whatsapp.whatsapp_Group_JID_Get(self.handle)
2062
+ @JID.setter
2063
+ def JID(self, value):
2064
+ if isinstance(value, go.GoClass):
2065
+ _whatsapp.whatsapp_Group_JID_Set(self.handle, value.handle)
2066
+ else:
2067
+ _whatsapp.whatsapp_Group_JID_Set(self.handle, value)
2068
+ @property
2069
+ def Name(self):
2070
+ return _whatsapp.whatsapp_Group_Name_Get(self.handle)
2071
+ @Name.setter
2072
+ def Name(self, value):
2073
+ if isinstance(value, go.GoClass):
2074
+ _whatsapp.whatsapp_Group_Name_Set(self.handle, value.handle)
2075
+ else:
2076
+ _whatsapp.whatsapp_Group_Name_Set(self.handle, value)
2077
+ @property
2078
+ def Subject(self):
2079
+ return GroupSubject(handle=_whatsapp.whatsapp_Group_Subject_Get(self.handle))
2080
+ @Subject.setter
2081
+ def Subject(self, value):
2082
+ if isinstance(value, go.GoClass):
2083
+ _whatsapp.whatsapp_Group_Subject_Set(self.handle, value.handle)
2084
+ else:
2085
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2086
+ @property
2087
+ def Nickname(self):
2088
+ return _whatsapp.whatsapp_Group_Nickname_Get(self.handle)
2089
+ @Nickname.setter
2090
+ def Nickname(self, value):
2091
+ if isinstance(value, go.GoClass):
2092
+ _whatsapp.whatsapp_Group_Nickname_Set(self.handle, value.handle)
2093
+ else:
2094
+ _whatsapp.whatsapp_Group_Nickname_Set(self.handle, value)
2095
+ @property
2096
+ def Participants(self):
2097
+ return Slice_whatsapp_GroupParticipant(handle=_whatsapp.whatsapp_Group_Participants_Get(self.handle))
2098
+ @Participants.setter
2099
+ def Participants(self, value):
2100
+ if isinstance(value, go.GoClass):
2101
+ _whatsapp.whatsapp_Group_Participants_Set(self.handle, value.handle)
2102
+ else:
2103
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2104
+
2105
+ # Python type for struct whatsapp.GroupSubject
2106
+ class GroupSubject(go.GoClass):
2107
+ """A GroupSubject represents the user-defined group description and attached metadata thereof, for a\ngiven [Group].\n"""
2108
+ def __init__(self, *args, **kwargs):
2109
+ """
2110
+ handle=A Go-side object is always initialized with an explicit handle=arg
2111
+ otherwise parameters can be unnamed in order of field names or named fields
2112
+ in which case a new Go object is constructed first
2113
+ """
2114
+ if len(kwargs) == 1 and 'handle' in kwargs:
2115
+ self.handle = kwargs['handle']
2116
+ _whatsapp.IncRef(self.handle)
2117
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2118
+ self.handle = args[0].handle
2119
+ _whatsapp.IncRef(self.handle)
2120
+ else:
2121
+ self.handle = _whatsapp.whatsapp_GroupSubject_CTor()
2122
+ _whatsapp.IncRef(self.handle)
2123
+ if 0 < len(args):
2124
+ self.Subject = args[0]
2125
+ if "Subject" in kwargs:
2126
+ self.Subject = kwargs["Subject"]
2127
+ if 1 < len(args):
2128
+ self.SetAt = args[1]
2129
+ if "SetAt" in kwargs:
2130
+ self.SetAt = kwargs["SetAt"]
2131
+ if 2 < len(args):
2132
+ self.SetByJID = args[2]
2133
+ if "SetByJID" in kwargs:
2134
+ self.SetByJID = kwargs["SetByJID"]
2135
+ def __del__(self):
2136
+ _whatsapp.DecRef(self.handle)
2137
+ def __str__(self):
2138
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2139
+ sv = 'whatsapp.GroupSubject{'
2140
+ first = True
2141
+ for v in pr:
2142
+ if callable(v[1]):
2143
+ continue
2144
+ if first:
2145
+ first = False
2146
+ else:
2147
+ sv += ', '
2148
+ sv += v[0] + '=' + str(v[1])
2149
+ return sv + '}'
2150
+ def __repr__(self):
2151
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2152
+ sv = 'whatsapp.GroupSubject ( '
2153
+ for v in pr:
2154
+ if not callable(v[1]):
2155
+ sv += v[0] + '=' + str(v[1]) + ', '
2156
+ return sv + ')'
2157
+ @property
2158
+ def Subject(self):
2159
+ return _whatsapp.whatsapp_GroupSubject_Subject_Get(self.handle)
2160
+ @Subject.setter
2161
+ def Subject(self, value):
2162
+ if isinstance(value, go.GoClass):
2163
+ _whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value.handle)
2164
+ else:
2165
+ _whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value)
2166
+ @property
2167
+ def SetAt(self):
2168
+ return _whatsapp.whatsapp_GroupSubject_SetAt_Get(self.handle)
2169
+ @SetAt.setter
2170
+ def SetAt(self, value):
2171
+ if isinstance(value, go.GoClass):
2172
+ _whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value.handle)
2173
+ else:
2174
+ _whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value)
2175
+ @property
2176
+ def SetByJID(self):
2177
+ return _whatsapp.whatsapp_GroupSubject_SetByJID_Get(self.handle)
2178
+ @SetByJID.setter
2179
+ def SetByJID(self, value):
2180
+ if isinstance(value, go.GoClass):
2181
+ _whatsapp.whatsapp_GroupSubject_SetByJID_Set(self.handle, value.handle)
2182
+ else:
2183
+ _whatsapp.whatsapp_GroupSubject_SetByJID_Set(self.handle, value)
2184
+
2185
+ # Python type for struct whatsapp.Receipt
2186
+ class Receipt(go.GoClass):
2187
+ """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"""
2188
+ def __init__(self, *args, **kwargs):
2189
+ """
2190
+ handle=A Go-side object is always initialized with an explicit handle=arg
2191
+ otherwise parameters can be unnamed in order of field names or named fields
2192
+ in which case a new Go object is constructed first
2193
+ """
2194
+ if len(kwargs) == 1 and 'handle' in kwargs:
2195
+ self.handle = kwargs['handle']
2196
+ _whatsapp.IncRef(self.handle)
2197
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2198
+ self.handle = args[0].handle
2199
+ _whatsapp.IncRef(self.handle)
2200
+ else:
2201
+ self.handle = _whatsapp.whatsapp_Receipt_CTor()
2202
+ _whatsapp.IncRef(self.handle)
2203
+ if 0 < len(args):
2204
+ self.Kind = args[0]
2205
+ if "Kind" in kwargs:
2206
+ self.Kind = kwargs["Kind"]
2207
+ if 1 < len(args):
2208
+ self.MessageIDs = args[1]
2209
+ if "MessageIDs" in kwargs:
2210
+ self.MessageIDs = kwargs["MessageIDs"]
2211
+ if 2 < len(args):
2212
+ self.JID = args[2]
2213
+ if "JID" in kwargs:
2214
+ self.JID = kwargs["JID"]
2215
+ if 3 < len(args):
2216
+ self.GroupJID = args[3]
2217
+ if "GroupJID" in kwargs:
2218
+ self.GroupJID = kwargs["GroupJID"]
2219
+ if 4 < len(args):
2220
+ self.Timestamp = args[4]
2221
+ if "Timestamp" in kwargs:
2222
+ self.Timestamp = kwargs["Timestamp"]
2223
+ if 5 < len(args):
2224
+ self.IsCarbon = args[5]
2225
+ if "IsCarbon" in kwargs:
2226
+ self.IsCarbon = kwargs["IsCarbon"]
2227
+ def __del__(self):
2228
+ _whatsapp.DecRef(self.handle)
2229
+ def __str__(self):
2230
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2231
+ sv = 'whatsapp.Receipt{'
2232
+ first = True
2233
+ for v in pr:
2234
+ if callable(v[1]):
2235
+ continue
2236
+ if first:
2237
+ first = False
2238
+ else:
2239
+ sv += ', '
2240
+ sv += v[0] + '=' + str(v[1])
2241
+ return sv + '}'
2242
+ def __repr__(self):
2243
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2244
+ sv = 'whatsapp.Receipt ( '
2245
+ for v in pr:
2246
+ if not callable(v[1]):
2247
+ sv += v[0] + '=' + str(v[1]) + ', '
2248
+ return sv + ')'
2249
+ @property
2250
+ def Kind(self):
2251
+ return _whatsapp.whatsapp_Receipt_Kind_Get(self.handle)
2252
+ @Kind.setter
2253
+ def Kind(self, value):
2254
+ if isinstance(value, go.GoClass):
2255
+ _whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value.handle)
2256
+ else:
2257
+ _whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value)
2258
+ @property
2259
+ def MessageIDs(self):
2260
+ return go.Slice_string(handle=_whatsapp.whatsapp_Receipt_MessageIDs_Get(self.handle))
2261
+ @MessageIDs.setter
2262
+ def MessageIDs(self, value):
2263
+ if isinstance(value, go.GoClass):
2264
+ _whatsapp.whatsapp_Receipt_MessageIDs_Set(self.handle, value.handle)
2265
+ else:
2266
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2267
+ @property
2268
+ def JID(self):
2269
+ return _whatsapp.whatsapp_Receipt_JID_Get(self.handle)
2270
+ @JID.setter
2271
+ def JID(self, value):
2272
+ if isinstance(value, go.GoClass):
2273
+ _whatsapp.whatsapp_Receipt_JID_Set(self.handle, value.handle)
2274
+ else:
2275
+ _whatsapp.whatsapp_Receipt_JID_Set(self.handle, value)
2276
+ @property
2277
+ def GroupJID(self):
2278
+ return _whatsapp.whatsapp_Receipt_GroupJID_Get(self.handle)
2279
+ @GroupJID.setter
2280
+ def GroupJID(self, value):
2281
+ if isinstance(value, go.GoClass):
2282
+ _whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value.handle)
2283
+ else:
2284
+ _whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value)
2285
+ @property
2286
+ def Timestamp(self):
2287
+ return _whatsapp.whatsapp_Receipt_Timestamp_Get(self.handle)
2288
+ @Timestamp.setter
2289
+ def Timestamp(self, value):
2290
+ if isinstance(value, go.GoClass):
2291
+ _whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value.handle)
2292
+ else:
2293
+ _whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value)
2294
+ @property
2295
+ def IsCarbon(self):
2296
+ return _whatsapp.whatsapp_Receipt_IsCarbon_Get(self.handle)
2297
+ @IsCarbon.setter
2298
+ def IsCarbon(self, value):
2299
+ if isinstance(value, go.GoClass):
2300
+ _whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value.handle)
2301
+ else:
2302
+ _whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value)
2303
+
2304
+ # Python type for struct whatsapp.Attachment
2305
+ class Attachment(go.GoClass):
2306
+ """A Attachment represents additional binary data (e.g. images, videos, documents) provided alongside\na message, for display or storage on the recepient client.\n"""
2307
+ def __init__(self, *args, **kwargs):
2308
+ """
2309
+ handle=A Go-side object is always initialized with an explicit handle=arg
2310
+ otherwise parameters can be unnamed in order of field names or named fields
2311
+ in which case a new Go object is constructed first
2312
+ """
2313
+ if len(kwargs) == 1 and 'handle' in kwargs:
2314
+ self.handle = kwargs['handle']
2315
+ _whatsapp.IncRef(self.handle)
2316
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2317
+ self.handle = args[0].handle
2318
+ _whatsapp.IncRef(self.handle)
2319
+ else:
2320
+ self.handle = _whatsapp.whatsapp_Attachment_CTor()
2321
+ _whatsapp.IncRef(self.handle)
2322
+ if 0 < len(args):
2323
+ self.MIME = args[0]
2324
+ if "MIME" in kwargs:
2325
+ self.MIME = kwargs["MIME"]
2326
+ if 1 < len(args):
2327
+ self.Filename = args[1]
2328
+ if "Filename" in kwargs:
2329
+ self.Filename = kwargs["Filename"]
2330
+ if 2 < len(args):
2331
+ self.Caption = args[2]
2332
+ if "Caption" in kwargs:
2333
+ self.Caption = kwargs["Caption"]
2334
+ if 3 < len(args):
2335
+ self.Data = args[3]
2336
+ if "Data" in kwargs:
2337
+ self.Data = kwargs["Data"]
2338
+ def __del__(self):
2339
+ _whatsapp.DecRef(self.handle)
2340
+ def __str__(self):
2341
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2342
+ sv = 'whatsapp.Attachment{'
2343
+ first = True
2344
+ for v in pr:
2345
+ if callable(v[1]):
2346
+ continue
2347
+ if first:
2348
+ first = False
2349
+ else:
2350
+ sv += ', '
2351
+ sv += v[0] + '=' + str(v[1])
2352
+ return sv + '}'
2353
+ def __repr__(self):
2354
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2355
+ sv = 'whatsapp.Attachment ( '
2356
+ for v in pr:
2357
+ if not callable(v[1]):
2358
+ sv += v[0] + '=' + str(v[1]) + ', '
2359
+ return sv + ')'
2360
+ @property
2361
+ def MIME(self):
2362
+ return _whatsapp.whatsapp_Attachment_MIME_Get(self.handle)
2363
+ @MIME.setter
2364
+ def MIME(self, value):
2365
+ if isinstance(value, go.GoClass):
2366
+ _whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value.handle)
2367
+ else:
2368
+ _whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value)
2369
+ @property
2370
+ def Filename(self):
2371
+ return _whatsapp.whatsapp_Attachment_Filename_Get(self.handle)
2372
+ @Filename.setter
2373
+ def Filename(self, value):
2374
+ if isinstance(value, go.GoClass):
2375
+ _whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value.handle)
2376
+ else:
2377
+ _whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value)
2378
+ @property
2379
+ def Caption(self):
2380
+ return _whatsapp.whatsapp_Attachment_Caption_Get(self.handle)
2381
+ @Caption.setter
2382
+ def Caption(self, value):
2383
+ if isinstance(value, go.GoClass):
2384
+ _whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value.handle)
2385
+ else:
2386
+ _whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value)
2387
+ @property
2388
+ def Data(self):
2389
+ return go.Slice_byte(handle=_whatsapp.whatsapp_Attachment_Data_Get(self.handle))
2390
+ @Data.setter
2391
+ def Data(self, value):
2392
+ if isinstance(value, go.GoClass):
2393
+ _whatsapp.whatsapp_Attachment_Data_Set(self.handle, value.handle)
2394
+ else:
2395
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2396
+ def GetSpec(self, ctx):
2397
+ """GetSpec(object ctx) object, str
2398
+
2399
+ GetSpec returns metadata for this attachment, as derived from the underlying attachment data.
2400
+ """
2401
+ return go.Ptr_media_Spec(handle=_whatsapp.whatsapp_Attachment_GetSpec(self.handle, ctx.handle))
2402
+
2403
+ # Python type for struct whatsapp.Call
2404
+ class Call(go.GoClass):
2405
+ """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"""
2406
+ def __init__(self, *args, **kwargs):
2407
+ """
2408
+ handle=A Go-side object is always initialized with an explicit handle=arg
2409
+ otherwise parameters can be unnamed in order of field names or named fields
2410
+ in which case a new Go object is constructed first
2411
+ """
2412
+ if len(kwargs) == 1 and 'handle' in kwargs:
2413
+ self.handle = kwargs['handle']
2414
+ _whatsapp.IncRef(self.handle)
2415
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2416
+ self.handle = args[0].handle
2417
+ _whatsapp.IncRef(self.handle)
2418
+ else:
2419
+ self.handle = _whatsapp.whatsapp_Call_CTor()
2420
+ _whatsapp.IncRef(self.handle)
2421
+ if 0 < len(args):
2422
+ self.State = args[0]
2423
+ if "State" in kwargs:
2424
+ self.State = kwargs["State"]
2425
+ if 1 < len(args):
2426
+ self.JID = args[1]
2427
+ if "JID" in kwargs:
2428
+ self.JID = kwargs["JID"]
2429
+ if 2 < len(args):
2430
+ self.Timestamp = args[2]
2431
+ if "Timestamp" in kwargs:
2432
+ self.Timestamp = kwargs["Timestamp"]
2433
+ def __del__(self):
2434
+ _whatsapp.DecRef(self.handle)
2435
+ def __str__(self):
2436
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2437
+ sv = 'whatsapp.Call{'
2438
+ first = True
2439
+ for v in pr:
2440
+ if callable(v[1]):
2441
+ continue
2442
+ if first:
2443
+ first = False
2444
+ else:
2445
+ sv += ', '
2446
+ sv += v[0] + '=' + str(v[1])
2447
+ return sv + '}'
2448
+ def __repr__(self):
2449
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2450
+ sv = 'whatsapp.Call ( '
2451
+ for v in pr:
2452
+ if not callable(v[1]):
2453
+ sv += v[0] + '=' + str(v[1]) + ', '
2454
+ return sv + ')'
2455
+ @property
2456
+ def State(self):
2457
+ return _whatsapp.whatsapp_Call_State_Get(self.handle)
2458
+ @State.setter
2459
+ def State(self, value):
2460
+ if isinstance(value, go.GoClass):
2461
+ _whatsapp.whatsapp_Call_State_Set(self.handle, value.handle)
2462
+ else:
2463
+ _whatsapp.whatsapp_Call_State_Set(self.handle, value)
2464
+ @property
2465
+ def JID(self):
2466
+ return _whatsapp.whatsapp_Call_JID_Get(self.handle)
2467
+ @JID.setter
2468
+ def JID(self, value):
2469
+ if isinstance(value, go.GoClass):
2470
+ _whatsapp.whatsapp_Call_JID_Set(self.handle, value.handle)
2471
+ else:
2472
+ _whatsapp.whatsapp_Call_JID_Set(self.handle, value)
2473
+ @property
2474
+ def Timestamp(self):
2475
+ return _whatsapp.whatsapp_Call_Timestamp_Get(self.handle)
2476
+ @Timestamp.setter
2477
+ def Timestamp(self, value):
2478
+ if isinstance(value, go.GoClass):
2479
+ _whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value.handle)
2480
+ else:
2481
+ _whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value)
2482
+
2483
+ # Python type for struct whatsapp.Connect
2484
+ class Connect(go.GoClass):
2485
+ """Connect represents event data related to a connection to WhatsApp being established, or failing\nto do so (based on the [Connect.Error] result).\n"""
2486
+ def __init__(self, *args, **kwargs):
2487
+ """
2488
+ handle=A Go-side object is always initialized with an explicit handle=arg
2489
+ otherwise parameters can be unnamed in order of field names or named fields
2490
+ in which case a new Go object is constructed first
2491
+ """
2492
+ if len(kwargs) == 1 and 'handle' in kwargs:
2493
+ self.handle = kwargs['handle']
2494
+ _whatsapp.IncRef(self.handle)
2495
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2496
+ self.handle = args[0].handle
2497
+ _whatsapp.IncRef(self.handle)
2498
+ else:
2499
+ self.handle = _whatsapp.whatsapp_Connect_CTor()
2500
+ _whatsapp.IncRef(self.handle)
2501
+ if 0 < len(args):
2502
+ self.JID = args[0]
2503
+ if "JID" in kwargs:
2504
+ self.JID = kwargs["JID"]
2505
+ if 1 < len(args):
2506
+ self.Error = args[1]
2507
+ if "Error" in kwargs:
2508
+ self.Error = kwargs["Error"]
2509
+ def __del__(self):
2510
+ _whatsapp.DecRef(self.handle)
2511
+ def __str__(self):
2512
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2513
+ sv = 'whatsapp.Connect{'
2514
+ first = True
2515
+ for v in pr:
2516
+ if callable(v[1]):
2517
+ continue
2518
+ if first:
2519
+ first = False
2520
+ else:
2521
+ sv += ', '
2522
+ sv += v[0] + '=' + str(v[1])
2523
+ return sv + '}'
2524
+ def __repr__(self):
2525
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2526
+ sv = 'whatsapp.Connect ( '
2527
+ for v in pr:
2528
+ if not callable(v[1]):
2529
+ sv += v[0] + '=' + str(v[1]) + ', '
2530
+ return sv + ')'
2531
+ @property
2532
+ def JID(self):
2533
+ return _whatsapp.whatsapp_Connect_JID_Get(self.handle)
2534
+ @JID.setter
2535
+ def JID(self, value):
2536
+ if isinstance(value, go.GoClass):
2537
+ _whatsapp.whatsapp_Connect_JID_Set(self.handle, value.handle)
2538
+ else:
2539
+ _whatsapp.whatsapp_Connect_JID_Set(self.handle, value)
2540
+ @property
2541
+ def Error(self):
2542
+ return _whatsapp.whatsapp_Connect_Error_Get(self.handle)
2543
+ @Error.setter
2544
+ def Error(self, value):
2545
+ if isinstance(value, go.GoClass):
2546
+ _whatsapp.whatsapp_Connect_Error_Set(self.handle, value.handle)
2547
+ else:
2548
+ _whatsapp.whatsapp_Connect_Error_Set(self.handle, value)
2549
+
2550
+ # Python type for struct whatsapp.GroupParticipant
2551
+ class GroupParticipant(go.GoClass):
2552
+ """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"""
2553
+ def __init__(self, *args, **kwargs):
2554
+ """
2555
+ handle=A Go-side object is always initialized with an explicit handle=arg
2556
+ otherwise parameters can be unnamed in order of field names or named fields
2557
+ in which case a new Go object is constructed first
2558
+ """
2559
+ if len(kwargs) == 1 and 'handle' in kwargs:
2560
+ self.handle = kwargs['handle']
2561
+ _whatsapp.IncRef(self.handle)
2562
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2563
+ self.handle = args[0].handle
2564
+ _whatsapp.IncRef(self.handle)
2565
+ else:
2566
+ self.handle = _whatsapp.whatsapp_GroupParticipant_CTor()
2567
+ _whatsapp.IncRef(self.handle)
2568
+ if 0 < len(args):
2569
+ self.JID = args[0]
2570
+ if "JID" in kwargs:
2571
+ self.JID = kwargs["JID"]
2572
+ if 1 < len(args):
2573
+ self.Affiliation = args[1]
2574
+ if "Affiliation" in kwargs:
2575
+ self.Affiliation = kwargs["Affiliation"]
2576
+ if 2 < len(args):
2577
+ self.Action = args[2]
2578
+ if "Action" in kwargs:
2579
+ self.Action = kwargs["Action"]
2580
+ def __del__(self):
2581
+ _whatsapp.DecRef(self.handle)
2582
+ def __str__(self):
2583
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2584
+ sv = 'whatsapp.GroupParticipant{'
2585
+ first = True
2586
+ for v in pr:
2587
+ if callable(v[1]):
2588
+ continue
2589
+ if first:
2590
+ first = False
2591
+ else:
2592
+ sv += ', '
2593
+ sv += v[0] + '=' + str(v[1])
2594
+ return sv + '}'
2595
+ def __repr__(self):
2596
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2597
+ sv = 'whatsapp.GroupParticipant ( '
2598
+ for v in pr:
2599
+ if not callable(v[1]):
2600
+ sv += v[0] + '=' + str(v[1]) + ', '
2601
+ return sv + ')'
2602
+ @property
2603
+ def JID(self):
2604
+ return _whatsapp.whatsapp_GroupParticipant_JID_Get(self.handle)
2605
+ @JID.setter
2606
+ def JID(self, value):
2607
+ if isinstance(value, go.GoClass):
2608
+ _whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value.handle)
2609
+ else:
2610
+ _whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value)
2611
+ @property
2612
+ def Affiliation(self):
2613
+ return _whatsapp.whatsapp_GroupParticipant_Affiliation_Get(self.handle)
2614
+ @Affiliation.setter
2615
+ def Affiliation(self, value):
2616
+ if isinstance(value, go.GoClass):
2617
+ _whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value.handle)
2618
+ else:
2619
+ _whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value)
2620
+ @property
2621
+ def Action(self):
2622
+ return _whatsapp.whatsapp_GroupParticipant_Action_Get(self.handle)
2623
+ @Action.setter
2624
+ def Action(self, value):
2625
+ if isinstance(value, go.GoClass):
2626
+ _whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value.handle)
2627
+ else:
2628
+ _whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value)
2629
+
2630
+ # Python type for struct whatsapp.Message
2631
+ class Message(go.GoClass):
2632
+ """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"""
2633
+ def __init__(self, *args, **kwargs):
2634
+ """
2635
+ handle=A Go-side object is always initialized with an explicit handle=arg
2636
+ otherwise parameters can be unnamed in order of field names or named fields
2637
+ in which case a new Go object is constructed first
2638
+ """
2639
+ if len(kwargs) == 1 and 'handle' in kwargs:
2640
+ self.handle = kwargs['handle']
2641
+ _whatsapp.IncRef(self.handle)
2642
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2643
+ self.handle = args[0].handle
2644
+ _whatsapp.IncRef(self.handle)
2645
+ else:
2646
+ self.handle = _whatsapp.whatsapp_Message_CTor()
2647
+ _whatsapp.IncRef(self.handle)
2648
+ if 0 < len(args):
2649
+ self.Kind = args[0]
2650
+ if "Kind" in kwargs:
2651
+ self.Kind = kwargs["Kind"]
2652
+ if 1 < len(args):
2653
+ self.ID = args[1]
2654
+ if "ID" in kwargs:
2655
+ self.ID = kwargs["ID"]
2656
+ if 2 < len(args):
2657
+ self.JID = args[2]
2658
+ if "JID" in kwargs:
2659
+ self.JID = kwargs["JID"]
2660
+ if 3 < len(args):
2661
+ self.GroupJID = args[3]
2662
+ if "GroupJID" in kwargs:
2663
+ self.GroupJID = kwargs["GroupJID"]
2664
+ if 4 < len(args):
2665
+ self.OriginJID = args[4]
2666
+ if "OriginJID" in kwargs:
2667
+ self.OriginJID = kwargs["OriginJID"]
2668
+ if 5 < len(args):
2669
+ self.Body = args[5]
2670
+ if "Body" in kwargs:
2671
+ self.Body = kwargs["Body"]
2672
+ if 6 < len(args):
2673
+ self.Timestamp = args[6]
2674
+ if "Timestamp" in kwargs:
2675
+ self.Timestamp = kwargs["Timestamp"]
2676
+ if 7 < len(args):
2677
+ self.IsCarbon = args[7]
2678
+ if "IsCarbon" in kwargs:
2679
+ self.IsCarbon = kwargs["IsCarbon"]
2680
+ if 8 < len(args):
2681
+ self.IsForwarded = args[8]
2682
+ if "IsForwarded" in kwargs:
2683
+ self.IsForwarded = kwargs["IsForwarded"]
2684
+ if 9 < len(args):
2685
+ self.ReplyID = args[9]
2686
+ if "ReplyID" in kwargs:
2687
+ self.ReplyID = kwargs["ReplyID"]
2688
+ if 10 < len(args):
2689
+ self.ReplyBody = args[10]
2690
+ if "ReplyBody" in kwargs:
2691
+ self.ReplyBody = kwargs["ReplyBody"]
2692
+ if 11 < len(args):
2693
+ self.Attachments = args[11]
2694
+ if "Attachments" in kwargs:
2695
+ self.Attachments = kwargs["Attachments"]
2696
+ if 12 < len(args):
2697
+ self.Preview = args[12]
2698
+ if "Preview" in kwargs:
2699
+ self.Preview = kwargs["Preview"]
2700
+ if 13 < len(args):
2701
+ self.Location = args[13]
2702
+ if "Location" in kwargs:
2703
+ self.Location = kwargs["Location"]
2704
+ if 14 < len(args):
2705
+ self.MentionJIDs = args[14]
2706
+ if "MentionJIDs" in kwargs:
2707
+ self.MentionJIDs = kwargs["MentionJIDs"]
2708
+ if 15 < len(args):
2709
+ self.Receipts = args[15]
2710
+ if "Receipts" in kwargs:
2711
+ self.Receipts = kwargs["Receipts"]
2712
+ if 16 < len(args):
2713
+ self.Reactions = args[16]
2714
+ if "Reactions" in kwargs:
2715
+ self.Reactions = kwargs["Reactions"]
2716
+ def __del__(self):
2717
+ _whatsapp.DecRef(self.handle)
2718
+ def __str__(self):
2719
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2720
+ sv = 'whatsapp.Message{'
2721
+ first = True
2722
+ for v in pr:
2723
+ if callable(v[1]):
2724
+ continue
2725
+ if first:
2726
+ first = False
2727
+ else:
2728
+ sv += ', '
2729
+ sv += v[0] + '=' + str(v[1])
2730
+ return sv + '}'
2731
+ def __repr__(self):
2732
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2733
+ sv = 'whatsapp.Message ( '
2734
+ for v in pr:
2735
+ if not callable(v[1]):
2736
+ sv += v[0] + '=' + str(v[1]) + ', '
2737
+ return sv + ')'
2738
+ @property
2739
+ def Kind(self):
2740
+ return _whatsapp.whatsapp_Message_Kind_Get(self.handle)
2741
+ @Kind.setter
2742
+ def Kind(self, value):
2743
+ if isinstance(value, go.GoClass):
2744
+ _whatsapp.whatsapp_Message_Kind_Set(self.handle, value.handle)
2745
+ else:
2746
+ _whatsapp.whatsapp_Message_Kind_Set(self.handle, value)
2747
+ @property
2748
+ def ID(self):
2749
+ return _whatsapp.whatsapp_Message_ID_Get(self.handle)
2750
+ @ID.setter
2751
+ def ID(self, value):
2752
+ if isinstance(value, go.GoClass):
2753
+ _whatsapp.whatsapp_Message_ID_Set(self.handle, value.handle)
2754
+ else:
2755
+ _whatsapp.whatsapp_Message_ID_Set(self.handle, value)
2756
+ @property
2757
+ def JID(self):
2758
+ return _whatsapp.whatsapp_Message_JID_Get(self.handle)
2759
+ @JID.setter
2760
+ def JID(self, value):
2761
+ if isinstance(value, go.GoClass):
2762
+ _whatsapp.whatsapp_Message_JID_Set(self.handle, value.handle)
2763
+ else:
2764
+ _whatsapp.whatsapp_Message_JID_Set(self.handle, value)
2765
+ @property
2766
+ def GroupJID(self):
2767
+ return _whatsapp.whatsapp_Message_GroupJID_Get(self.handle)
2768
+ @GroupJID.setter
2769
+ def GroupJID(self, value):
2770
+ if isinstance(value, go.GoClass):
2771
+ _whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value.handle)
2772
+ else:
2773
+ _whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value)
2774
+ @property
2775
+ def OriginJID(self):
2776
+ return _whatsapp.whatsapp_Message_OriginJID_Get(self.handle)
2777
+ @OriginJID.setter
2778
+ def OriginJID(self, value):
2779
+ if isinstance(value, go.GoClass):
2780
+ _whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value.handle)
2781
+ else:
2782
+ _whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value)
2783
+ @property
2784
+ def Body(self):
2785
+ return _whatsapp.whatsapp_Message_Body_Get(self.handle)
2786
+ @Body.setter
2787
+ def Body(self, value):
2788
+ if isinstance(value, go.GoClass):
2789
+ _whatsapp.whatsapp_Message_Body_Set(self.handle, value.handle)
2790
+ else:
2791
+ _whatsapp.whatsapp_Message_Body_Set(self.handle, value)
2792
+ @property
2793
+ def Timestamp(self):
2794
+ return _whatsapp.whatsapp_Message_Timestamp_Get(self.handle)
2795
+ @Timestamp.setter
2796
+ def Timestamp(self, value):
2797
+ if isinstance(value, go.GoClass):
2798
+ _whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value.handle)
2799
+ else:
2800
+ _whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value)
2801
+ @property
2802
+ def IsCarbon(self):
2803
+ return _whatsapp.whatsapp_Message_IsCarbon_Get(self.handle)
2804
+ @IsCarbon.setter
2805
+ def IsCarbon(self, value):
2806
+ if isinstance(value, go.GoClass):
2807
+ _whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value.handle)
2808
+ else:
2809
+ _whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value)
2810
+ @property
2811
+ def IsForwarded(self):
2812
+ return _whatsapp.whatsapp_Message_IsForwarded_Get(self.handle)
2813
+ @IsForwarded.setter
2814
+ def IsForwarded(self, value):
2815
+ if isinstance(value, go.GoClass):
2816
+ _whatsapp.whatsapp_Message_IsForwarded_Set(self.handle, value.handle)
2817
+ else:
2818
+ _whatsapp.whatsapp_Message_IsForwarded_Set(self.handle, value)
2819
+ @property
2820
+ def ReplyID(self):
2821
+ return _whatsapp.whatsapp_Message_ReplyID_Get(self.handle)
2822
+ @ReplyID.setter
2823
+ def ReplyID(self, value):
2824
+ if isinstance(value, go.GoClass):
2825
+ _whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value.handle)
2826
+ else:
2827
+ _whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value)
2828
+ @property
2829
+ def ReplyBody(self):
2830
+ return _whatsapp.whatsapp_Message_ReplyBody_Get(self.handle)
2831
+ @ReplyBody.setter
2832
+ def ReplyBody(self, value):
2833
+ if isinstance(value, go.GoClass):
2834
+ _whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value.handle)
2835
+ else:
2836
+ _whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value)
2837
+ @property
2838
+ def Attachments(self):
2839
+ return Slice_whatsapp_Attachment(handle=_whatsapp.whatsapp_Message_Attachments_Get(self.handle))
2840
+ @Attachments.setter
2841
+ def Attachments(self, value):
2842
+ if isinstance(value, go.GoClass):
2843
+ _whatsapp.whatsapp_Message_Attachments_Set(self.handle, value.handle)
2844
+ else:
2845
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2846
+ @property
2847
+ def Preview(self):
2848
+ return Preview(handle=_whatsapp.whatsapp_Message_Preview_Get(self.handle))
2849
+ @Preview.setter
2850
+ def Preview(self, value):
2851
+ if isinstance(value, go.GoClass):
2852
+ _whatsapp.whatsapp_Message_Preview_Set(self.handle, value.handle)
2853
+ else:
2854
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2855
+ @property
2856
+ def Location(self):
2857
+ return Location(handle=_whatsapp.whatsapp_Message_Location_Get(self.handle))
2858
+ @Location.setter
2859
+ def Location(self, value):
2860
+ if isinstance(value, go.GoClass):
2861
+ _whatsapp.whatsapp_Message_Location_Set(self.handle, value.handle)
2862
+ else:
2863
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2864
+ @property
2865
+ def MentionJIDs(self):
2866
+ return go.Slice_string(handle=_whatsapp.whatsapp_Message_MentionJIDs_Get(self.handle))
2867
+ @MentionJIDs.setter
2868
+ def MentionJIDs(self, value):
2869
+ if isinstance(value, go.GoClass):
2870
+ _whatsapp.whatsapp_Message_MentionJIDs_Set(self.handle, value.handle)
2871
+ else:
2872
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2873
+ @property
2874
+ def Receipts(self):
2875
+ return Slice_whatsapp_Receipt(handle=_whatsapp.whatsapp_Message_Receipts_Get(self.handle))
2876
+ @Receipts.setter
2877
+ def Receipts(self, value):
2878
+ if isinstance(value, go.GoClass):
2879
+ _whatsapp.whatsapp_Message_Receipts_Set(self.handle, value.handle)
2880
+ else:
2881
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2882
+ @property
2883
+ def Reactions(self):
2884
+ return Slice_whatsapp_Message(handle=_whatsapp.whatsapp_Message_Reactions_Get(self.handle))
2885
+ @Reactions.setter
2886
+ def Reactions(self, value):
2887
+ if isinstance(value, go.GoClass):
2888
+ _whatsapp.whatsapp_Message_Reactions_Set(self.handle, value.handle)
2889
+ else:
2890
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2891
+
2892
+
2893
+ # ---- Slices ---
2894
+
2895
+
2896
+ # ---- Maps ---
2897
+
2898
+
2899
+ # ---- Constructors ---
2900
+ def NewGateway():
2901
+ """NewGateway() object
2902
+
2903
+ NewGateway returns a new, un-initialized Gateway. This function should always be followed by calls
2904
+ to [Gateway.Init], assuming a valid [Gateway.DBPath] is set.
2905
+ """
2906
+ return Gateway(handle=_whatsapp.whatsapp_NewGateway())
2907
+
2908
+
2909
+ # ---- Functions ---
2910
+
2911
+