slidge-whatsapp 0.2.2__cp313-cp313-manylinux_2_36_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of slidge-whatsapp might be problematic. Click here for more details.

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