slidge-whatsapp 0.2.2__cp313-cp313-manylinux_2_36_x86_64.whl

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