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