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