slidge-whatsapp 0.3.1__cp313-cp313-manylinux_2_36_aarch64.whl → 0.3.4__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.

Files changed (74) hide show
  1. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.h +175 -175
  2. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.so +0 -0
  3. slidge_whatsapp/generated/build.py +141 -141
  4. slidge_whatsapp/generated/go.py +1 -1
  5. slidge_whatsapp/generated/whatsapp.c +1423 -1423
  6. slidge_whatsapp/generated/whatsapp.go +1230 -1230
  7. slidge_whatsapp/generated/whatsapp.py +1337 -1337
  8. slidge_whatsapp/generated/whatsapp_go.h +175 -175
  9. slidge_whatsapp/go.mod +9 -9
  10. slidge_whatsapp/go.sum +18 -18
  11. slidge_whatsapp/vendor/go.mau.fi/libsignal/session/SessionCipher.go +7 -2
  12. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/module.go +2 -1
  13. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgradetable.go +3 -0
  14. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncmap.go +48 -7
  15. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncset.go +13 -0
  16. slidge_whatsapp/vendor/go.mau.fi/util/jsontime/helpers.go +16 -5
  17. slidge_whatsapp/vendor/go.mau.fi/util/jsontime/integer.go +27 -12
  18. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/encode.go +39 -28
  19. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +17 -2
  20. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +2 -1
  21. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +18 -6
  22. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +40 -16
  23. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair.go +24 -21
  24. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/prekeys.go +21 -0
  25. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +3213 -2851
  26. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +108 -74
  27. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +7 -3
  28. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +1 -0
  29. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +7 -3
  30. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +1 -0
  31. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +35 -23
  32. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +5 -3
  33. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +47 -16
  34. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +4 -10
  35. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +28 -42
  36. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +33 -32
  37. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +1 -1
  38. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +5 -1
  39. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sessioncache.go +125 -0
  40. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/signal.go +8 -0
  41. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +34 -11
  42. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +5 -3
  43. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +24 -9
  44. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +12 -1
  45. slidge_whatsapp/vendor/golang.org/x/crypto/curve25519/curve25519.go +7 -4
  46. slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +11 -6
  47. slidge_whatsapp/vendor/golang.org/x/net/http2/config_go125.go +15 -0
  48. slidge_whatsapp/vendor/golang.org/x/net/http2/config_go126.go +15 -0
  49. slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +24 -1
  50. slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +0 -1
  51. slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +35 -26
  52. slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +4 -2
  53. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched.go +2 -0
  54. slidge_whatsapp/vendor/golang.org/x/net/http2/{writesched_priority.go → writesched_priority_rfc7540.go} +52 -52
  55. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_priority_rfc9128.go +209 -0
  56. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_roundrobin.go +1 -1
  57. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/request.go +2 -2
  58. slidge_whatsapp/vendor/golang.org/x/net/internal/socks/socks.go +1 -1
  59. slidge_whatsapp/vendor/golang.org/x/sys/unix/affinity_linux.go +9 -0
  60. slidge_whatsapp/vendor/golang.org/x/sys/unix/fdset.go +1 -3
  61. slidge_whatsapp/vendor/golang.org/x/sys/unix/ifreq_linux.go +1 -3
  62. slidge_whatsapp/vendor/golang.org/x/sys/unix/mkall.sh +1 -0
  63. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux.go +1 -3
  64. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_netbsd.go +17 -0
  65. slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall_windows.go +2 -0
  66. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +16 -0
  67. slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +18 -0
  68. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/core.go +2 -9
  69. slidge_whatsapp/vendor/modules.txt +10 -10
  70. {slidge_whatsapp-0.3.1.dist-info → slidge_whatsapp-0.3.4.dist-info}/METADATA +1 -1
  71. {slidge_whatsapp-0.3.1.dist-info → slidge_whatsapp-0.3.4.dist-info}/RECORD +74 -70
  72. {slidge_whatsapp-0.3.1.dist-info → slidge_whatsapp-0.3.4.dist-info}/WHEEL +0 -0
  73. {slidge_whatsapp-0.3.1.dist-info → slidge_whatsapp-0.3.4.dist-info}/entry_points.txt +0 -0
  74. {slidge_whatsapp-0.3.1.dist-info → slidge_whatsapp-0.3.4.dist-info}/licenses/LICENSE +0 -0
@@ -2,7 +2,7 @@
2
2
  # python wrapper for package codeberg.org/slidge/slidge-whatsapp/slidge_whatsapp within overall package whatsapp
3
3
  # This is what you import to use the package.
4
4
  # File is generated by gopy. Do not edit.
5
- # gopy build -output=generated -no-make=true -build-tags="mupdf extlib static" .
5
+ # gopy build -output=generated -no-make=true -build-tags="mupdf extlib" .
6
6
 
7
7
  # the following is required to enable dlopen to open the _go.so file
8
8
  import os,sys,inspect,collections
@@ -1013,9 +1013,9 @@ DefaultUserServer = "s.whatsapp.net"
1013
1013
 
1014
1014
  # ---- Structs ---
1015
1015
 
1016
- # Python type for struct whatsapp.Call
1017
- class Call(go.GoClass):
1018
- """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"""
1016
+ # Python type for struct whatsapp.Receipt
1017
+ class Receipt(go.GoClass):
1018
+ """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"""
1019
1019
  def __init__(self, *args, **kwargs):
1020
1020
  """
1021
1021
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1029,25 +1029,37 @@ class Call(go.GoClass):
1029
1029
  self.handle = args[0].handle
1030
1030
  _whatsapp.IncRef(self.handle)
1031
1031
  else:
1032
- self.handle = _whatsapp.whatsapp_Call_CTor()
1032
+ self.handle = _whatsapp.whatsapp_Receipt_CTor()
1033
1033
  _whatsapp.IncRef(self.handle)
1034
1034
  if 0 < len(args):
1035
- self.State = args[0]
1036
- if "State" in kwargs:
1037
- self.State = kwargs["State"]
1035
+ self.Kind = args[0]
1036
+ if "Kind" in kwargs:
1037
+ self.Kind = kwargs["Kind"]
1038
1038
  if 1 < len(args):
1039
- self.JID = args[1]
1039
+ self.MessageIDs = args[1]
1040
+ if "MessageIDs" in kwargs:
1041
+ self.MessageIDs = kwargs["MessageIDs"]
1042
+ if 2 < len(args):
1043
+ self.JID = args[2]
1040
1044
  if "JID" in kwargs:
1041
1045
  self.JID = kwargs["JID"]
1042
- if 2 < len(args):
1043
- self.Timestamp = args[2]
1046
+ if 3 < len(args):
1047
+ self.GroupJID = args[3]
1048
+ if "GroupJID" in kwargs:
1049
+ self.GroupJID = kwargs["GroupJID"]
1050
+ if 4 < len(args):
1051
+ self.Timestamp = args[4]
1044
1052
  if "Timestamp" in kwargs:
1045
1053
  self.Timestamp = kwargs["Timestamp"]
1054
+ if 5 < len(args):
1055
+ self.IsCarbon = args[5]
1056
+ if "IsCarbon" in kwargs:
1057
+ self.IsCarbon = kwargs["IsCarbon"]
1046
1058
  def __del__(self):
1047
1059
  _whatsapp.DecRef(self.handle)
1048
1060
  def __str__(self):
1049
1061
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1050
- sv = 'whatsapp.Call{'
1062
+ sv = 'whatsapp.Receipt{'
1051
1063
  first = True
1052
1064
  for v in pr:
1053
1065
  if callable(v[1]):
@@ -1060,189 +1072,69 @@ class Call(go.GoClass):
1060
1072
  return sv + '}'
1061
1073
  def __repr__(self):
1062
1074
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1063
- sv = 'whatsapp.Call ( '
1075
+ sv = 'whatsapp.Receipt ( '
1064
1076
  for v in pr:
1065
1077
  if not callable(v[1]):
1066
1078
  sv += v[0] + '=' + str(v[1]) + ', '
1067
1079
  return sv + ')'
1068
1080
  @property
1069
- def State(self):
1070
- return _whatsapp.whatsapp_Call_State_Get(self.handle)
1071
- @State.setter
1072
- def State(self, value):
1073
- if isinstance(value, go.GoClass):
1074
- _whatsapp.whatsapp_Call_State_Set(self.handle, value.handle)
1075
- else:
1076
- _whatsapp.whatsapp_Call_State_Set(self.handle, value)
1077
- @property
1078
- def JID(self):
1079
- return _whatsapp.whatsapp_Call_JID_Get(self.handle)
1080
- @JID.setter
1081
- def JID(self, value):
1081
+ def Kind(self):
1082
+ return _whatsapp.whatsapp_Receipt_Kind_Get(self.handle)
1083
+ @Kind.setter
1084
+ def Kind(self, value):
1082
1085
  if isinstance(value, go.GoClass):
1083
- _whatsapp.whatsapp_Call_JID_Set(self.handle, value.handle)
1086
+ _whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value.handle)
1084
1087
  else:
1085
- _whatsapp.whatsapp_Call_JID_Set(self.handle, value)
1088
+ _whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value)
1086
1089
  @property
1087
- def Timestamp(self):
1088
- return _whatsapp.whatsapp_Call_Timestamp_Get(self.handle)
1089
- @Timestamp.setter
1090
- def Timestamp(self, value):
1090
+ def MessageIDs(self):
1091
+ return go.Slice_string(handle=_whatsapp.whatsapp_Receipt_MessageIDs_Get(self.handle))
1092
+ @MessageIDs.setter
1093
+ def MessageIDs(self, value):
1091
1094
  if isinstance(value, go.GoClass):
1092
- _whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value.handle)
1093
- else:
1094
- _whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value)
1095
-
1096
- # Python type for struct whatsapp.Contact
1097
- class Contact(go.GoClass):
1098
- """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"""
1099
- def __init__(self, *args, **kwargs):
1100
- """
1101
- handle=A Go-side object is always initialized with an explicit handle=arg
1102
- otherwise parameters can be unnamed in order of field names or named fields
1103
- in which case a new Go object is constructed first
1104
- """
1105
- if len(kwargs) == 1 and 'handle' in kwargs:
1106
- self.handle = kwargs['handle']
1107
- _whatsapp.IncRef(self.handle)
1108
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1109
- self.handle = args[0].handle
1110
- _whatsapp.IncRef(self.handle)
1095
+ _whatsapp.whatsapp_Receipt_MessageIDs_Set(self.handle, value.handle)
1111
1096
  else:
1112
- self.handle = _whatsapp.whatsapp_Contact_CTor()
1113
- _whatsapp.IncRef(self.handle)
1114
- if 0 < len(args):
1115
- self.JID = args[0]
1116
- if "JID" in kwargs:
1117
- self.JID = kwargs["JID"]
1118
- if 1 < len(args):
1119
- self.Name = args[1]
1120
- if "Name" in kwargs:
1121
- self.Name = kwargs["Name"]
1122
- def __del__(self):
1123
- _whatsapp.DecRef(self.handle)
1124
- def __str__(self):
1125
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1126
- sv = 'whatsapp.Contact{'
1127
- first = True
1128
- for v in pr:
1129
- if callable(v[1]):
1130
- continue
1131
- if first:
1132
- first = False
1133
- else:
1134
- sv += ', '
1135
- sv += v[0] + '=' + str(v[1])
1136
- return sv + '}'
1137
- def __repr__(self):
1138
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1139
- sv = 'whatsapp.Contact ( '
1140
- for v in pr:
1141
- if not callable(v[1]):
1142
- sv += v[0] + '=' + str(v[1]) + ', '
1143
- return sv + ')'
1097
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1144
1098
  @property
1145
1099
  def JID(self):
1146
- return _whatsapp.whatsapp_Contact_JID_Get(self.handle)
1100
+ return _whatsapp.whatsapp_Receipt_JID_Get(self.handle)
1147
1101
  @JID.setter
1148
1102
  def JID(self, value):
1149
1103
  if isinstance(value, go.GoClass):
1150
- _whatsapp.whatsapp_Contact_JID_Set(self.handle, value.handle)
1151
- else:
1152
- _whatsapp.whatsapp_Contact_JID_Set(self.handle, value)
1153
- @property
1154
- def Name(self):
1155
- return _whatsapp.whatsapp_Contact_Name_Get(self.handle)
1156
- @Name.setter
1157
- def Name(self, value):
1158
- if isinstance(value, go.GoClass):
1159
- _whatsapp.whatsapp_Contact_Name_Set(self.handle, value.handle)
1160
- else:
1161
- _whatsapp.whatsapp_Contact_Name_Set(self.handle, value)
1162
-
1163
- # Python type for struct whatsapp.GroupSubject
1164
- class GroupSubject(go.GoClass):
1165
- """A GroupSubject represents the user-defined group description and attached metadata thereof, for a\ngiven [Group].\n"""
1166
- def __init__(self, *args, **kwargs):
1167
- """
1168
- handle=A Go-side object is always initialized with an explicit handle=arg
1169
- otherwise parameters can be unnamed in order of field names or named fields
1170
- in which case a new Go object is constructed first
1171
- """
1172
- if len(kwargs) == 1 and 'handle' in kwargs:
1173
- self.handle = kwargs['handle']
1174
- _whatsapp.IncRef(self.handle)
1175
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1176
- self.handle = args[0].handle
1177
- _whatsapp.IncRef(self.handle)
1104
+ _whatsapp.whatsapp_Receipt_JID_Set(self.handle, value.handle)
1178
1105
  else:
1179
- self.handle = _whatsapp.whatsapp_GroupSubject_CTor()
1180
- _whatsapp.IncRef(self.handle)
1181
- if 0 < len(args):
1182
- self.Subject = args[0]
1183
- if "Subject" in kwargs:
1184
- self.Subject = kwargs["Subject"]
1185
- if 1 < len(args):
1186
- self.SetAt = args[1]
1187
- if "SetAt" in kwargs:
1188
- self.SetAt = kwargs["SetAt"]
1189
- if 2 < len(args):
1190
- self.SetBy = args[2]
1191
- if "SetBy" in kwargs:
1192
- self.SetBy = kwargs["SetBy"]
1193
- def __del__(self):
1194
- _whatsapp.DecRef(self.handle)
1195
- def __str__(self):
1196
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1197
- sv = 'whatsapp.GroupSubject{'
1198
- first = True
1199
- for v in pr:
1200
- if callable(v[1]):
1201
- continue
1202
- if first:
1203
- first = False
1204
- else:
1205
- sv += ', '
1206
- sv += v[0] + '=' + str(v[1])
1207
- return sv + '}'
1208
- def __repr__(self):
1209
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1210
- sv = 'whatsapp.GroupSubject ( '
1211
- for v in pr:
1212
- if not callable(v[1]):
1213
- sv += v[0] + '=' + str(v[1]) + ', '
1214
- return sv + ')'
1106
+ _whatsapp.whatsapp_Receipt_JID_Set(self.handle, value)
1215
1107
  @property
1216
- def Subject(self):
1217
- return _whatsapp.whatsapp_GroupSubject_Subject_Get(self.handle)
1218
- @Subject.setter
1219
- def Subject(self, value):
1108
+ def GroupJID(self):
1109
+ return _whatsapp.whatsapp_Receipt_GroupJID_Get(self.handle)
1110
+ @GroupJID.setter
1111
+ def GroupJID(self, value):
1220
1112
  if isinstance(value, go.GoClass):
1221
- _whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value.handle)
1113
+ _whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value.handle)
1222
1114
  else:
1223
- _whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value)
1115
+ _whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value)
1224
1116
  @property
1225
- def SetAt(self):
1226
- return _whatsapp.whatsapp_GroupSubject_SetAt_Get(self.handle)
1227
- @SetAt.setter
1228
- def SetAt(self, value):
1117
+ def Timestamp(self):
1118
+ return _whatsapp.whatsapp_Receipt_Timestamp_Get(self.handle)
1119
+ @Timestamp.setter
1120
+ def Timestamp(self, value):
1229
1121
  if isinstance(value, go.GoClass):
1230
- _whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value.handle)
1122
+ _whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value.handle)
1231
1123
  else:
1232
- _whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value)
1124
+ _whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value)
1233
1125
  @property
1234
- def SetBy(self):
1235
- return _whatsapp.whatsapp_GroupSubject_SetBy_Get(self.handle)
1236
- @SetBy.setter
1237
- def SetBy(self, value):
1126
+ def IsCarbon(self):
1127
+ return _whatsapp.whatsapp_Receipt_IsCarbon_Get(self.handle)
1128
+ @IsCarbon.setter
1129
+ def IsCarbon(self, value):
1238
1130
  if isinstance(value, go.GoClass):
1239
- _whatsapp.whatsapp_GroupSubject_SetBy_Set(self.handle, value.handle)
1131
+ _whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value.handle)
1240
1132
  else:
1241
- _whatsapp.whatsapp_GroupSubject_SetBy_Set(self.handle, value)
1133
+ _whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value)
1242
1134
 
1243
- # Python type for struct whatsapp.LinkedDevice
1244
- class LinkedDevice(go.GoClass):
1245
- """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"""
1135
+ # Python type for struct whatsapp.Session
1136
+ class Session(go.GoClass):
1137
+ """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"""
1246
1138
  def __init__(self, *args, **kwargs):
1247
1139
  """
1248
1140
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1256,17 +1148,13 @@ class LinkedDevice(go.GoClass):
1256
1148
  self.handle = args[0].handle
1257
1149
  _whatsapp.IncRef(self.handle)
1258
1150
  else:
1259
- self.handle = _whatsapp.whatsapp_LinkedDevice_CTor()
1151
+ self.handle = _whatsapp.whatsapp_Session_CTor()
1260
1152
  _whatsapp.IncRef(self.handle)
1261
- if 0 < len(args):
1262
- self.ID = args[0]
1263
- if "ID" in kwargs:
1264
- self.ID = kwargs["ID"]
1265
1153
  def __del__(self):
1266
1154
  _whatsapp.DecRef(self.handle)
1267
1155
  def __str__(self):
1268
1156
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1269
- sv = 'whatsapp.LinkedDevice{'
1157
+ sv = 'whatsapp.Session{'
1270
1158
  first = True
1271
1159
  for v in pr:
1272
1160
  if callable(v[1]):
@@ -1279,348 +1167,167 @@ class LinkedDevice(go.GoClass):
1279
1167
  return sv + '}'
1280
1168
  def __repr__(self):
1281
1169
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1282
- sv = 'whatsapp.LinkedDevice ( '
1170
+ sv = 'whatsapp.Session ( '
1283
1171
  for v in pr:
1284
1172
  if not callable(v[1]):
1285
1173
  sv += v[0] + '=' + str(v[1]) + ', '
1286
1174
  return sv + ')'
1287
- @property
1288
- def ID(self):
1289
- """ID is an opaque string identifying this LinkedDevice to the Session. Noted that this string
1290
- is currently equivalent to a password, and needs to be protected accordingly.
1291
- """
1292
- return _whatsapp.whatsapp_LinkedDevice_ID_Get(self.handle)
1293
- @ID.setter
1294
- def ID(self, value):
1295
- if isinstance(value, go.GoClass):
1296
- _whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value.handle)
1297
- else:
1298
- _whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value)
1299
- def JID(self):
1300
- """JID() object
1175
+ def Login(self):
1176
+ """Login() str
1301
1177
 
1302
- JID returns the WhatsApp JID corresponding to the LinkedDevice ID. Empty or invalid device IDs
1303
- may return invalid JIDs, and this function does not handle errors.
1178
+ Login attempts to authenticate the given [Session], either by re-using the [LinkedDevice] attached
1179
+ or by initiating a pairing session for a new linked device. Callers are expected to have set an
1180
+ event handler in order to receive any incoming events from the underlying WhatsApp session.
1304
1181
  """
1305
- return go.types_JID(handle=_whatsapp.whatsapp_LinkedDevice_JID(self.handle))
1306
-
1307
- # Python type for struct whatsapp.Message
1308
- class Message(go.GoClass):
1309
- """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"""
1310
- def __init__(self, *args, **kwargs):
1182
+ return _whatsapp.whatsapp_Session_Login(self.handle)
1183
+ def Logout(self):
1184
+ """Logout() str
1185
+
1186
+ Logout disconnects and removes the current linked device locally and initiates a logout remotely.
1311
1187
  """
1312
- handle=A Go-side object is always initialized with an explicit handle=arg
1313
- otherwise parameters can be unnamed in order of field names or named fields
1314
- in which case a new Go object is constructed first
1188
+ return _whatsapp.whatsapp_Session_Logout(self.handle)
1189
+ def Disconnect(self):
1190
+ """Disconnect() str
1191
+
1192
+ Disconnects detaches the current connection to WhatsApp without removing any linked device state.
1315
1193
  """
1316
- if len(kwargs) == 1 and 'handle' in kwargs:
1317
- self.handle = kwargs['handle']
1318
- _whatsapp.IncRef(self.handle)
1319
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1320
- self.handle = args[0].handle
1321
- _whatsapp.IncRef(self.handle)
1322
- else:
1323
- self.handle = _whatsapp.whatsapp_Message_CTor()
1324
- _whatsapp.IncRef(self.handle)
1325
- if 0 < len(args):
1326
- self.Kind = args[0]
1327
- if "Kind" in kwargs:
1328
- self.Kind = kwargs["Kind"]
1329
- if 1 < len(args):
1330
- self.ID = args[1]
1331
- if "ID" in kwargs:
1332
- self.ID = kwargs["ID"]
1333
- if 2 < len(args):
1334
- self.JID = args[2]
1335
- if "JID" in kwargs:
1336
- self.JID = kwargs["JID"]
1337
- if 3 < len(args):
1338
- self.GroupJID = args[3]
1339
- if "GroupJID" in kwargs:
1340
- self.GroupJID = kwargs["GroupJID"]
1341
- if 4 < len(args):
1342
- self.OriginJID = args[4]
1343
- if "OriginJID" in kwargs:
1344
- self.OriginJID = kwargs["OriginJID"]
1345
- if 5 < len(args):
1346
- self.Body = args[5]
1347
- if "Body" in kwargs:
1348
- self.Body = kwargs["Body"]
1349
- if 6 < len(args):
1350
- self.Timestamp = args[6]
1351
- if "Timestamp" in kwargs:
1352
- self.Timestamp = kwargs["Timestamp"]
1353
- if 7 < len(args):
1354
- self.IsCarbon = args[7]
1355
- if "IsCarbon" in kwargs:
1356
- self.IsCarbon = kwargs["IsCarbon"]
1357
- if 8 < len(args):
1358
- self.IsForwarded = args[8]
1359
- if "IsForwarded" in kwargs:
1360
- self.IsForwarded = kwargs["IsForwarded"]
1361
- if 9 < len(args):
1362
- self.ReplyID = args[9]
1363
- if "ReplyID" in kwargs:
1364
- self.ReplyID = kwargs["ReplyID"]
1365
- if 10 < len(args):
1366
- self.ReplyBody = args[10]
1367
- if "ReplyBody" in kwargs:
1368
- self.ReplyBody = kwargs["ReplyBody"]
1369
- if 11 < len(args):
1370
- self.Attachments = args[11]
1371
- if "Attachments" in kwargs:
1372
- self.Attachments = kwargs["Attachments"]
1373
- if 12 < len(args):
1374
- self.Preview = args[12]
1375
- if "Preview" in kwargs:
1376
- self.Preview = kwargs["Preview"]
1377
- if 13 < len(args):
1378
- self.Location = args[13]
1379
- if "Location" in kwargs:
1380
- self.Location = kwargs["Location"]
1381
- if 14 < len(args):
1382
- self.Poll = args[14]
1383
- if "Poll" in kwargs:
1384
- self.Poll = kwargs["Poll"]
1385
- if 15 < len(args):
1386
- self.Album = args[15]
1387
- if "Album" in kwargs:
1388
- self.Album = kwargs["Album"]
1389
- if 16 < len(args):
1390
- self.GroupInvite = args[16]
1391
- if "GroupInvite" in kwargs:
1392
- self.GroupInvite = kwargs["GroupInvite"]
1393
- if 17 < len(args):
1394
- self.MentionJIDs = args[17]
1395
- if "MentionJIDs" in kwargs:
1396
- self.MentionJIDs = kwargs["MentionJIDs"]
1397
- if 18 < len(args):
1398
- self.Receipts = args[18]
1399
- if "Receipts" in kwargs:
1400
- self.Receipts = kwargs["Receipts"]
1401
- if 19 < len(args):
1402
- self.Reactions = args[19]
1403
- if "Reactions" in kwargs:
1404
- self.Reactions = kwargs["Reactions"]
1405
- if 20 < len(args):
1406
- self.IsHistory = args[20]
1407
- if "IsHistory" in kwargs:
1408
- self.IsHistory = kwargs["IsHistory"]
1409
- def __del__(self):
1410
- _whatsapp.DecRef(self.handle)
1411
- def __str__(self):
1412
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1413
- sv = 'whatsapp.Message{'
1414
- first = True
1415
- for v in pr:
1416
- if callable(v[1]):
1417
- continue
1418
- if first:
1419
- first = False
1420
- else:
1421
- sv += ', '
1422
- sv += v[0] + '=' + str(v[1])
1423
- return sv + '}'
1424
- def __repr__(self):
1425
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1426
- sv = 'whatsapp.Message ( '
1427
- for v in pr:
1428
- if not callable(v[1]):
1429
- sv += v[0] + '=' + str(v[1]) + ', '
1430
- return sv + ')'
1431
- @property
1432
- def Kind(self):
1433
- return _whatsapp.whatsapp_Message_Kind_Get(self.handle)
1434
- @Kind.setter
1435
- def Kind(self, value):
1436
- if isinstance(value, go.GoClass):
1437
- _whatsapp.whatsapp_Message_Kind_Set(self.handle, value.handle)
1438
- else:
1439
- _whatsapp.whatsapp_Message_Kind_Set(self.handle, value)
1440
- @property
1441
- def ID(self):
1442
- return _whatsapp.whatsapp_Message_ID_Get(self.handle)
1443
- @ID.setter
1444
- def ID(self, value):
1445
- if isinstance(value, go.GoClass):
1446
- _whatsapp.whatsapp_Message_ID_Set(self.handle, value.handle)
1447
- else:
1448
- _whatsapp.whatsapp_Message_ID_Set(self.handle, value)
1449
- @property
1450
- def JID(self):
1451
- return _whatsapp.whatsapp_Message_JID_Get(self.handle)
1452
- @JID.setter
1453
- def JID(self, value):
1454
- if isinstance(value, go.GoClass):
1455
- _whatsapp.whatsapp_Message_JID_Set(self.handle, value.handle)
1456
- else:
1457
- _whatsapp.whatsapp_Message_JID_Set(self.handle, value)
1458
- @property
1459
- def GroupJID(self):
1460
- return _whatsapp.whatsapp_Message_GroupJID_Get(self.handle)
1461
- @GroupJID.setter
1462
- def GroupJID(self, value):
1463
- if isinstance(value, go.GoClass):
1464
- _whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value.handle)
1465
- else:
1466
- _whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value)
1467
- @property
1468
- def OriginJID(self):
1469
- return _whatsapp.whatsapp_Message_OriginJID_Get(self.handle)
1470
- @OriginJID.setter
1471
- def OriginJID(self, value):
1472
- if isinstance(value, go.GoClass):
1473
- _whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value.handle)
1474
- else:
1475
- _whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value)
1476
- @property
1477
- def Body(self):
1478
- return _whatsapp.whatsapp_Message_Body_Get(self.handle)
1479
- @Body.setter
1480
- def Body(self, value):
1481
- if isinstance(value, go.GoClass):
1482
- _whatsapp.whatsapp_Message_Body_Set(self.handle, value.handle)
1483
- else:
1484
- _whatsapp.whatsapp_Message_Body_Set(self.handle, value)
1485
- @property
1486
- def Timestamp(self):
1487
- return _whatsapp.whatsapp_Message_Timestamp_Get(self.handle)
1488
- @Timestamp.setter
1489
- def Timestamp(self, value):
1490
- if isinstance(value, go.GoClass):
1491
- _whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value.handle)
1492
- else:
1493
- _whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value)
1494
- @property
1495
- def IsCarbon(self):
1496
- return _whatsapp.whatsapp_Message_IsCarbon_Get(self.handle)
1497
- @IsCarbon.setter
1498
- def IsCarbon(self, value):
1499
- if isinstance(value, go.GoClass):
1500
- _whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value.handle)
1501
- else:
1502
- _whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value)
1503
- @property
1504
- def IsForwarded(self):
1505
- return _whatsapp.whatsapp_Message_IsForwarded_Get(self.handle)
1506
- @IsForwarded.setter
1507
- def IsForwarded(self, value):
1508
- if isinstance(value, go.GoClass):
1509
- _whatsapp.whatsapp_Message_IsForwarded_Set(self.handle, value.handle)
1510
- else:
1511
- _whatsapp.whatsapp_Message_IsForwarded_Set(self.handle, value)
1512
- @property
1513
- def ReplyID(self):
1514
- return _whatsapp.whatsapp_Message_ReplyID_Get(self.handle)
1515
- @ReplyID.setter
1516
- def ReplyID(self, value):
1517
- if isinstance(value, go.GoClass):
1518
- _whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value.handle)
1519
- else:
1520
- _whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value)
1521
- @property
1522
- def ReplyBody(self):
1523
- return _whatsapp.whatsapp_Message_ReplyBody_Get(self.handle)
1524
- @ReplyBody.setter
1525
- def ReplyBody(self, value):
1526
- if isinstance(value, go.GoClass):
1527
- _whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value.handle)
1528
- else:
1529
- _whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value)
1530
- @property
1531
- def Attachments(self):
1532
- return Slice_whatsapp_Attachment(handle=_whatsapp.whatsapp_Message_Attachments_Get(self.handle))
1533
- @Attachments.setter
1534
- def Attachments(self, value):
1535
- if isinstance(value, go.GoClass):
1536
- _whatsapp.whatsapp_Message_Attachments_Set(self.handle, value.handle)
1537
- else:
1538
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1539
- @property
1540
- def Preview(self):
1541
- return Preview(handle=_whatsapp.whatsapp_Message_Preview_Get(self.handle))
1542
- @Preview.setter
1543
- def Preview(self, value):
1544
- if isinstance(value, go.GoClass):
1545
- _whatsapp.whatsapp_Message_Preview_Set(self.handle, value.handle)
1546
- else:
1547
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1548
- @property
1549
- def Location(self):
1550
- return Location(handle=_whatsapp.whatsapp_Message_Location_Get(self.handle))
1551
- @Location.setter
1552
- def Location(self, value):
1553
- if isinstance(value, go.GoClass):
1554
- _whatsapp.whatsapp_Message_Location_Set(self.handle, value.handle)
1555
- else:
1556
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1557
- @property
1558
- def Poll(self):
1559
- return Poll(handle=_whatsapp.whatsapp_Message_Poll_Get(self.handle))
1560
- @Poll.setter
1561
- def Poll(self, value):
1562
- if isinstance(value, go.GoClass):
1563
- _whatsapp.whatsapp_Message_Poll_Set(self.handle, value.handle)
1564
- else:
1565
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1566
- @property
1567
- def Album(self):
1568
- return Album(handle=_whatsapp.whatsapp_Message_Album_Get(self.handle))
1569
- @Album.setter
1570
- def Album(self, value):
1571
- if isinstance(value, go.GoClass):
1572
- _whatsapp.whatsapp_Message_Album_Set(self.handle, value.handle)
1573
- else:
1574
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1575
- @property
1576
- def GroupInvite(self):
1577
- return Group(handle=_whatsapp.whatsapp_Message_GroupInvite_Get(self.handle))
1578
- @GroupInvite.setter
1579
- def GroupInvite(self, value):
1580
- if isinstance(value, go.GoClass):
1581
- _whatsapp.whatsapp_Message_GroupInvite_Set(self.handle, value.handle)
1582
- else:
1583
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1584
- @property
1585
- def MentionJIDs(self):
1586
- return go.Slice_string(handle=_whatsapp.whatsapp_Message_MentionJIDs_Get(self.handle))
1587
- @MentionJIDs.setter
1588
- def MentionJIDs(self, value):
1589
- if isinstance(value, go.GoClass):
1590
- _whatsapp.whatsapp_Message_MentionJIDs_Set(self.handle, value.handle)
1591
- else:
1592
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1593
- @property
1594
- def Receipts(self):
1595
- return Slice_whatsapp_Receipt(handle=_whatsapp.whatsapp_Message_Receipts_Get(self.handle))
1596
- @Receipts.setter
1597
- def Receipts(self, value):
1598
- if isinstance(value, go.GoClass):
1599
- _whatsapp.whatsapp_Message_Receipts_Set(self.handle, value.handle)
1600
- else:
1601
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1602
- @property
1603
- def Reactions(self):
1604
- return Slice_whatsapp_Message(handle=_whatsapp.whatsapp_Message_Reactions_Get(self.handle))
1605
- @Reactions.setter
1606
- def Reactions(self, value):
1607
- if isinstance(value, go.GoClass):
1608
- _whatsapp.whatsapp_Message_Reactions_Set(self.handle, value.handle)
1609
- else:
1610
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1611
- @property
1612
- def IsHistory(self):
1613
- return _whatsapp.whatsapp_Message_IsHistory_Get(self.handle)
1614
- @IsHistory.setter
1615
- def IsHistory(self, value):
1616
- if isinstance(value, go.GoClass):
1617
- _whatsapp.whatsapp_Message_IsHistory_Set(self.handle, value.handle)
1618
- else:
1619
- _whatsapp.whatsapp_Message_IsHistory_Set(self.handle, value)
1194
+ return _whatsapp.whatsapp_Session_Disconnect(self.handle)
1195
+ def PairPhone(self, phone):
1196
+ """PairPhone(str phone) str, str
1197
+
1198
+ PairPhone returns a one-time code from WhatsApp, used for pairing this [Session] against the
1199
+ user's primary device, as identified by the given phone number. This will return an error if the
1200
+ [Session] is already paired, or if the phone number given is empty or invalid.
1201
+ """
1202
+ return _whatsapp.whatsapp_Session_PairPhone(self.handle, phone)
1203
+ def SendMessage(self, message):
1204
+ """SendMessage(object message) str
1205
+
1206
+ SendMessage processes the given Message and sends a WhatsApp message for the kind and contact JID
1207
+ specified within. In general, different message kinds require different fields to be set; see the
1208
+ documentation for the [Message] type for more information.
1209
+ """
1210
+ return _whatsapp.whatsapp_Session_SendMessage(self.handle, message.handle)
1211
+ def GenerateMessageID(self):
1212
+ """GenerateMessageID() str
1213
+
1214
+ GenerateMessageID returns a valid, pseudo-random message ID for use in outgoing messages.
1215
+ """
1216
+ return _whatsapp.whatsapp_Session_GenerateMessageID(self.handle)
1217
+ def SendChatState(self, state):
1218
+ """SendChatState(object state) str
1219
+
1220
+ SendChatState sends the given chat state notification (e.g. composing message) to WhatsApp for the
1221
+ contact specified within.
1222
+ """
1223
+ return _whatsapp.whatsapp_Session_SendChatState(self.handle, state.handle)
1224
+ def SendReceipt(self, receipt):
1225
+ """SendReceipt(object receipt) str
1226
+
1227
+ SendReceipt sends a read receipt to WhatsApp for the message IDs specified within.
1228
+ """
1229
+ return _whatsapp.whatsapp_Session_SendReceipt(self.handle, receipt.handle)
1230
+ def SendPresence(self, presence, statusMessage):
1231
+ """SendPresence(int presence, str statusMessage) str
1232
+
1233
+ SendPresence sets the activity state and (optional) status message for the current session and
1234
+ user. An error is returned if setting availability fails for any reason.
1235
+ """
1236
+ return _whatsapp.whatsapp_Session_SendPresence(self.handle, presence, statusMessage)
1237
+ def GetContacts(self, refresh):
1238
+ """GetContacts(bool refresh) []object, str
1239
+
1240
+ GetContacts subscribes to the WhatsApp roster currently stored in the Session's internal state.
1241
+ If `refresh` is `true`, FetchRoster will pull application state from the remote service and
1242
+ synchronize any contacts found with the adapter.
1243
+ """
1244
+ return Slice_whatsapp_Contact(handle=_whatsapp.whatsapp_Session_GetContacts(self.handle, refresh))
1245
+ def GetGroups(self):
1246
+ """GetGroups() []object, str
1247
+
1248
+ GetGroups returns a list of all group-chats currently joined in WhatsApp, along with additional
1249
+ information on present participants.
1250
+ """
1251
+ return Slice_whatsapp_Group(handle=_whatsapp.whatsapp_Session_GetGroups(self.handle))
1252
+ def CreateGroup(self, name, participants):
1253
+ """CreateGroup(str name, []str participants) object, str
1254
+
1255
+ CreateGroup attempts to create a new WhatsApp group for the given human-readable name and
1256
+ participant JIDs given.
1257
+ """
1258
+ return Group(handle=_whatsapp.whatsapp_Session_CreateGroup(self.handle, name, participants.handle))
1259
+ def LeaveGroup(self, resourceID):
1260
+ """LeaveGroup(str resourceID) str
1261
+
1262
+ LeaveGroup attempts to remove our own user from the given WhatsApp group, for the JID given.
1263
+ """
1264
+ return _whatsapp.whatsapp_Session_LeaveGroup(self.handle, resourceID)
1265
+ def GetAvatar(self, resourceID, avatarID):
1266
+ """GetAvatar(str resourceID, str avatarID) object, str
1267
+
1268
+ GetAvatar fetches a profile picture for the Contact or Group JID given. If a non-empty `avatarID`
1269
+ is also given, GetAvatar will return an empty [Avatar] instance with no error if the remote state
1270
+ for the given ID has not changed.
1271
+ """
1272
+ return Avatar(handle=_whatsapp.whatsapp_Session_GetAvatar(self.handle, resourceID, avatarID))
1273
+ def SetAvatar(self, resourceID, avatar):
1274
+ """SetAvatar(str resourceID, []int avatar) str, str
1275
+
1276
+ SetAvatar updates the profile picture for the Contact or Group JID given; it can also update the
1277
+ profile picture for our own user by providing an empty JID. The unique picture ID is returned,
1278
+ typically used as a cache reference or in providing to future calls for [Session.GetAvatar].
1279
+ """
1280
+ return _whatsapp.whatsapp_Session_SetAvatar(self.handle, resourceID, avatar.handle)
1281
+ def SetGroupName(self, resourceID, name):
1282
+ """SetGroupName(str resourceID, str name) str
1283
+
1284
+ SetGroupName updates the name of a WhatsApp group for the Group JID given.
1285
+ """
1286
+ return _whatsapp.whatsapp_Session_SetGroupName(self.handle, resourceID, name)
1287
+ def SetGroupTopic(self, resourceID, topic):
1288
+ """SetGroupTopic(str resourceID, str topic) str
1289
+
1290
+ SetGroupName updates the topic of a WhatsApp group for the Group JID given.
1291
+ """
1292
+ return _whatsapp.whatsapp_Session_SetGroupTopic(self.handle, resourceID, topic)
1293
+ def UpdateGroupParticipants(self, resourceID, participants):
1294
+ """UpdateGroupParticipants(str resourceID, []object participants) []object, str
1295
+
1296
+ UpdateGroupParticipants processes changes to the given group's participants, including additions,
1297
+ removals, and changes to privileges. Participant JIDs given must be part of the authenticated
1298
+ session's roster at least, and must also be active group participants for other types of changes.
1299
+ """
1300
+ return Slice_whatsapp_GroupParticipant(handle=_whatsapp.whatsapp_Session_UpdateGroupParticipants(self.handle, resourceID, participants.handle))
1301
+ def FindContact(self, phone):
1302
+ """FindContact(str phone) object, str
1303
+
1304
+ FindContact attempts to check for a registered contact on WhatsApp corresponding to the given
1305
+ phone number, returning a concrete instance if found; typically, only the contact JID is set. No
1306
+ error is returned if no contact was found, but any unexpected errors will otherwise be returned
1307
+ directly.
1308
+ """
1309
+ return Contact(handle=_whatsapp.whatsapp_Session_FindContact(self.handle, phone))
1310
+ def RequestMessageHistory(self, resourceID, oldestMessage):
1311
+ """RequestMessageHistory(str resourceID, object oldestMessage) str
1312
+
1313
+ RequestMessageHistory sends and asynchronous request for message history related to the given
1314
+ resource (e.g. Contact or Group JID), ending at the oldest message given. Messages returned from
1315
+ history should then be handled as a `HistorySync` event of type `ON_DEMAND`, in the session-wide
1316
+ event handler. An error will be returned if requesting history fails for any reason.
1317
+ """
1318
+ return _whatsapp.whatsapp_Session_RequestMessageHistory(self.handle, resourceID, oldestMessage.handle)
1319
+ def SetEventHandler(self, h, goRun=False):
1320
+ """SetEventHandler(callable h)
1321
+
1322
+ SetEventHandler assigns the given handler function for propagating internal events into the Python
1323
+ gateway. Note that the event handler function is not entirely safe to use directly, and all calls
1324
+ should instead be sent to the [Gateway] via its internal call channel.
1325
+ """
1326
+ _whatsapp.whatsapp_Session_SetEventHandler(self.handle, h, goRun)
1620
1327
 
1621
- # Python type for struct whatsapp.Poll
1622
- class Poll(go.GoClass):
1623
- """A Poll represents a multiple-choice question, on which each choice might be voted for one or more\ntimes.\n"""
1328
+ # Python type for struct whatsapp.Avatar
1329
+ class Avatar(go.GoClass):
1330
+ """A Avatar represents a small image set for a Contact or Group.\n"""
1624
1331
  def __init__(self, *args, **kwargs):
1625
1332
  """
1626
1333
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1634,21 +1341,21 @@ class Poll(go.GoClass):
1634
1341
  self.handle = args[0].handle
1635
1342
  _whatsapp.IncRef(self.handle)
1636
1343
  else:
1637
- self.handle = _whatsapp.whatsapp_Poll_CTor()
1344
+ self.handle = _whatsapp.whatsapp_Avatar_CTor()
1638
1345
  _whatsapp.IncRef(self.handle)
1639
1346
  if 0 < len(args):
1640
- self.Title = args[0]
1641
- if "Title" in kwargs:
1642
- self.Title = kwargs["Title"]
1347
+ self.ID = args[0]
1348
+ if "ID" in kwargs:
1349
+ self.ID = kwargs["ID"]
1643
1350
  if 1 < len(args):
1644
- self.Options = args[1]
1645
- if "Options" in kwargs:
1646
- self.Options = kwargs["Options"]
1351
+ self.URL = args[1]
1352
+ if "URL" in kwargs:
1353
+ self.URL = kwargs["URL"]
1647
1354
  def __del__(self):
1648
1355
  _whatsapp.DecRef(self.handle)
1649
1356
  def __str__(self):
1650
1357
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1651
- sv = 'whatsapp.Poll{'
1358
+ sv = 'whatsapp.Avatar{'
1652
1359
  first = True
1653
1360
  for v in pr:
1654
1361
  if callable(v[1]):
@@ -1661,87 +1368,33 @@ class Poll(go.GoClass):
1661
1368
  return sv + '}'
1662
1369
  def __repr__(self):
1663
1370
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1664
- sv = 'whatsapp.Poll ( '
1371
+ sv = 'whatsapp.Avatar ( '
1665
1372
  for v in pr:
1666
1373
  if not callable(v[1]):
1667
1374
  sv += v[0] + '=' + str(v[1]) + ', '
1668
1375
  return sv + ')'
1669
1376
  @property
1670
- def Title(self):
1671
- return _whatsapp.whatsapp_Poll_Title_Get(self.handle)
1672
- @Title.setter
1673
- def Title(self, value):
1674
- if isinstance(value, go.GoClass):
1675
- _whatsapp.whatsapp_Poll_Title_Set(self.handle, value.handle)
1676
- else:
1677
- _whatsapp.whatsapp_Poll_Title_Set(self.handle, value)
1678
- @property
1679
- def Options(self):
1680
- return Slice_whatsapp_PollOption(handle=_whatsapp.whatsapp_Poll_Options_Get(self.handle))
1681
- @Options.setter
1682
- def Options(self, value):
1377
+ def ID(self):
1378
+ return _whatsapp.whatsapp_Avatar_ID_Get(self.handle)
1379
+ @ID.setter
1380
+ def ID(self, value):
1683
1381
  if isinstance(value, go.GoClass):
1684
- _whatsapp.whatsapp_Poll_Options_Set(self.handle, value.handle)
1685
- else:
1686
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1687
-
1688
- # Python type for struct whatsapp.PollOption
1689
- class PollOption(go.GoClass):
1690
- """A PollOption represents an individual choice within a broader poll.\n"""
1691
- def __init__(self, *args, **kwargs):
1692
- """
1693
- handle=A Go-side object is always initialized with an explicit handle=arg
1694
- otherwise parameters can be unnamed in order of field names or named fields
1695
- in which case a new Go object is constructed first
1696
- """
1697
- if len(kwargs) == 1 and 'handle' in kwargs:
1698
- self.handle = kwargs['handle']
1699
- _whatsapp.IncRef(self.handle)
1700
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1701
- self.handle = args[0].handle
1702
- _whatsapp.IncRef(self.handle)
1382
+ _whatsapp.whatsapp_Avatar_ID_Set(self.handle, value.handle)
1703
1383
  else:
1704
- self.handle = _whatsapp.whatsapp_PollOption_CTor()
1705
- _whatsapp.IncRef(self.handle)
1706
- if 0 < len(args):
1707
- self.Title = args[0]
1708
- if "Title" in kwargs:
1709
- self.Title = kwargs["Title"]
1710
- def __del__(self):
1711
- _whatsapp.DecRef(self.handle)
1712
- def __str__(self):
1713
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1714
- sv = 'whatsapp.PollOption{'
1715
- first = True
1716
- for v in pr:
1717
- if callable(v[1]):
1718
- continue
1719
- if first:
1720
- first = False
1721
- else:
1722
- sv += ', '
1723
- sv += v[0] + '=' + str(v[1])
1724
- return sv + '}'
1725
- def __repr__(self):
1726
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1727
- sv = 'whatsapp.PollOption ( '
1728
- for v in pr:
1729
- if not callable(v[1]):
1730
- sv += v[0] + '=' + str(v[1]) + ', '
1731
- return sv + ')'
1384
+ _whatsapp.whatsapp_Avatar_ID_Set(self.handle, value)
1732
1385
  @property
1733
- def Title(self):
1734
- return _whatsapp.whatsapp_PollOption_Title_Get(self.handle)
1735
- @Title.setter
1736
- def Title(self, value):
1386
+ def URL(self):
1387
+ return _whatsapp.whatsapp_Avatar_URL_Get(self.handle)
1388
+ @URL.setter
1389
+ def URL(self, value):
1737
1390
  if isinstance(value, go.GoClass):
1738
- _whatsapp.whatsapp_PollOption_Title_Set(self.handle, value.handle)
1391
+ _whatsapp.whatsapp_Avatar_URL_Set(self.handle, value.handle)
1739
1392
  else:
1740
- _whatsapp.whatsapp_PollOption_Title_Set(self.handle, value)
1393
+ _whatsapp.whatsapp_Avatar_URL_Set(self.handle, value)
1741
1394
 
1742
- # Python type for struct whatsapp.Receipt
1743
- class Receipt(go.GoClass):
1744
- """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"""
1395
+ # Python type for struct whatsapp.GroupParticipant
1396
+ class GroupParticipant(go.GoClass):
1397
+ """A GroupParticipant represents a contact who is currently joined in a given group. Participants in\nWhatsApp can generally be derived back to their individual [Contact]; there are no anonymous groups\nin WhatsApp.\n"""
1745
1398
  def __init__(self, *args, **kwargs):
1746
1399
  """
1747
1400
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1755,37 +1408,29 @@ class Receipt(go.GoClass):
1755
1408
  self.handle = args[0].handle
1756
1409
  _whatsapp.IncRef(self.handle)
1757
1410
  else:
1758
- self.handle = _whatsapp.whatsapp_Receipt_CTor()
1411
+ self.handle = _whatsapp.whatsapp_GroupParticipant_CTor()
1759
1412
  _whatsapp.IncRef(self.handle)
1760
1413
  if 0 < len(args):
1761
- self.Kind = args[0]
1762
- if "Kind" in kwargs:
1763
- self.Kind = kwargs["Kind"]
1764
- if 1 < len(args):
1765
- self.MessageIDs = args[1]
1766
- if "MessageIDs" in kwargs:
1767
- self.MessageIDs = kwargs["MessageIDs"]
1768
- if 2 < len(args):
1769
- self.JID = args[2]
1414
+ self.JID = args[0]
1770
1415
  if "JID" in kwargs:
1771
1416
  self.JID = kwargs["JID"]
1417
+ if 1 < len(args):
1418
+ self.Nickname = args[1]
1419
+ if "Nickname" in kwargs:
1420
+ self.Nickname = kwargs["Nickname"]
1421
+ if 2 < len(args):
1422
+ self.Affiliation = args[2]
1423
+ if "Affiliation" in kwargs:
1424
+ self.Affiliation = kwargs["Affiliation"]
1772
1425
  if 3 < len(args):
1773
- self.GroupJID = args[3]
1774
- if "GroupJID" in kwargs:
1775
- self.GroupJID = kwargs["GroupJID"]
1776
- if 4 < len(args):
1777
- self.Timestamp = args[4]
1778
- if "Timestamp" in kwargs:
1779
- self.Timestamp = kwargs["Timestamp"]
1780
- if 5 < len(args):
1781
- self.IsCarbon = args[5]
1782
- if "IsCarbon" in kwargs:
1783
- self.IsCarbon = kwargs["IsCarbon"]
1426
+ self.Action = args[3]
1427
+ if "Action" in kwargs:
1428
+ self.Action = kwargs["Action"]
1784
1429
  def __del__(self):
1785
1430
  _whatsapp.DecRef(self.handle)
1786
1431
  def __str__(self):
1787
1432
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1788
- sv = 'whatsapp.Receipt{'
1433
+ sv = 'whatsapp.GroupParticipant{'
1789
1434
  first = True
1790
1435
  for v in pr:
1791
1436
  if callable(v[1]):
@@ -1798,69 +1443,51 @@ class Receipt(go.GoClass):
1798
1443
  return sv + '}'
1799
1444
  def __repr__(self):
1800
1445
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1801
- sv = 'whatsapp.Receipt ( '
1446
+ sv = 'whatsapp.GroupParticipant ( '
1802
1447
  for v in pr:
1803
1448
  if not callable(v[1]):
1804
1449
  sv += v[0] + '=' + str(v[1]) + ', '
1805
- return sv + ')'
1806
- @property
1807
- def Kind(self):
1808
- return _whatsapp.whatsapp_Receipt_Kind_Get(self.handle)
1809
- @Kind.setter
1810
- def Kind(self, value):
1811
- if isinstance(value, go.GoClass):
1812
- _whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value.handle)
1813
- else:
1814
- _whatsapp.whatsapp_Receipt_Kind_Set(self.handle, value)
1815
- @property
1816
- def MessageIDs(self):
1817
- return go.Slice_string(handle=_whatsapp.whatsapp_Receipt_MessageIDs_Get(self.handle))
1818
- @MessageIDs.setter
1819
- def MessageIDs(self, value):
1820
- if isinstance(value, go.GoClass):
1821
- _whatsapp.whatsapp_Receipt_MessageIDs_Set(self.handle, value.handle)
1822
- else:
1823
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1450
+ return sv + ')'
1824
1451
  @property
1825
1452
  def JID(self):
1826
- return _whatsapp.whatsapp_Receipt_JID_Get(self.handle)
1453
+ return _whatsapp.whatsapp_GroupParticipant_JID_Get(self.handle)
1827
1454
  @JID.setter
1828
1455
  def JID(self, value):
1829
1456
  if isinstance(value, go.GoClass):
1830
- _whatsapp.whatsapp_Receipt_JID_Set(self.handle, value.handle)
1457
+ _whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value.handle)
1831
1458
  else:
1832
- _whatsapp.whatsapp_Receipt_JID_Set(self.handle, value)
1459
+ _whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value)
1833
1460
  @property
1834
- def GroupJID(self):
1835
- return _whatsapp.whatsapp_Receipt_GroupJID_Get(self.handle)
1836
- @GroupJID.setter
1837
- def GroupJID(self, value):
1461
+ def Nickname(self):
1462
+ return _whatsapp.whatsapp_GroupParticipant_Nickname_Get(self.handle)
1463
+ @Nickname.setter
1464
+ def Nickname(self, value):
1838
1465
  if isinstance(value, go.GoClass):
1839
- _whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value.handle)
1466
+ _whatsapp.whatsapp_GroupParticipant_Nickname_Set(self.handle, value.handle)
1840
1467
  else:
1841
- _whatsapp.whatsapp_Receipt_GroupJID_Set(self.handle, value)
1468
+ _whatsapp.whatsapp_GroupParticipant_Nickname_Set(self.handle, value)
1842
1469
  @property
1843
- def Timestamp(self):
1844
- return _whatsapp.whatsapp_Receipt_Timestamp_Get(self.handle)
1845
- @Timestamp.setter
1846
- def Timestamp(self, value):
1470
+ def Affiliation(self):
1471
+ return _whatsapp.whatsapp_GroupParticipant_Affiliation_Get(self.handle)
1472
+ @Affiliation.setter
1473
+ def Affiliation(self, value):
1847
1474
  if isinstance(value, go.GoClass):
1848
- _whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value.handle)
1475
+ _whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value.handle)
1849
1476
  else:
1850
- _whatsapp.whatsapp_Receipt_Timestamp_Set(self.handle, value)
1477
+ _whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value)
1851
1478
  @property
1852
- def IsCarbon(self):
1853
- return _whatsapp.whatsapp_Receipt_IsCarbon_Get(self.handle)
1854
- @IsCarbon.setter
1855
- def IsCarbon(self, value):
1479
+ def Action(self):
1480
+ return _whatsapp.whatsapp_GroupParticipant_Action_Get(self.handle)
1481
+ @Action.setter
1482
+ def Action(self, value):
1856
1483
  if isinstance(value, go.GoClass):
1857
- _whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value.handle)
1484
+ _whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value.handle)
1858
1485
  else:
1859
- _whatsapp.whatsapp_Receipt_IsCarbon_Set(self.handle, value)
1486
+ _whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value)
1860
1487
 
1861
- # Python type for struct whatsapp.Avatar
1862
- class Avatar(go.GoClass):
1863
- """A Avatar represents a small image set for a Contact or Group.\n"""
1488
+ # Python type for struct whatsapp.Location
1489
+ class Location(go.GoClass):
1490
+ """A Location represents additional metadata given to location messages.\n"""
1864
1491
  def __init__(self, *args, **kwargs):
1865
1492
  """
1866
1493
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1874,21 +1501,41 @@ class Avatar(go.GoClass):
1874
1501
  self.handle = args[0].handle
1875
1502
  _whatsapp.IncRef(self.handle)
1876
1503
  else:
1877
- self.handle = _whatsapp.whatsapp_Avatar_CTor()
1504
+ self.handle = _whatsapp.whatsapp_Location_CTor()
1878
1505
  _whatsapp.IncRef(self.handle)
1879
1506
  if 0 < len(args):
1880
- self.ID = args[0]
1881
- if "ID" in kwargs:
1882
- self.ID = kwargs["ID"]
1507
+ self.Latitude = args[0]
1508
+ if "Latitude" in kwargs:
1509
+ self.Latitude = kwargs["Latitude"]
1883
1510
  if 1 < len(args):
1884
- self.URL = args[1]
1511
+ self.Longitude = args[1]
1512
+ if "Longitude" in kwargs:
1513
+ self.Longitude = kwargs["Longitude"]
1514
+ if 2 < len(args):
1515
+ self.Accuracy = args[2]
1516
+ if "Accuracy" in kwargs:
1517
+ self.Accuracy = kwargs["Accuracy"]
1518
+ if 3 < len(args):
1519
+ self.IsLive = args[3]
1520
+ if "IsLive" in kwargs:
1521
+ self.IsLive = kwargs["IsLive"]
1522
+ if 4 < len(args):
1523
+ self.Name = args[4]
1524
+ if "Name" in kwargs:
1525
+ self.Name = kwargs["Name"]
1526
+ if 5 < len(args):
1527
+ self.Address = args[5]
1528
+ if "Address" in kwargs:
1529
+ self.Address = kwargs["Address"]
1530
+ if 6 < len(args):
1531
+ self.URL = args[6]
1885
1532
  if "URL" in kwargs:
1886
1533
  self.URL = kwargs["URL"]
1887
1534
  def __del__(self):
1888
1535
  _whatsapp.DecRef(self.handle)
1889
1536
  def __str__(self):
1890
1537
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1891
- sv = 'whatsapp.Avatar{'
1538
+ sv = 'whatsapp.Location{'
1892
1539
  first = True
1893
1540
  for v in pr:
1894
1541
  if callable(v[1]):
@@ -1901,33 +1548,80 @@ class Avatar(go.GoClass):
1901
1548
  return sv + '}'
1902
1549
  def __repr__(self):
1903
1550
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1904
- sv = 'whatsapp.Avatar ( '
1551
+ sv = 'whatsapp.Location ( '
1905
1552
  for v in pr:
1906
1553
  if not callable(v[1]):
1907
1554
  sv += v[0] + '=' + str(v[1]) + ', '
1908
1555
  return sv + ')'
1909
1556
  @property
1910
- def ID(self):
1911
- return _whatsapp.whatsapp_Avatar_ID_Get(self.handle)
1912
- @ID.setter
1913
- def ID(self, value):
1557
+ def Latitude(self):
1558
+ return _whatsapp.whatsapp_Location_Latitude_Get(self.handle)
1559
+ @Latitude.setter
1560
+ def Latitude(self, value):
1914
1561
  if isinstance(value, go.GoClass):
1915
- _whatsapp.whatsapp_Avatar_ID_Set(self.handle, value.handle)
1562
+ _whatsapp.whatsapp_Location_Latitude_Set(self.handle, value.handle)
1916
1563
  else:
1917
- _whatsapp.whatsapp_Avatar_ID_Set(self.handle, value)
1564
+ _whatsapp.whatsapp_Location_Latitude_Set(self.handle, value)
1565
+ @property
1566
+ def Longitude(self):
1567
+ return _whatsapp.whatsapp_Location_Longitude_Get(self.handle)
1568
+ @Longitude.setter
1569
+ def Longitude(self, value):
1570
+ if isinstance(value, go.GoClass):
1571
+ _whatsapp.whatsapp_Location_Longitude_Set(self.handle, value.handle)
1572
+ else:
1573
+ _whatsapp.whatsapp_Location_Longitude_Set(self.handle, value)
1574
+ @property
1575
+ def Accuracy(self):
1576
+ return _whatsapp.whatsapp_Location_Accuracy_Get(self.handle)
1577
+ @Accuracy.setter
1578
+ def Accuracy(self, value):
1579
+ if isinstance(value, go.GoClass):
1580
+ _whatsapp.whatsapp_Location_Accuracy_Set(self.handle, value.handle)
1581
+ else:
1582
+ _whatsapp.whatsapp_Location_Accuracy_Set(self.handle, value)
1583
+ @property
1584
+ def IsLive(self):
1585
+ return _whatsapp.whatsapp_Location_IsLive_Get(self.handle)
1586
+ @IsLive.setter
1587
+ def IsLive(self, value):
1588
+ if isinstance(value, go.GoClass):
1589
+ _whatsapp.whatsapp_Location_IsLive_Set(self.handle, value.handle)
1590
+ else:
1591
+ _whatsapp.whatsapp_Location_IsLive_Set(self.handle, value)
1592
+ @property
1593
+ def Name(self):
1594
+ """Optional fields given for named locations.
1595
+ """
1596
+ return _whatsapp.whatsapp_Location_Name_Get(self.handle)
1597
+ @Name.setter
1598
+ def Name(self, value):
1599
+ if isinstance(value, go.GoClass):
1600
+ _whatsapp.whatsapp_Location_Name_Set(self.handle, value.handle)
1601
+ else:
1602
+ _whatsapp.whatsapp_Location_Name_Set(self.handle, value)
1603
+ @property
1604
+ def Address(self):
1605
+ return _whatsapp.whatsapp_Location_Address_Get(self.handle)
1606
+ @Address.setter
1607
+ def Address(self, value):
1608
+ if isinstance(value, go.GoClass):
1609
+ _whatsapp.whatsapp_Location_Address_Set(self.handle, value.handle)
1610
+ else:
1611
+ _whatsapp.whatsapp_Location_Address_Set(self.handle, value)
1918
1612
  @property
1919
1613
  def URL(self):
1920
- return _whatsapp.whatsapp_Avatar_URL_Get(self.handle)
1614
+ return _whatsapp.whatsapp_Location_URL_Get(self.handle)
1921
1615
  @URL.setter
1922
1616
  def URL(self, value):
1923
1617
  if isinstance(value, go.GoClass):
1924
- _whatsapp.whatsapp_Avatar_URL_Set(self.handle, value.handle)
1618
+ _whatsapp.whatsapp_Location_URL_Set(self.handle, value.handle)
1925
1619
  else:
1926
- _whatsapp.whatsapp_Avatar_URL_Set(self.handle, value)
1620
+ _whatsapp.whatsapp_Location_URL_Set(self.handle, value)
1927
1621
 
1928
- # Python type for struct whatsapp.Group
1929
- class Group(go.GoClass):
1930
- """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"""
1622
+ # Python type for struct whatsapp.Poll
1623
+ class Poll(go.GoClass):
1624
+ """A Poll represents a multiple-choice question, on which each choice might be voted for one or more\ntimes.\n"""
1931
1625
  def __init__(self, *args, **kwargs):
1932
1626
  """
1933
1627
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -1941,37 +1635,21 @@ class Group(go.GoClass):
1941
1635
  self.handle = args[0].handle
1942
1636
  _whatsapp.IncRef(self.handle)
1943
1637
  else:
1944
- self.handle = _whatsapp.whatsapp_Group_CTor()
1638
+ self.handle = _whatsapp.whatsapp_Poll_CTor()
1945
1639
  _whatsapp.IncRef(self.handle)
1946
1640
  if 0 < len(args):
1947
- self.JID = args[0]
1948
- if "JID" in kwargs:
1949
- self.JID = kwargs["JID"]
1641
+ self.Title = args[0]
1642
+ if "Title" in kwargs:
1643
+ self.Title = kwargs["Title"]
1950
1644
  if 1 < len(args):
1951
- self.Name = args[1]
1952
- if "Name" in kwargs:
1953
- self.Name = kwargs["Name"]
1954
- if 2 < len(args):
1955
- self.Subject = args[2]
1956
- if "Subject" in kwargs:
1957
- self.Subject = kwargs["Subject"]
1958
- if 3 < len(args):
1959
- self.Nickname = args[3]
1960
- if "Nickname" in kwargs:
1961
- self.Nickname = kwargs["Nickname"]
1962
- if 4 < len(args):
1963
- self.Participants = args[4]
1964
- if "Participants" in kwargs:
1965
- self.Participants = kwargs["Participants"]
1966
- if 5 < len(args):
1967
- self.InviteCode = args[5]
1968
- if "InviteCode" in kwargs:
1969
- self.InviteCode = kwargs["InviteCode"]
1645
+ self.Options = args[1]
1646
+ if "Options" in kwargs:
1647
+ self.Options = kwargs["Options"]
1970
1648
  def __del__(self):
1971
1649
  _whatsapp.DecRef(self.handle)
1972
1650
  def __str__(self):
1973
1651
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1974
- sv = 'whatsapp.Group{'
1652
+ sv = 'whatsapp.Poll{'
1975
1653
  first = True
1976
1654
  for v in pr:
1977
1655
  if callable(v[1]):
@@ -1984,65 +1662,83 @@ class Group(go.GoClass):
1984
1662
  return sv + '}'
1985
1663
  def __repr__(self):
1986
1664
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1987
- sv = 'whatsapp.Group ( '
1665
+ sv = 'whatsapp.Poll ( '
1988
1666
  for v in pr:
1989
1667
  if not callable(v[1]):
1990
1668
  sv += v[0] + '=' + str(v[1]) + ', '
1991
1669
  return sv + ')'
1992
1670
  @property
1993
- def JID(self):
1994
- return _whatsapp.whatsapp_Group_JID_Get(self.handle)
1995
- @JID.setter
1996
- def JID(self, value):
1997
- if isinstance(value, go.GoClass):
1998
- _whatsapp.whatsapp_Group_JID_Set(self.handle, value.handle)
1999
- else:
2000
- _whatsapp.whatsapp_Group_JID_Set(self.handle, value)
2001
- @property
2002
- def Name(self):
2003
- return _whatsapp.whatsapp_Group_Name_Get(self.handle)
2004
- @Name.setter
2005
- def Name(self, value):
1671
+ def Title(self):
1672
+ return _whatsapp.whatsapp_Poll_Title_Get(self.handle)
1673
+ @Title.setter
1674
+ def Title(self, value):
2006
1675
  if isinstance(value, go.GoClass):
2007
- _whatsapp.whatsapp_Group_Name_Set(self.handle, value.handle)
1676
+ _whatsapp.whatsapp_Poll_Title_Set(self.handle, value.handle)
2008
1677
  else:
2009
- _whatsapp.whatsapp_Group_Name_Set(self.handle, value)
1678
+ _whatsapp.whatsapp_Poll_Title_Set(self.handle, value)
2010
1679
  @property
2011
- def Subject(self):
2012
- return GroupSubject(handle=_whatsapp.whatsapp_Group_Subject_Get(self.handle))
2013
- @Subject.setter
2014
- def Subject(self, value):
1680
+ def Options(self):
1681
+ return Slice_whatsapp_PollOption(handle=_whatsapp.whatsapp_Poll_Options_Get(self.handle))
1682
+ @Options.setter
1683
+ def Options(self, value):
2015
1684
  if isinstance(value, go.GoClass):
2016
- _whatsapp.whatsapp_Group_Subject_Set(self.handle, value.handle)
1685
+ _whatsapp.whatsapp_Poll_Options_Set(self.handle, value.handle)
2017
1686
  else:
2018
1687
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2019
- @property
2020
- def Nickname(self):
2021
- return _whatsapp.whatsapp_Group_Nickname_Get(self.handle)
2022
- @Nickname.setter
2023
- def Nickname(self, value):
2024
- if isinstance(value, go.GoClass):
2025
- _whatsapp.whatsapp_Group_Nickname_Set(self.handle, value.handle)
2026
- else:
2027
- _whatsapp.whatsapp_Group_Nickname_Set(self.handle, value)
2028
- @property
2029
- def Participants(self):
2030
- return Slice_whatsapp_GroupParticipant(handle=_whatsapp.whatsapp_Group_Participants_Get(self.handle))
2031
- @Participants.setter
2032
- def Participants(self, value):
2033
- if isinstance(value, go.GoClass):
2034
- _whatsapp.whatsapp_Group_Participants_Set(self.handle, value.handle)
1688
+
1689
+ # Python type for struct whatsapp.PollOption
1690
+ class PollOption(go.GoClass):
1691
+ """A PollOption represents an individual choice within a broader poll.\n"""
1692
+ def __init__(self, *args, **kwargs):
1693
+ """
1694
+ handle=A Go-side object is always initialized with an explicit handle=arg
1695
+ otherwise parameters can be unnamed in order of field names or named fields
1696
+ in which case a new Go object is constructed first
1697
+ """
1698
+ if len(kwargs) == 1 and 'handle' in kwargs:
1699
+ self.handle = kwargs['handle']
1700
+ _whatsapp.IncRef(self.handle)
1701
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1702
+ self.handle = args[0].handle
1703
+ _whatsapp.IncRef(self.handle)
2035
1704
  else:
2036
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1705
+ self.handle = _whatsapp.whatsapp_PollOption_CTor()
1706
+ _whatsapp.IncRef(self.handle)
1707
+ if 0 < len(args):
1708
+ self.Title = args[0]
1709
+ if "Title" in kwargs:
1710
+ self.Title = kwargs["Title"]
1711
+ def __del__(self):
1712
+ _whatsapp.DecRef(self.handle)
1713
+ def __str__(self):
1714
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1715
+ sv = 'whatsapp.PollOption{'
1716
+ first = True
1717
+ for v in pr:
1718
+ if callable(v[1]):
1719
+ continue
1720
+ if first:
1721
+ first = False
1722
+ else:
1723
+ sv += ', '
1724
+ sv += v[0] + '=' + str(v[1])
1725
+ return sv + '}'
1726
+ def __repr__(self):
1727
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1728
+ sv = 'whatsapp.PollOption ( '
1729
+ for v in pr:
1730
+ if not callable(v[1]):
1731
+ sv += v[0] + '=' + str(v[1]) + ', '
1732
+ return sv + ')'
2037
1733
  @property
2038
- def InviteCode(self):
2039
- return _whatsapp.whatsapp_Group_InviteCode_Get(self.handle)
2040
- @InviteCode.setter
2041
- def InviteCode(self, value):
1734
+ def Title(self):
1735
+ return _whatsapp.whatsapp_PollOption_Title_Get(self.handle)
1736
+ @Title.setter
1737
+ def Title(self, value):
2042
1738
  if isinstance(value, go.GoClass):
2043
- _whatsapp.whatsapp_Group_InviteCode_Set(self.handle, value.handle)
1739
+ _whatsapp.whatsapp_PollOption_Title_Set(self.handle, value.handle)
2044
1740
  else:
2045
- _whatsapp.whatsapp_Group_InviteCode_Set(self.handle, value)
1741
+ _whatsapp.whatsapp_PollOption_Title_Set(self.handle, value)
2046
1742
 
2047
1743
  # Python type for struct whatsapp.Presence
2048
1744
  class Presence(go.GoClass):
@@ -2124,9 +1820,9 @@ class Presence(go.GoClass):
2124
1820
  else:
2125
1821
  _whatsapp.whatsapp_Presence_LastSeen_Set(self.handle, value)
2126
1822
 
2127
- # Python type for struct whatsapp.EventPayload
2128
- class EventPayload(go.GoClass):
2129
- """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"""
1823
+ # Python type for struct whatsapp.Call
1824
+ class Call(go.GoClass):
1825
+ """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"""
2130
1826
  def __init__(self, *args, **kwargs):
2131
1827
  """
2132
1828
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2140,57 +1836,177 @@ class EventPayload(go.GoClass):
2140
1836
  self.handle = args[0].handle
2141
1837
  _whatsapp.IncRef(self.handle)
2142
1838
  else:
2143
- self.handle = _whatsapp.whatsapp_EventPayload_CTor()
1839
+ self.handle = _whatsapp.whatsapp_Call_CTor()
2144
1840
  _whatsapp.IncRef(self.handle)
2145
1841
  if 0 < len(args):
2146
- self.QRCode = args[0]
2147
- if "QRCode" in kwargs:
2148
- self.QRCode = kwargs["QRCode"]
1842
+ self.State = args[0]
1843
+ if "State" in kwargs:
1844
+ self.State = kwargs["State"]
2149
1845
  if 1 < len(args):
2150
- self.PairDeviceID = args[1]
2151
- if "PairDeviceID" in kwargs:
2152
- self.PairDeviceID = kwargs["PairDeviceID"]
1846
+ self.JID = args[1]
1847
+ if "JID" in kwargs:
1848
+ self.JID = kwargs["JID"]
2153
1849
  if 2 < len(args):
2154
- self.Connect = args[2]
2155
- if "Connect" in kwargs:
2156
- self.Connect = kwargs["Connect"]
1850
+ self.Timestamp = args[2]
1851
+ if "Timestamp" in kwargs:
1852
+ self.Timestamp = kwargs["Timestamp"]
1853
+ def __del__(self):
1854
+ _whatsapp.DecRef(self.handle)
1855
+ def __str__(self):
1856
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1857
+ sv = 'whatsapp.Call{'
1858
+ first = True
1859
+ for v in pr:
1860
+ if callable(v[1]):
1861
+ continue
1862
+ if first:
1863
+ first = False
1864
+ else:
1865
+ sv += ', '
1866
+ sv += v[0] + '=' + str(v[1])
1867
+ return sv + '}'
1868
+ def __repr__(self):
1869
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1870
+ sv = 'whatsapp.Call ( '
1871
+ for v in pr:
1872
+ if not callable(v[1]):
1873
+ sv += v[0] + '=' + str(v[1]) + ', '
1874
+ return sv + ')'
1875
+ @property
1876
+ def State(self):
1877
+ return _whatsapp.whatsapp_Call_State_Get(self.handle)
1878
+ @State.setter
1879
+ def State(self, value):
1880
+ if isinstance(value, go.GoClass):
1881
+ _whatsapp.whatsapp_Call_State_Set(self.handle, value.handle)
1882
+ else:
1883
+ _whatsapp.whatsapp_Call_State_Set(self.handle, value)
1884
+ @property
1885
+ def JID(self):
1886
+ return _whatsapp.whatsapp_Call_JID_Get(self.handle)
1887
+ @JID.setter
1888
+ def JID(self, value):
1889
+ if isinstance(value, go.GoClass):
1890
+ _whatsapp.whatsapp_Call_JID_Set(self.handle, value.handle)
1891
+ else:
1892
+ _whatsapp.whatsapp_Call_JID_Set(self.handle, value)
1893
+ @property
1894
+ def Timestamp(self):
1895
+ return _whatsapp.whatsapp_Call_Timestamp_Get(self.handle)
1896
+ @Timestamp.setter
1897
+ def Timestamp(self, value):
1898
+ if isinstance(value, go.GoClass):
1899
+ _whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value.handle)
1900
+ else:
1901
+ _whatsapp.whatsapp_Call_Timestamp_Set(self.handle, value)
1902
+
1903
+ # Python type for struct whatsapp.Message
1904
+ class Message(go.GoClass):
1905
+ """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"""
1906
+ def __init__(self, *args, **kwargs):
1907
+ """
1908
+ handle=A Go-side object is always initialized with an explicit handle=arg
1909
+ otherwise parameters can be unnamed in order of field names or named fields
1910
+ in which case a new Go object is constructed first
1911
+ """
1912
+ if len(kwargs) == 1 and 'handle' in kwargs:
1913
+ self.handle = kwargs['handle']
1914
+ _whatsapp.IncRef(self.handle)
1915
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1916
+ self.handle = args[0].handle
1917
+ _whatsapp.IncRef(self.handle)
1918
+ else:
1919
+ self.handle = _whatsapp.whatsapp_Message_CTor()
1920
+ _whatsapp.IncRef(self.handle)
1921
+ if 0 < len(args):
1922
+ self.Kind = args[0]
1923
+ if "Kind" in kwargs:
1924
+ self.Kind = kwargs["Kind"]
1925
+ if 1 < len(args):
1926
+ self.ID = args[1]
1927
+ if "ID" in kwargs:
1928
+ self.ID = kwargs["ID"]
1929
+ if 2 < len(args):
1930
+ self.JID = args[2]
1931
+ if "JID" in kwargs:
1932
+ self.JID = kwargs["JID"]
2157
1933
  if 3 < len(args):
2158
- self.LoggedOut = args[3]
2159
- if "LoggedOut" in kwargs:
2160
- self.LoggedOut = kwargs["LoggedOut"]
1934
+ self.GroupJID = args[3]
1935
+ if "GroupJID" in kwargs:
1936
+ self.GroupJID = kwargs["GroupJID"]
2161
1937
  if 4 < len(args):
2162
- self.Contact = args[4]
2163
- if "Contact" in kwargs:
2164
- self.Contact = kwargs["Contact"]
1938
+ self.OriginJID = args[4]
1939
+ if "OriginJID" in kwargs:
1940
+ self.OriginJID = kwargs["OriginJID"]
2165
1941
  if 5 < len(args):
2166
- self.Presence = args[5]
2167
- if "Presence" in kwargs:
2168
- self.Presence = kwargs["Presence"]
1942
+ self.Body = args[5]
1943
+ if "Body" in kwargs:
1944
+ self.Body = kwargs["Body"]
2169
1945
  if 6 < len(args):
2170
- self.Message = args[6]
2171
- if "Message" in kwargs:
2172
- self.Message = kwargs["Message"]
1946
+ self.Timestamp = args[6]
1947
+ if "Timestamp" in kwargs:
1948
+ self.Timestamp = kwargs["Timestamp"]
2173
1949
  if 7 < len(args):
2174
- self.ChatState = args[7]
2175
- if "ChatState" in kwargs:
2176
- self.ChatState = kwargs["ChatState"]
1950
+ self.IsCarbon = args[7]
1951
+ if "IsCarbon" in kwargs:
1952
+ self.IsCarbon = kwargs["IsCarbon"]
2177
1953
  if 8 < len(args):
2178
- self.Receipt = args[8]
2179
- if "Receipt" in kwargs:
2180
- self.Receipt = kwargs["Receipt"]
1954
+ self.IsForwarded = args[8]
1955
+ if "IsForwarded" in kwargs:
1956
+ self.IsForwarded = kwargs["IsForwarded"]
2181
1957
  if 9 < len(args):
2182
- self.Group = args[9]
2183
- if "Group" in kwargs:
2184
- self.Group = kwargs["Group"]
1958
+ self.ReplyID = args[9]
1959
+ if "ReplyID" in kwargs:
1960
+ self.ReplyID = kwargs["ReplyID"]
2185
1961
  if 10 < len(args):
2186
- self.Call = args[10]
2187
- if "Call" in kwargs:
2188
- self.Call = kwargs["Call"]
1962
+ self.ReplyBody = args[10]
1963
+ if "ReplyBody" in kwargs:
1964
+ self.ReplyBody = kwargs["ReplyBody"]
1965
+ if 11 < len(args):
1966
+ self.Attachments = args[11]
1967
+ if "Attachments" in kwargs:
1968
+ self.Attachments = kwargs["Attachments"]
1969
+ if 12 < len(args):
1970
+ self.Preview = args[12]
1971
+ if "Preview" in kwargs:
1972
+ self.Preview = kwargs["Preview"]
1973
+ if 13 < len(args):
1974
+ self.Location = args[13]
1975
+ if "Location" in kwargs:
1976
+ self.Location = kwargs["Location"]
1977
+ if 14 < len(args):
1978
+ self.Poll = args[14]
1979
+ if "Poll" in kwargs:
1980
+ self.Poll = kwargs["Poll"]
1981
+ if 15 < len(args):
1982
+ self.Album = args[15]
1983
+ if "Album" in kwargs:
1984
+ self.Album = kwargs["Album"]
1985
+ if 16 < len(args):
1986
+ self.GroupInvite = args[16]
1987
+ if "GroupInvite" in kwargs:
1988
+ self.GroupInvite = kwargs["GroupInvite"]
1989
+ if 17 < len(args):
1990
+ self.MentionJIDs = args[17]
1991
+ if "MentionJIDs" in kwargs:
1992
+ self.MentionJIDs = kwargs["MentionJIDs"]
1993
+ if 18 < len(args):
1994
+ self.Receipts = args[18]
1995
+ if "Receipts" in kwargs:
1996
+ self.Receipts = kwargs["Receipts"]
1997
+ if 19 < len(args):
1998
+ self.Reactions = args[19]
1999
+ if "Reactions" in kwargs:
2000
+ self.Reactions = kwargs["Reactions"]
2001
+ if 20 < len(args):
2002
+ self.IsHistory = args[20]
2003
+ if "IsHistory" in kwargs:
2004
+ self.IsHistory = kwargs["IsHistory"]
2189
2005
  def __del__(self):
2190
2006
  _whatsapp.DecRef(self.handle)
2191
2007
  def __str__(self):
2192
2008
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2193
- sv = 'whatsapp.EventPayload{'
2009
+ sv = 'whatsapp.Message{'
2194
2010
  first = True
2195
2011
  for v in pr:
2196
2012
  if callable(v[1]):
@@ -2203,114 +2019,204 @@ class EventPayload(go.GoClass):
2203
2019
  return sv + '}'
2204
2020
  def __repr__(self):
2205
2021
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2206
- sv = 'whatsapp.EventPayload ( '
2022
+ sv = 'whatsapp.Message ( '
2207
2023
  for v in pr:
2208
2024
  if not callable(v[1]):
2209
2025
  sv += v[0] + '=' + str(v[1]) + ', '
2210
2026
  return sv + ')'
2211
2027
  @property
2212
- def QRCode(self):
2213
- return _whatsapp.whatsapp_EventPayload_QRCode_Get(self.handle)
2214
- @QRCode.setter
2215
- def QRCode(self, value):
2028
+ def Kind(self):
2029
+ return _whatsapp.whatsapp_Message_Kind_Get(self.handle)
2030
+ @Kind.setter
2031
+ def Kind(self, value):
2032
+ if isinstance(value, go.GoClass):
2033
+ _whatsapp.whatsapp_Message_Kind_Set(self.handle, value.handle)
2034
+ else:
2035
+ _whatsapp.whatsapp_Message_Kind_Set(self.handle, value)
2036
+ @property
2037
+ def ID(self):
2038
+ return _whatsapp.whatsapp_Message_ID_Get(self.handle)
2039
+ @ID.setter
2040
+ def ID(self, value):
2041
+ if isinstance(value, go.GoClass):
2042
+ _whatsapp.whatsapp_Message_ID_Set(self.handle, value.handle)
2043
+ else:
2044
+ _whatsapp.whatsapp_Message_ID_Set(self.handle, value)
2045
+ @property
2046
+ def JID(self):
2047
+ return _whatsapp.whatsapp_Message_JID_Get(self.handle)
2048
+ @JID.setter
2049
+ def JID(self, value):
2050
+ if isinstance(value, go.GoClass):
2051
+ _whatsapp.whatsapp_Message_JID_Set(self.handle, value.handle)
2052
+ else:
2053
+ _whatsapp.whatsapp_Message_JID_Set(self.handle, value)
2054
+ @property
2055
+ def GroupJID(self):
2056
+ return _whatsapp.whatsapp_Message_GroupJID_Get(self.handle)
2057
+ @GroupJID.setter
2058
+ def GroupJID(self, value):
2216
2059
  if isinstance(value, go.GoClass):
2217
- _whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value.handle)
2060
+ _whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value.handle)
2218
2061
  else:
2219
- _whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value)
2062
+ _whatsapp.whatsapp_Message_GroupJID_Set(self.handle, value)
2220
2063
  @property
2221
- def PairDeviceID(self):
2222
- return _whatsapp.whatsapp_EventPayload_PairDeviceID_Get(self.handle)
2223
- @PairDeviceID.setter
2224
- def PairDeviceID(self, value):
2064
+ def OriginJID(self):
2065
+ return _whatsapp.whatsapp_Message_OriginJID_Get(self.handle)
2066
+ @OriginJID.setter
2067
+ def OriginJID(self, value):
2225
2068
  if isinstance(value, go.GoClass):
2226
- _whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value.handle)
2069
+ _whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value.handle)
2227
2070
  else:
2228
- _whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value)
2071
+ _whatsapp.whatsapp_Message_OriginJID_Set(self.handle, value)
2229
2072
  @property
2230
- def Connect(self):
2231
- return Connect(handle=_whatsapp.whatsapp_EventPayload_Connect_Get(self.handle))
2232
- @Connect.setter
2233
- def Connect(self, value):
2073
+ def Body(self):
2074
+ return _whatsapp.whatsapp_Message_Body_Get(self.handle)
2075
+ @Body.setter
2076
+ def Body(self, value):
2234
2077
  if isinstance(value, go.GoClass):
2235
- _whatsapp.whatsapp_EventPayload_Connect_Set(self.handle, value.handle)
2078
+ _whatsapp.whatsapp_Message_Body_Set(self.handle, value.handle)
2079
+ else:
2080
+ _whatsapp.whatsapp_Message_Body_Set(self.handle, value)
2081
+ @property
2082
+ def Timestamp(self):
2083
+ return _whatsapp.whatsapp_Message_Timestamp_Get(self.handle)
2084
+ @Timestamp.setter
2085
+ def Timestamp(self, value):
2086
+ if isinstance(value, go.GoClass):
2087
+ _whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value.handle)
2088
+ else:
2089
+ _whatsapp.whatsapp_Message_Timestamp_Set(self.handle, value)
2090
+ @property
2091
+ def IsCarbon(self):
2092
+ return _whatsapp.whatsapp_Message_IsCarbon_Get(self.handle)
2093
+ @IsCarbon.setter
2094
+ def IsCarbon(self, value):
2095
+ if isinstance(value, go.GoClass):
2096
+ _whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value.handle)
2097
+ else:
2098
+ _whatsapp.whatsapp_Message_IsCarbon_Set(self.handle, value)
2099
+ @property
2100
+ def IsForwarded(self):
2101
+ return _whatsapp.whatsapp_Message_IsForwarded_Get(self.handle)
2102
+ @IsForwarded.setter
2103
+ def IsForwarded(self, value):
2104
+ if isinstance(value, go.GoClass):
2105
+ _whatsapp.whatsapp_Message_IsForwarded_Set(self.handle, value.handle)
2106
+ else:
2107
+ _whatsapp.whatsapp_Message_IsForwarded_Set(self.handle, value)
2108
+ @property
2109
+ def ReplyID(self):
2110
+ return _whatsapp.whatsapp_Message_ReplyID_Get(self.handle)
2111
+ @ReplyID.setter
2112
+ def ReplyID(self, value):
2113
+ if isinstance(value, go.GoClass):
2114
+ _whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value.handle)
2115
+ else:
2116
+ _whatsapp.whatsapp_Message_ReplyID_Set(self.handle, value)
2117
+ @property
2118
+ def ReplyBody(self):
2119
+ return _whatsapp.whatsapp_Message_ReplyBody_Get(self.handle)
2120
+ @ReplyBody.setter
2121
+ def ReplyBody(self, value):
2122
+ if isinstance(value, go.GoClass):
2123
+ _whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value.handle)
2124
+ else:
2125
+ _whatsapp.whatsapp_Message_ReplyBody_Set(self.handle, value)
2126
+ @property
2127
+ def Attachments(self):
2128
+ return Slice_whatsapp_Attachment(handle=_whatsapp.whatsapp_Message_Attachments_Get(self.handle))
2129
+ @Attachments.setter
2130
+ def Attachments(self, value):
2131
+ if isinstance(value, go.GoClass):
2132
+ _whatsapp.whatsapp_Message_Attachments_Set(self.handle, value.handle)
2236
2133
  else:
2237
2134
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2238
2135
  @property
2239
- def LoggedOut(self):
2240
- return LoggedOut(handle=_whatsapp.whatsapp_EventPayload_LoggedOut_Get(self.handle))
2241
- @LoggedOut.setter
2242
- def LoggedOut(self, value):
2136
+ def Preview(self):
2137
+ return Preview(handle=_whatsapp.whatsapp_Message_Preview_Get(self.handle))
2138
+ @Preview.setter
2139
+ def Preview(self, value):
2243
2140
  if isinstance(value, go.GoClass):
2244
- _whatsapp.whatsapp_EventPayload_LoggedOut_Set(self.handle, value.handle)
2141
+ _whatsapp.whatsapp_Message_Preview_Set(self.handle, value.handle)
2245
2142
  else:
2246
2143
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2247
2144
  @property
2248
- def Contact(self):
2249
- return Contact(handle=_whatsapp.whatsapp_EventPayload_Contact_Get(self.handle))
2250
- @Contact.setter
2251
- def Contact(self, value):
2145
+ def Location(self):
2146
+ return Location(handle=_whatsapp.whatsapp_Message_Location_Get(self.handle))
2147
+ @Location.setter
2148
+ def Location(self, value):
2252
2149
  if isinstance(value, go.GoClass):
2253
- _whatsapp.whatsapp_EventPayload_Contact_Set(self.handle, value.handle)
2150
+ _whatsapp.whatsapp_Message_Location_Set(self.handle, value.handle)
2254
2151
  else:
2255
2152
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2256
2153
  @property
2257
- def Presence(self):
2258
- return Presence(handle=_whatsapp.whatsapp_EventPayload_Presence_Get(self.handle))
2259
- @Presence.setter
2260
- def Presence(self, value):
2154
+ def Poll(self):
2155
+ return Poll(handle=_whatsapp.whatsapp_Message_Poll_Get(self.handle))
2156
+ @Poll.setter
2157
+ def Poll(self, value):
2261
2158
  if isinstance(value, go.GoClass):
2262
- _whatsapp.whatsapp_EventPayload_Presence_Set(self.handle, value.handle)
2159
+ _whatsapp.whatsapp_Message_Poll_Set(self.handle, value.handle)
2263
2160
  else:
2264
2161
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2265
2162
  @property
2266
- def Message(self):
2267
- return Message(handle=_whatsapp.whatsapp_EventPayload_Message_Get(self.handle))
2268
- @Message.setter
2269
- def Message(self, value):
2163
+ def Album(self):
2164
+ return Album(handle=_whatsapp.whatsapp_Message_Album_Get(self.handle))
2165
+ @Album.setter
2166
+ def Album(self, value):
2270
2167
  if isinstance(value, go.GoClass):
2271
- _whatsapp.whatsapp_EventPayload_Message_Set(self.handle, value.handle)
2168
+ _whatsapp.whatsapp_Message_Album_Set(self.handle, value.handle)
2272
2169
  else:
2273
2170
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2274
2171
  @property
2275
- def ChatState(self):
2276
- return ChatState(handle=_whatsapp.whatsapp_EventPayload_ChatState_Get(self.handle))
2277
- @ChatState.setter
2278
- def ChatState(self, value):
2172
+ def GroupInvite(self):
2173
+ return Group(handle=_whatsapp.whatsapp_Message_GroupInvite_Get(self.handle))
2174
+ @GroupInvite.setter
2175
+ def GroupInvite(self, value):
2279
2176
  if isinstance(value, go.GoClass):
2280
- _whatsapp.whatsapp_EventPayload_ChatState_Set(self.handle, value.handle)
2177
+ _whatsapp.whatsapp_Message_GroupInvite_Set(self.handle, value.handle)
2281
2178
  else:
2282
2179
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2283
2180
  @property
2284
- def Receipt(self):
2285
- return Receipt(handle=_whatsapp.whatsapp_EventPayload_Receipt_Get(self.handle))
2286
- @Receipt.setter
2287
- def Receipt(self, value):
2181
+ def MentionJIDs(self):
2182
+ return go.Slice_string(handle=_whatsapp.whatsapp_Message_MentionJIDs_Get(self.handle))
2183
+ @MentionJIDs.setter
2184
+ def MentionJIDs(self, value):
2288
2185
  if isinstance(value, go.GoClass):
2289
- _whatsapp.whatsapp_EventPayload_Receipt_Set(self.handle, value.handle)
2186
+ _whatsapp.whatsapp_Message_MentionJIDs_Set(self.handle, value.handle)
2290
2187
  else:
2291
2188
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2292
2189
  @property
2293
- def Group(self):
2294
- return Group(handle=_whatsapp.whatsapp_EventPayload_Group_Get(self.handle))
2295
- @Group.setter
2296
- def Group(self, value):
2190
+ def Receipts(self):
2191
+ return Slice_whatsapp_Receipt(handle=_whatsapp.whatsapp_Message_Receipts_Get(self.handle))
2192
+ @Receipts.setter
2193
+ def Receipts(self, value):
2297
2194
  if isinstance(value, go.GoClass):
2298
- _whatsapp.whatsapp_EventPayload_Group_Set(self.handle, value.handle)
2195
+ _whatsapp.whatsapp_Message_Receipts_Set(self.handle, value.handle)
2299
2196
  else:
2300
2197
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2301
2198
  @property
2302
- def Call(self):
2303
- return Call(handle=_whatsapp.whatsapp_EventPayload_Call_Get(self.handle))
2304
- @Call.setter
2305
- def Call(self, value):
2199
+ def Reactions(self):
2200
+ return Slice_whatsapp_Message(handle=_whatsapp.whatsapp_Message_Reactions_Get(self.handle))
2201
+ @Reactions.setter
2202
+ def Reactions(self, value):
2306
2203
  if isinstance(value, go.GoClass):
2307
- _whatsapp.whatsapp_EventPayload_Call_Set(self.handle, value.handle)
2204
+ _whatsapp.whatsapp_Message_Reactions_Set(self.handle, value.handle)
2308
2205
  else:
2309
2206
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2207
+ @property
2208
+ def IsHistory(self):
2209
+ return _whatsapp.whatsapp_Message_IsHistory_Get(self.handle)
2210
+ @IsHistory.setter
2211
+ def IsHistory(self, value):
2212
+ if isinstance(value, go.GoClass):
2213
+ _whatsapp.whatsapp_Message_IsHistory_Set(self.handle, value.handle)
2214
+ else:
2215
+ _whatsapp.whatsapp_Message_IsHistory_Set(self.handle, value)
2310
2216
 
2311
- # Python type for struct whatsapp.Gateway
2312
- class Gateway(go.GoClass):
2313
- """A Gateway represents a persistent process for establishing individual sessions between linked\ndevices and WhatsApp.\n"""
2217
+ # Python type for struct whatsapp.Album
2218
+ class Album(go.GoClass):
2219
+ """A Album message represents a collection of media files, typically images and videos.\n"""
2314
2220
  def __init__(self, *args, **kwargs):
2315
2221
  """
2316
2222
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2324,29 +2230,25 @@ class Gateway(go.GoClass):
2324
2230
  self.handle = args[0].handle
2325
2231
  _whatsapp.IncRef(self.handle)
2326
2232
  else:
2327
- self.handle = _whatsapp.whatsapp_Gateway_CTor()
2233
+ self.handle = _whatsapp.whatsapp_Album_CTor()
2328
2234
  _whatsapp.IncRef(self.handle)
2329
2235
  if 0 < len(args):
2330
- self.DBPath = args[0]
2331
- if "DBPath" in kwargs:
2332
- self.DBPath = kwargs["DBPath"]
2236
+ self.IsAlbum = args[0]
2237
+ if "IsAlbum" in kwargs:
2238
+ self.IsAlbum = kwargs["IsAlbum"]
2333
2239
  if 1 < len(args):
2334
- self.Name = args[1]
2335
- if "Name" in kwargs:
2336
- self.Name = kwargs["Name"]
2240
+ self.ImageCount = args[1]
2241
+ if "ImageCount" in kwargs:
2242
+ self.ImageCount = kwargs["ImageCount"]
2337
2243
  if 2 < len(args):
2338
- self.LogLevel = args[2]
2339
- if "LogLevel" in kwargs:
2340
- self.LogLevel = kwargs["LogLevel"]
2341
- if 3 < len(args):
2342
- self.TempDir = args[3]
2343
- if "TempDir" in kwargs:
2344
- self.TempDir = kwargs["TempDir"]
2244
+ self.VideoCount = args[2]
2245
+ if "VideoCount" in kwargs:
2246
+ self.VideoCount = kwargs["VideoCount"]
2345
2247
  def __del__(self):
2346
2248
  _whatsapp.DecRef(self.handle)
2347
2249
  def __str__(self):
2348
2250
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2349
- sv = 'whatsapp.Gateway{'
2251
+ sv = 'whatsapp.Album{'
2350
2252
  first = True
2351
2253
  for v in pr:
2352
2254
  if callable(v[1]):
@@ -2359,72 +2261,42 @@ class Gateway(go.GoClass):
2359
2261
  return sv + '}'
2360
2262
  def __repr__(self):
2361
2263
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2362
- sv = 'whatsapp.Gateway ( '
2264
+ sv = 'whatsapp.Album ( '
2363
2265
  for v in pr:
2364
2266
  if not callable(v[1]):
2365
2267
  sv += v[0] + '=' + str(v[1]) + ', '
2366
2268
  return sv + ')'
2367
2269
  @property
2368
- def DBPath(self):
2369
- return _whatsapp.whatsapp_Gateway_DBPath_Get(self.handle)
2370
- @DBPath.setter
2371
- def DBPath(self, value):
2372
- if isinstance(value, go.GoClass):
2373
- _whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value.handle)
2374
- else:
2375
- _whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value)
2376
- @property
2377
- def Name(self):
2378
- return _whatsapp.whatsapp_Gateway_Name_Get(self.handle)
2379
- @Name.setter
2380
- def Name(self, value):
2270
+ def IsAlbum(self):
2271
+ return _whatsapp.whatsapp_Album_IsAlbum_Get(self.handle)
2272
+ @IsAlbum.setter
2273
+ def IsAlbum(self, value):
2381
2274
  if isinstance(value, go.GoClass):
2382
- _whatsapp.whatsapp_Gateway_Name_Set(self.handle, value.handle)
2275
+ _whatsapp.whatsapp_Album_IsAlbum_Set(self.handle, value.handle)
2383
2276
  else:
2384
- _whatsapp.whatsapp_Gateway_Name_Set(self.handle, value)
2277
+ _whatsapp.whatsapp_Album_IsAlbum_Set(self.handle, value)
2385
2278
  @property
2386
- def LogLevel(self):
2387
- return _whatsapp.whatsapp_Gateway_LogLevel_Get(self.handle)
2388
- @LogLevel.setter
2389
- def LogLevel(self, value):
2279
+ def ImageCount(self):
2280
+ return _whatsapp.whatsapp_Album_ImageCount_Get(self.handle)
2281
+ @ImageCount.setter
2282
+ def ImageCount(self, value):
2390
2283
  if isinstance(value, go.GoClass):
2391
- _whatsapp.whatsapp_Gateway_LogLevel_Set(self.handle, value.handle)
2284
+ _whatsapp.whatsapp_Album_ImageCount_Set(self.handle, value.handle)
2392
2285
  else:
2393
- _whatsapp.whatsapp_Gateway_LogLevel_Set(self.handle, value)
2286
+ _whatsapp.whatsapp_Album_ImageCount_Set(self.handle, value)
2394
2287
  @property
2395
- def TempDir(self):
2396
- return _whatsapp.whatsapp_Gateway_TempDir_Get(self.handle)
2397
- @TempDir.setter
2398
- def TempDir(self, value):
2288
+ def VideoCount(self):
2289
+ return _whatsapp.whatsapp_Album_VideoCount_Get(self.handle)
2290
+ @VideoCount.setter
2291
+ def VideoCount(self, value):
2399
2292
  if isinstance(value, go.GoClass):
2400
- _whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value.handle)
2293
+ _whatsapp.whatsapp_Album_VideoCount_Set(self.handle, value.handle)
2401
2294
  else:
2402
- _whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value)
2403
- def Init(self):
2404
- """Init() str
2405
-
2406
- Init performs initialization procedures for the Gateway, and is expected to be run before any
2407
- calls to [Gateway.Session].
2408
- """
2409
- return _whatsapp.whatsapp_Gateway_Init(self.handle)
2410
- def NewSession(self, device):
2411
- """NewSession(object device) object
2412
-
2413
- NewSession returns a new [Session] for the LinkedDevice given. If the linked device does not have
2414
- a valid ID, a pair operation will be required, as described in [Session.Login].
2415
- """
2416
- return Session(handle=_whatsapp.whatsapp_Gateway_NewSession(self.handle, device.handle))
2417
- def CleanupSession(self, device):
2418
- """CleanupSession(object device) str
2419
-
2420
- CleanupSession will remove all invalid and obsolete references to the given device, and should be
2421
- used when pairing a new device or unregistering from the Gateway.
2422
- """
2423
- return _whatsapp.whatsapp_Gateway_CleanupSession(self.handle, device.handle)
2295
+ _whatsapp.whatsapp_Album_VideoCount_Set(self.handle, value)
2424
2296
 
2425
- # Python type for struct whatsapp.LoggedOut
2426
- class LoggedOut(go.GoClass):
2427
- """LoggedOut repreents event data related to an explicit or implicit log-out event.\n"""
2297
+ # Python type for struct whatsapp.Attachment
2298
+ class Attachment(go.GoClass):
2299
+ """A Attachment represents additional binary data (e.g. images, videos, documents) provided alongside\na message, for display or storage on the recepient client.\n"""
2428
2300
  def __init__(self, *args, **kwargs):
2429
2301
  """
2430
2302
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2438,17 +2310,29 @@ class LoggedOut(go.GoClass):
2438
2310
  self.handle = args[0].handle
2439
2311
  _whatsapp.IncRef(self.handle)
2440
2312
  else:
2441
- self.handle = _whatsapp.whatsapp_LoggedOut_CTor()
2313
+ self.handle = _whatsapp.whatsapp_Attachment_CTor()
2442
2314
  _whatsapp.IncRef(self.handle)
2443
2315
  if 0 < len(args):
2444
- self.Reason = args[0]
2445
- if "Reason" in kwargs:
2446
- self.Reason = kwargs["Reason"]
2316
+ self.MIME = args[0]
2317
+ if "MIME" in kwargs:
2318
+ self.MIME = kwargs["MIME"]
2319
+ if 1 < len(args):
2320
+ self.Filename = args[1]
2321
+ if "Filename" in kwargs:
2322
+ self.Filename = kwargs["Filename"]
2323
+ if 2 < len(args):
2324
+ self.Caption = args[2]
2325
+ if "Caption" in kwargs:
2326
+ self.Caption = kwargs["Caption"]
2327
+ if 3 < len(args):
2328
+ self.Data = args[3]
2329
+ if "Data" in kwargs:
2330
+ self.Data = kwargs["Data"]
2447
2331
  def __del__(self):
2448
2332
  _whatsapp.DecRef(self.handle)
2449
2333
  def __str__(self):
2450
2334
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2451
- sv = 'whatsapp.LoggedOut{'
2335
+ sv = 'whatsapp.Attachment{'
2452
2336
  first = True
2453
2337
  for v in pr:
2454
2338
  if callable(v[1]):
@@ -2461,24 +2345,57 @@ class LoggedOut(go.GoClass):
2461
2345
  return sv + '}'
2462
2346
  def __repr__(self):
2463
2347
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2464
- sv = 'whatsapp.LoggedOut ( '
2348
+ sv = 'whatsapp.Attachment ( '
2465
2349
  for v in pr:
2466
2350
  if not callable(v[1]):
2467
2351
  sv += v[0] + '=' + str(v[1]) + ', '
2468
2352
  return sv + ')'
2469
2353
  @property
2470
- def Reason(self):
2471
- return _whatsapp.whatsapp_LoggedOut_Reason_Get(self.handle)
2472
- @Reason.setter
2473
- def Reason(self, value):
2354
+ def MIME(self):
2355
+ return _whatsapp.whatsapp_Attachment_MIME_Get(self.handle)
2356
+ @MIME.setter
2357
+ def MIME(self, value):
2474
2358
  if isinstance(value, go.GoClass):
2475
- _whatsapp.whatsapp_LoggedOut_Reason_Set(self.handle, value.handle)
2359
+ _whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value.handle)
2476
2360
  else:
2477
- _whatsapp.whatsapp_LoggedOut_Reason_Set(self.handle, value)
2361
+ _whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value)
2362
+ @property
2363
+ def Filename(self):
2364
+ return _whatsapp.whatsapp_Attachment_Filename_Get(self.handle)
2365
+ @Filename.setter
2366
+ def Filename(self, value):
2367
+ if isinstance(value, go.GoClass):
2368
+ _whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value.handle)
2369
+ else:
2370
+ _whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value)
2371
+ @property
2372
+ def Caption(self):
2373
+ return _whatsapp.whatsapp_Attachment_Caption_Get(self.handle)
2374
+ @Caption.setter
2375
+ def Caption(self, value):
2376
+ if isinstance(value, go.GoClass):
2377
+ _whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value.handle)
2378
+ else:
2379
+ _whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value)
2380
+ @property
2381
+ def Data(self):
2382
+ return go.Slice_byte(handle=_whatsapp.whatsapp_Attachment_Data_Get(self.handle))
2383
+ @Data.setter
2384
+ def Data(self, value):
2385
+ if isinstance(value, go.GoClass):
2386
+ _whatsapp.whatsapp_Attachment_Data_Set(self.handle, value.handle)
2387
+ else:
2388
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2389
+ def GetSpec(self, ctx):
2390
+ """GetSpec(object ctx) object, str
2391
+
2392
+ GetSpec returns metadata for this attachment, as derived from the underlying attachment data.
2393
+ """
2394
+ return go.Ptr_media_Spec(handle=_whatsapp.whatsapp_Attachment_GetSpec(self.handle, ctx.handle))
2478
2395
 
2479
- # Python type for struct whatsapp.Session
2480
- class Session(go.GoClass):
2481
- """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"""
2396
+ # Python type for struct whatsapp.Contact
2397
+ class Contact(go.GoClass):
2398
+ """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"""
2482
2399
  def __init__(self, *args, **kwargs):
2483
2400
  """
2484
2401
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2492,13 +2409,21 @@ class Session(go.GoClass):
2492
2409
  self.handle = args[0].handle
2493
2410
  _whatsapp.IncRef(self.handle)
2494
2411
  else:
2495
- self.handle = _whatsapp.whatsapp_Session_CTor()
2412
+ self.handle = _whatsapp.whatsapp_Contact_CTor()
2496
2413
  _whatsapp.IncRef(self.handle)
2414
+ if 0 < len(args):
2415
+ self.JID = args[0]
2416
+ if "JID" in kwargs:
2417
+ self.JID = kwargs["JID"]
2418
+ if 1 < len(args):
2419
+ self.Name = args[1]
2420
+ if "Name" in kwargs:
2421
+ self.Name = kwargs["Name"]
2497
2422
  def __del__(self):
2498
2423
  _whatsapp.DecRef(self.handle)
2499
2424
  def __str__(self):
2500
2425
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2501
- sv = 'whatsapp.Session{'
2426
+ sv = 'whatsapp.Contact{'
2502
2427
  first = True
2503
2428
  for v in pr:
2504
2429
  if callable(v[1]):
@@ -2511,167 +2436,97 @@ class Session(go.GoClass):
2511
2436
  return sv + '}'
2512
2437
  def __repr__(self):
2513
2438
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2514
- sv = 'whatsapp.Session ( '
2439
+ sv = 'whatsapp.Contact ( '
2515
2440
  for v in pr:
2516
2441
  if not callable(v[1]):
2517
2442
  sv += v[0] + '=' + str(v[1]) + ', '
2518
2443
  return sv + ')'
2519
- def Login(self):
2520
- """Login() str
2521
-
2522
- Login attempts to authenticate the given [Session], either by re-using the [LinkedDevice] attached
2523
- or by initiating a pairing session for a new linked device. Callers are expected to have set an
2524
- event handler in order to receive any incoming events from the underlying WhatsApp session.
2525
- """
2526
- return _whatsapp.whatsapp_Session_Login(self.handle)
2527
- def Logout(self):
2528
- """Logout() str
2529
-
2530
- Logout disconnects and removes the current linked device locally and initiates a logout remotely.
2531
- """
2532
- return _whatsapp.whatsapp_Session_Logout(self.handle)
2533
- def Disconnect(self):
2534
- """Disconnect() str
2535
-
2536
- Disconnects detaches the current connection to WhatsApp without removing any linked device state.
2537
- """
2538
- return _whatsapp.whatsapp_Session_Disconnect(self.handle)
2539
- def PairPhone(self, phone):
2540
- """PairPhone(str phone) str, str
2541
-
2542
- PairPhone returns a one-time code from WhatsApp, used for pairing this [Session] against the
2543
- user's primary device, as identified by the given phone number. This will return an error if the
2544
- [Session] is already paired, or if the phone number given is empty or invalid.
2545
- """
2546
- return _whatsapp.whatsapp_Session_PairPhone(self.handle, phone)
2547
- def SendMessage(self, message):
2548
- """SendMessage(object message) str
2549
-
2550
- SendMessage processes the given Message and sends a WhatsApp message for the kind and contact JID
2551
- specified within. In general, different message kinds require different fields to be set; see the
2552
- documentation for the [Message] type for more information.
2553
- """
2554
- return _whatsapp.whatsapp_Session_SendMessage(self.handle, message.handle)
2555
- def GenerateMessageID(self):
2556
- """GenerateMessageID() str
2557
-
2558
- GenerateMessageID returns a valid, pseudo-random message ID for use in outgoing messages.
2559
- """
2560
- return _whatsapp.whatsapp_Session_GenerateMessageID(self.handle)
2561
- def SendChatState(self, state):
2562
- """SendChatState(object state) str
2563
-
2564
- SendChatState sends the given chat state notification (e.g. composing message) to WhatsApp for the
2565
- contact specified within.
2566
- """
2567
- return _whatsapp.whatsapp_Session_SendChatState(self.handle, state.handle)
2568
- def SendReceipt(self, receipt):
2569
- """SendReceipt(object receipt) str
2570
-
2571
- SendReceipt sends a read receipt to WhatsApp for the message IDs specified within.
2572
- """
2573
- return _whatsapp.whatsapp_Session_SendReceipt(self.handle, receipt.handle)
2574
- def SendPresence(self, presence, statusMessage):
2575
- """SendPresence(int presence, str statusMessage) str
2576
-
2577
- SendPresence sets the activity state and (optional) status message for the current session and
2578
- user. An error is returned if setting availability fails for any reason.
2579
- """
2580
- return _whatsapp.whatsapp_Session_SendPresence(self.handle, presence, statusMessage)
2581
- def GetContacts(self, refresh):
2582
- """GetContacts(bool refresh) []object, str
2583
-
2584
- GetContacts subscribes to the WhatsApp roster currently stored in the Session's internal state.
2585
- If `refresh` is `true`, FetchRoster will pull application state from the remote service and
2586
- synchronize any contacts found with the adapter.
2587
- """
2588
- return Slice_whatsapp_Contact(handle=_whatsapp.whatsapp_Session_GetContacts(self.handle, refresh))
2589
- def GetGroups(self):
2590
- """GetGroups() []object, str
2591
-
2592
- GetGroups returns a list of all group-chats currently joined in WhatsApp, along with additional
2593
- information on present participants.
2594
- """
2595
- return Slice_whatsapp_Group(handle=_whatsapp.whatsapp_Session_GetGroups(self.handle))
2596
- def CreateGroup(self, name, participants):
2597
- """CreateGroup(str name, []str participants) object, str
2598
-
2599
- CreateGroup attempts to create a new WhatsApp group for the given human-readable name and
2600
- participant JIDs given.
2601
- """
2602
- return Group(handle=_whatsapp.whatsapp_Session_CreateGroup(self.handle, name, participants.handle))
2603
- def LeaveGroup(self, resourceID):
2604
- """LeaveGroup(str resourceID) str
2605
-
2606
- LeaveGroup attempts to remove our own user from the given WhatsApp group, for the JID given.
2607
- """
2608
- return _whatsapp.whatsapp_Session_LeaveGroup(self.handle, resourceID)
2609
- def GetAvatar(self, resourceID, avatarID):
2610
- """GetAvatar(str resourceID, str avatarID) object, str
2611
-
2612
- GetAvatar fetches a profile picture for the Contact or Group JID given. If a non-empty `avatarID`
2613
- is also given, GetAvatar will return an empty [Avatar] instance with no error if the remote state
2614
- for the given ID has not changed.
2615
- """
2616
- return Avatar(handle=_whatsapp.whatsapp_Session_GetAvatar(self.handle, resourceID, avatarID))
2617
- def SetAvatar(self, resourceID, avatar):
2618
- """SetAvatar(str resourceID, []int avatar) str, str
2619
-
2620
- SetAvatar updates the profile picture for the Contact or Group JID given; it can also update the
2621
- profile picture for our own user by providing an empty JID. The unique picture ID is returned,
2622
- typically used as a cache reference or in providing to future calls for [Session.GetAvatar].
2623
- """
2624
- return _whatsapp.whatsapp_Session_SetAvatar(self.handle, resourceID, avatar.handle)
2625
- def SetGroupName(self, resourceID, name):
2626
- """SetGroupName(str resourceID, str name) str
2627
-
2628
- SetGroupName updates the name of a WhatsApp group for the Group JID given.
2629
- """
2630
- return _whatsapp.whatsapp_Session_SetGroupName(self.handle, resourceID, name)
2631
- def SetGroupTopic(self, resourceID, topic):
2632
- """SetGroupTopic(str resourceID, str topic) str
2633
-
2634
- SetGroupName updates the topic of a WhatsApp group for the Group JID given.
2635
- """
2636
- return _whatsapp.whatsapp_Session_SetGroupTopic(self.handle, resourceID, topic)
2637
- def UpdateGroupParticipants(self, resourceID, participants):
2638
- """UpdateGroupParticipants(str resourceID, []object participants) []object, str
2639
-
2640
- UpdateGroupParticipants processes changes to the given group's participants, including additions,
2641
- removals, and changes to privileges. Participant JIDs given must be part of the authenticated
2642
- session's roster at least, and must also be active group participants for other types of changes.
2444
+ @property
2445
+ def JID(self):
2446
+ return _whatsapp.whatsapp_Contact_JID_Get(self.handle)
2447
+ @JID.setter
2448
+ def JID(self, value):
2449
+ if isinstance(value, go.GoClass):
2450
+ _whatsapp.whatsapp_Contact_JID_Set(self.handle, value.handle)
2451
+ else:
2452
+ _whatsapp.whatsapp_Contact_JID_Set(self.handle, value)
2453
+ @property
2454
+ def Name(self):
2455
+ return _whatsapp.whatsapp_Contact_Name_Get(self.handle)
2456
+ @Name.setter
2457
+ def Name(self, value):
2458
+ if isinstance(value, go.GoClass):
2459
+ _whatsapp.whatsapp_Contact_Name_Set(self.handle, value.handle)
2460
+ else:
2461
+ _whatsapp.whatsapp_Contact_Name_Set(self.handle, value)
2462
+
2463
+ # Python type for struct whatsapp.LinkedDevice
2464
+ class LinkedDevice(go.GoClass):
2465
+ """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"""
2466
+ def __init__(self, *args, **kwargs):
2643
2467
  """
2644
- return Slice_whatsapp_GroupParticipant(handle=_whatsapp.whatsapp_Session_UpdateGroupParticipants(self.handle, resourceID, participants.handle))
2645
- def FindContact(self, phone):
2646
- """FindContact(str phone) object, str
2647
-
2648
- FindContact attempts to check for a registered contact on WhatsApp corresponding to the given
2649
- phone number, returning a concrete instance if found; typically, only the contact JID is set. No
2650
- error is returned if no contact was found, but any unexpected errors will otherwise be returned
2651
- directly.
2468
+ handle=A Go-side object is always initialized with an explicit handle=arg
2469
+ otherwise parameters can be unnamed in order of field names or named fields
2470
+ in which case a new Go object is constructed first
2652
2471
  """
2653
- return Contact(handle=_whatsapp.whatsapp_Session_FindContact(self.handle, phone))
2654
- def RequestMessageHistory(self, resourceID, oldestMessage):
2655
- """RequestMessageHistory(str resourceID, object oldestMessage) str
2656
-
2657
- RequestMessageHistory sends and asynchronous request for message history related to the given
2658
- resource (e.g. Contact or Group JID), ending at the oldest message given. Messages returned from
2659
- history should then be handled as a `HistorySync` event of type `ON_DEMAND`, in the session-wide
2660
- event handler. An error will be returned if requesting history fails for any reason.
2472
+ if len(kwargs) == 1 and 'handle' in kwargs:
2473
+ self.handle = kwargs['handle']
2474
+ _whatsapp.IncRef(self.handle)
2475
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2476
+ self.handle = args[0].handle
2477
+ _whatsapp.IncRef(self.handle)
2478
+ else:
2479
+ self.handle = _whatsapp.whatsapp_LinkedDevice_CTor()
2480
+ _whatsapp.IncRef(self.handle)
2481
+ if 0 < len(args):
2482
+ self.ID = args[0]
2483
+ if "ID" in kwargs:
2484
+ self.ID = kwargs["ID"]
2485
+ def __del__(self):
2486
+ _whatsapp.DecRef(self.handle)
2487
+ def __str__(self):
2488
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2489
+ sv = 'whatsapp.LinkedDevice{'
2490
+ first = True
2491
+ for v in pr:
2492
+ if callable(v[1]):
2493
+ continue
2494
+ if first:
2495
+ first = False
2496
+ else:
2497
+ sv += ', '
2498
+ sv += v[0] + '=' + str(v[1])
2499
+ return sv + '}'
2500
+ def __repr__(self):
2501
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2502
+ sv = 'whatsapp.LinkedDevice ( '
2503
+ for v in pr:
2504
+ if not callable(v[1]):
2505
+ sv += v[0] + '=' + str(v[1]) + ', '
2506
+ return sv + ')'
2507
+ @property
2508
+ def ID(self):
2509
+ """ID is an opaque string identifying this LinkedDevice to the Session. Noted that this string
2510
+ is currently equivalent to a password, and needs to be protected accordingly.
2661
2511
  """
2662
- return _whatsapp.whatsapp_Session_RequestMessageHistory(self.handle, resourceID, oldestMessage.handle)
2663
- def SetEventHandler(self, h, goRun=False):
2664
- """SetEventHandler(callable h)
2512
+ return _whatsapp.whatsapp_LinkedDevice_ID_Get(self.handle)
2513
+ @ID.setter
2514
+ def ID(self, value):
2515
+ if isinstance(value, go.GoClass):
2516
+ _whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value.handle)
2517
+ else:
2518
+ _whatsapp.whatsapp_LinkedDevice_ID_Set(self.handle, value)
2519
+ def JID(self):
2520
+ """JID() object
2665
2521
 
2666
- SetEventHandler assigns the given handler function for propagating internal events into the Python
2667
- gateway. Note that the event handler function is not entirely safe to use directly, and all calls
2668
- should instead be sent to the [Gateway] via its internal call channel.
2522
+ JID returns the WhatsApp JID corresponding to the LinkedDevice ID. Empty or invalid device IDs
2523
+ may return invalid JIDs, and this function does not handle errors.
2669
2524
  """
2670
- _whatsapp.whatsapp_Session_SetEventHandler(self.handle, h, goRun)
2525
+ return go.types_JID(handle=_whatsapp.whatsapp_LinkedDevice_JID(self.handle))
2671
2526
 
2672
- # Python type for struct whatsapp.Album
2673
- class Album(go.GoClass):
2674
- """A Album message represents a collection of media files, typically images and videos.\n"""
2527
+ # Python type for struct whatsapp.LoggedOut
2528
+ class LoggedOut(go.GoClass):
2529
+ """LoggedOut repreents event data related to an explicit or implicit log-out event.\n"""
2675
2530
  def __init__(self, *args, **kwargs):
2676
2531
  """
2677
2532
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2685,25 +2540,17 @@ class Album(go.GoClass):
2685
2540
  self.handle = args[0].handle
2686
2541
  _whatsapp.IncRef(self.handle)
2687
2542
  else:
2688
- self.handle = _whatsapp.whatsapp_Album_CTor()
2543
+ self.handle = _whatsapp.whatsapp_LoggedOut_CTor()
2689
2544
  _whatsapp.IncRef(self.handle)
2690
2545
  if 0 < len(args):
2691
- self.IsAlbum = args[0]
2692
- if "IsAlbum" in kwargs:
2693
- self.IsAlbum = kwargs["IsAlbum"]
2694
- if 1 < len(args):
2695
- self.ImageCount = args[1]
2696
- if "ImageCount" in kwargs:
2697
- self.ImageCount = kwargs["ImageCount"]
2698
- if 2 < len(args):
2699
- self.VideoCount = args[2]
2700
- if "VideoCount" in kwargs:
2701
- self.VideoCount = kwargs["VideoCount"]
2546
+ self.Reason = args[0]
2547
+ if "Reason" in kwargs:
2548
+ self.Reason = kwargs["Reason"]
2702
2549
  def __del__(self):
2703
2550
  _whatsapp.DecRef(self.handle)
2704
2551
  def __str__(self):
2705
2552
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2706
- sv = 'whatsapp.Album{'
2553
+ sv = 'whatsapp.LoggedOut{'
2707
2554
  first = True
2708
2555
  for v in pr:
2709
2556
  if callable(v[1]):
@@ -2716,42 +2563,24 @@ class Album(go.GoClass):
2716
2563
  return sv + '}'
2717
2564
  def __repr__(self):
2718
2565
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2719
- sv = 'whatsapp.Album ( '
2566
+ sv = 'whatsapp.LoggedOut ( '
2720
2567
  for v in pr:
2721
2568
  if not callable(v[1]):
2722
2569
  sv += v[0] + '=' + str(v[1]) + ', '
2723
2570
  return sv + ')'
2724
2571
  @property
2725
- def IsAlbum(self):
2726
- return _whatsapp.whatsapp_Album_IsAlbum_Get(self.handle)
2727
- @IsAlbum.setter
2728
- def IsAlbum(self, value):
2729
- if isinstance(value, go.GoClass):
2730
- _whatsapp.whatsapp_Album_IsAlbum_Set(self.handle, value.handle)
2731
- else:
2732
- _whatsapp.whatsapp_Album_IsAlbum_Set(self.handle, value)
2733
- @property
2734
- def ImageCount(self):
2735
- return _whatsapp.whatsapp_Album_ImageCount_Get(self.handle)
2736
- @ImageCount.setter
2737
- def ImageCount(self, value):
2738
- if isinstance(value, go.GoClass):
2739
- _whatsapp.whatsapp_Album_ImageCount_Set(self.handle, value.handle)
2740
- else:
2741
- _whatsapp.whatsapp_Album_ImageCount_Set(self.handle, value)
2742
- @property
2743
- def VideoCount(self):
2744
- return _whatsapp.whatsapp_Album_VideoCount_Get(self.handle)
2745
- @VideoCount.setter
2746
- def VideoCount(self, value):
2572
+ def Reason(self):
2573
+ return _whatsapp.whatsapp_LoggedOut_Reason_Get(self.handle)
2574
+ @Reason.setter
2575
+ def Reason(self, value):
2747
2576
  if isinstance(value, go.GoClass):
2748
- _whatsapp.whatsapp_Album_VideoCount_Set(self.handle, value.handle)
2577
+ _whatsapp.whatsapp_LoggedOut_Reason_Set(self.handle, value.handle)
2749
2578
  else:
2750
- _whatsapp.whatsapp_Album_VideoCount_Set(self.handle, value)
2579
+ _whatsapp.whatsapp_LoggedOut_Reason_Set(self.handle, value)
2751
2580
 
2752
- # Python type for struct whatsapp.Attachment
2753
- class Attachment(go.GoClass):
2754
- """A Attachment represents additional binary data (e.g. images, videos, documents) provided alongside\na message, for display or storage on the recepient client.\n"""
2581
+ # Python type for struct whatsapp.ChatState
2582
+ class ChatState(go.GoClass):
2583
+ """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"""
2755
2584
  def __init__(self, *args, **kwargs):
2756
2585
  """
2757
2586
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2765,29 +2594,25 @@ class Attachment(go.GoClass):
2765
2594
  self.handle = args[0].handle
2766
2595
  _whatsapp.IncRef(self.handle)
2767
2596
  else:
2768
- self.handle = _whatsapp.whatsapp_Attachment_CTor()
2597
+ self.handle = _whatsapp.whatsapp_ChatState_CTor()
2769
2598
  _whatsapp.IncRef(self.handle)
2770
2599
  if 0 < len(args):
2771
- self.MIME = args[0]
2772
- if "MIME" in kwargs:
2773
- self.MIME = kwargs["MIME"]
2600
+ self.Kind = args[0]
2601
+ if "Kind" in kwargs:
2602
+ self.Kind = kwargs["Kind"]
2774
2603
  if 1 < len(args):
2775
- self.Filename = args[1]
2776
- if "Filename" in kwargs:
2777
- self.Filename = kwargs["Filename"]
2604
+ self.JID = args[1]
2605
+ if "JID" in kwargs:
2606
+ self.JID = kwargs["JID"]
2778
2607
  if 2 < len(args):
2779
- self.Caption = args[2]
2780
- if "Caption" in kwargs:
2781
- self.Caption = kwargs["Caption"]
2782
- if 3 < len(args):
2783
- self.Data = args[3]
2784
- if "Data" in kwargs:
2785
- self.Data = kwargs["Data"]
2608
+ self.GroupJID = args[2]
2609
+ if "GroupJID" in kwargs:
2610
+ self.GroupJID = kwargs["GroupJID"]
2786
2611
  def __del__(self):
2787
2612
  _whatsapp.DecRef(self.handle)
2788
2613
  def __str__(self):
2789
2614
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2790
- sv = 'whatsapp.Attachment{'
2615
+ sv = 'whatsapp.ChatState{'
2791
2616
  first = True
2792
2617
  for v in pr:
2793
2618
  if callable(v[1]):
@@ -2800,57 +2625,109 @@ class Attachment(go.GoClass):
2800
2625
  return sv + '}'
2801
2626
  def __repr__(self):
2802
2627
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2803
- sv = 'whatsapp.Attachment ( '
2628
+ sv = 'whatsapp.ChatState ( '
2804
2629
  for v in pr:
2805
2630
  if not callable(v[1]):
2806
2631
  sv += v[0] + '=' + str(v[1]) + ', '
2807
2632
  return sv + ')'
2808
2633
  @property
2809
- def MIME(self):
2810
- return _whatsapp.whatsapp_Attachment_MIME_Get(self.handle)
2811
- @MIME.setter
2812
- def MIME(self, value):
2634
+ def Kind(self):
2635
+ return _whatsapp.whatsapp_ChatState_Kind_Get(self.handle)
2636
+ @Kind.setter
2637
+ def Kind(self, value):
2813
2638
  if isinstance(value, go.GoClass):
2814
- _whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value.handle)
2639
+ _whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value.handle)
2815
2640
  else:
2816
- _whatsapp.whatsapp_Attachment_MIME_Set(self.handle, value)
2641
+ _whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value)
2817
2642
  @property
2818
- def Filename(self):
2819
- return _whatsapp.whatsapp_Attachment_Filename_Get(self.handle)
2820
- @Filename.setter
2821
- def Filename(self, value):
2643
+ def JID(self):
2644
+ return _whatsapp.whatsapp_ChatState_JID_Get(self.handle)
2645
+ @JID.setter
2646
+ def JID(self, value):
2822
2647
  if isinstance(value, go.GoClass):
2823
- _whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value.handle)
2648
+ _whatsapp.whatsapp_ChatState_JID_Set(self.handle, value.handle)
2824
2649
  else:
2825
- _whatsapp.whatsapp_Attachment_Filename_Set(self.handle, value)
2650
+ _whatsapp.whatsapp_ChatState_JID_Set(self.handle, value)
2651
+ @property
2652
+ def GroupJID(self):
2653
+ return _whatsapp.whatsapp_ChatState_GroupJID_Get(self.handle)
2654
+ @GroupJID.setter
2655
+ def GroupJID(self, value):
2656
+ if isinstance(value, go.GoClass):
2657
+ _whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value.handle)
2658
+ else:
2659
+ _whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value)
2660
+
2661
+ # Python type for struct whatsapp.Connect
2662
+ class Connect(go.GoClass):
2663
+ """Connect represents event data related to a connection to WhatsApp being established, or failing\nto do so (based on the [Connect.Error] result).\n"""
2664
+ def __init__(self, *args, **kwargs):
2665
+ """
2666
+ handle=A Go-side object is always initialized with an explicit handle=arg
2667
+ otherwise parameters can be unnamed in order of field names or named fields
2668
+ in which case a new Go object is constructed first
2669
+ """
2670
+ if len(kwargs) == 1 and 'handle' in kwargs:
2671
+ self.handle = kwargs['handle']
2672
+ _whatsapp.IncRef(self.handle)
2673
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
2674
+ self.handle = args[0].handle
2675
+ _whatsapp.IncRef(self.handle)
2676
+ else:
2677
+ self.handle = _whatsapp.whatsapp_Connect_CTor()
2678
+ _whatsapp.IncRef(self.handle)
2679
+ if 0 < len(args):
2680
+ self.JID = args[0]
2681
+ if "JID" in kwargs:
2682
+ self.JID = kwargs["JID"]
2683
+ if 1 < len(args):
2684
+ self.Error = args[1]
2685
+ if "Error" in kwargs:
2686
+ self.Error = kwargs["Error"]
2687
+ def __del__(self):
2688
+ _whatsapp.DecRef(self.handle)
2689
+ def __str__(self):
2690
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2691
+ sv = 'whatsapp.Connect{'
2692
+ first = True
2693
+ for v in pr:
2694
+ if callable(v[1]):
2695
+ continue
2696
+ if first:
2697
+ first = False
2698
+ else:
2699
+ sv += ', '
2700
+ sv += v[0] + '=' + str(v[1])
2701
+ return sv + '}'
2702
+ def __repr__(self):
2703
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2704
+ sv = 'whatsapp.Connect ( '
2705
+ for v in pr:
2706
+ if not callable(v[1]):
2707
+ sv += v[0] + '=' + str(v[1]) + ', '
2708
+ return sv + ')'
2826
2709
  @property
2827
- def Caption(self):
2828
- return _whatsapp.whatsapp_Attachment_Caption_Get(self.handle)
2829
- @Caption.setter
2830
- def Caption(self, value):
2710
+ def JID(self):
2711
+ return _whatsapp.whatsapp_Connect_JID_Get(self.handle)
2712
+ @JID.setter
2713
+ def JID(self, value):
2831
2714
  if isinstance(value, go.GoClass):
2832
- _whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value.handle)
2715
+ _whatsapp.whatsapp_Connect_JID_Set(self.handle, value.handle)
2833
2716
  else:
2834
- _whatsapp.whatsapp_Attachment_Caption_Set(self.handle, value)
2717
+ _whatsapp.whatsapp_Connect_JID_Set(self.handle, value)
2835
2718
  @property
2836
- def Data(self):
2837
- return go.Slice_byte(handle=_whatsapp.whatsapp_Attachment_Data_Get(self.handle))
2838
- @Data.setter
2839
- def Data(self, value):
2719
+ def Error(self):
2720
+ return _whatsapp.whatsapp_Connect_Error_Get(self.handle)
2721
+ @Error.setter
2722
+ def Error(self, value):
2840
2723
  if isinstance(value, go.GoClass):
2841
- _whatsapp.whatsapp_Attachment_Data_Set(self.handle, value.handle)
2724
+ _whatsapp.whatsapp_Connect_Error_Set(self.handle, value.handle)
2842
2725
  else:
2843
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2844
- def GetSpec(self, ctx):
2845
- """GetSpec(object ctx) object, str
2846
-
2847
- GetSpec returns metadata for this attachment, as derived from the underlying attachment data.
2848
- """
2849
- return go.Ptr_media_Spec(handle=_whatsapp.whatsapp_Attachment_GetSpec(self.handle, ctx.handle))
2726
+ _whatsapp.whatsapp_Connect_Error_Set(self.handle, value)
2850
2727
 
2851
- # Python type for struct whatsapp.ChatState
2852
- class ChatState(go.GoClass):
2853
- """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"""
2728
+ # Python type for struct whatsapp.EventPayload
2729
+ class EventPayload(go.GoClass):
2730
+ """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"""
2854
2731
  def __init__(self, *args, **kwargs):
2855
2732
  """
2856
2733
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2864,25 +2741,57 @@ class ChatState(go.GoClass):
2864
2741
  self.handle = args[0].handle
2865
2742
  _whatsapp.IncRef(self.handle)
2866
2743
  else:
2867
- self.handle = _whatsapp.whatsapp_ChatState_CTor()
2744
+ self.handle = _whatsapp.whatsapp_EventPayload_CTor()
2868
2745
  _whatsapp.IncRef(self.handle)
2869
2746
  if 0 < len(args):
2870
- self.Kind = args[0]
2871
- if "Kind" in kwargs:
2872
- self.Kind = kwargs["Kind"]
2747
+ self.QRCode = args[0]
2748
+ if "QRCode" in kwargs:
2749
+ self.QRCode = kwargs["QRCode"]
2873
2750
  if 1 < len(args):
2874
- self.JID = args[1]
2875
- if "JID" in kwargs:
2876
- self.JID = kwargs["JID"]
2751
+ self.PairDeviceID = args[1]
2752
+ if "PairDeviceID" in kwargs:
2753
+ self.PairDeviceID = kwargs["PairDeviceID"]
2877
2754
  if 2 < len(args):
2878
- self.GroupJID = args[2]
2879
- if "GroupJID" in kwargs:
2880
- self.GroupJID = kwargs["GroupJID"]
2755
+ self.Connect = args[2]
2756
+ if "Connect" in kwargs:
2757
+ self.Connect = kwargs["Connect"]
2758
+ if 3 < len(args):
2759
+ self.LoggedOut = args[3]
2760
+ if "LoggedOut" in kwargs:
2761
+ self.LoggedOut = kwargs["LoggedOut"]
2762
+ if 4 < len(args):
2763
+ self.Contact = args[4]
2764
+ if "Contact" in kwargs:
2765
+ self.Contact = kwargs["Contact"]
2766
+ if 5 < len(args):
2767
+ self.Presence = args[5]
2768
+ if "Presence" in kwargs:
2769
+ self.Presence = kwargs["Presence"]
2770
+ if 6 < len(args):
2771
+ self.Message = args[6]
2772
+ if "Message" in kwargs:
2773
+ self.Message = kwargs["Message"]
2774
+ if 7 < len(args):
2775
+ self.ChatState = args[7]
2776
+ if "ChatState" in kwargs:
2777
+ self.ChatState = kwargs["ChatState"]
2778
+ if 8 < len(args):
2779
+ self.Receipt = args[8]
2780
+ if "Receipt" in kwargs:
2781
+ self.Receipt = kwargs["Receipt"]
2782
+ if 9 < len(args):
2783
+ self.Group = args[9]
2784
+ if "Group" in kwargs:
2785
+ self.Group = kwargs["Group"]
2786
+ if 10 < len(args):
2787
+ self.Call = args[10]
2788
+ if "Call" in kwargs:
2789
+ self.Call = kwargs["Call"]
2881
2790
  def __del__(self):
2882
2791
  _whatsapp.DecRef(self.handle)
2883
2792
  def __str__(self):
2884
2793
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2885
- sv = 'whatsapp.ChatState{'
2794
+ sv = 'whatsapp.EventPayload{'
2886
2795
  first = True
2887
2796
  for v in pr:
2888
2797
  if callable(v[1]):
@@ -2895,42 +2804,114 @@ class ChatState(go.GoClass):
2895
2804
  return sv + '}'
2896
2805
  def __repr__(self):
2897
2806
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2898
- sv = 'whatsapp.ChatState ( '
2807
+ sv = 'whatsapp.EventPayload ( '
2899
2808
  for v in pr:
2900
2809
  if not callable(v[1]):
2901
2810
  sv += v[0] + '=' + str(v[1]) + ', '
2902
2811
  return sv + ')'
2903
2812
  @property
2904
- def Kind(self):
2905
- return _whatsapp.whatsapp_ChatState_Kind_Get(self.handle)
2906
- @Kind.setter
2907
- def Kind(self, value):
2813
+ def QRCode(self):
2814
+ return _whatsapp.whatsapp_EventPayload_QRCode_Get(self.handle)
2815
+ @QRCode.setter
2816
+ def QRCode(self, value):
2908
2817
  if isinstance(value, go.GoClass):
2909
- _whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value.handle)
2818
+ _whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value.handle)
2910
2819
  else:
2911
- _whatsapp.whatsapp_ChatState_Kind_Set(self.handle, value)
2820
+ _whatsapp.whatsapp_EventPayload_QRCode_Set(self.handle, value)
2912
2821
  @property
2913
- def JID(self):
2914
- return _whatsapp.whatsapp_ChatState_JID_Get(self.handle)
2915
- @JID.setter
2916
- def JID(self, value):
2822
+ def PairDeviceID(self):
2823
+ return _whatsapp.whatsapp_EventPayload_PairDeviceID_Get(self.handle)
2824
+ @PairDeviceID.setter
2825
+ def PairDeviceID(self, value):
2917
2826
  if isinstance(value, go.GoClass):
2918
- _whatsapp.whatsapp_ChatState_JID_Set(self.handle, value.handle)
2827
+ _whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value.handle)
2919
2828
  else:
2920
- _whatsapp.whatsapp_ChatState_JID_Set(self.handle, value)
2829
+ _whatsapp.whatsapp_EventPayload_PairDeviceID_Set(self.handle, value)
2921
2830
  @property
2922
- def GroupJID(self):
2923
- return _whatsapp.whatsapp_ChatState_GroupJID_Get(self.handle)
2924
- @GroupJID.setter
2925
- def GroupJID(self, value):
2831
+ def Connect(self):
2832
+ return Connect(handle=_whatsapp.whatsapp_EventPayload_Connect_Get(self.handle))
2833
+ @Connect.setter
2834
+ def Connect(self, value):
2926
2835
  if isinstance(value, go.GoClass):
2927
- _whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value.handle)
2836
+ _whatsapp.whatsapp_EventPayload_Connect_Set(self.handle, value.handle)
2928
2837
  else:
2929
- _whatsapp.whatsapp_ChatState_GroupJID_Set(self.handle, value)
2838
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2839
+ @property
2840
+ def LoggedOut(self):
2841
+ return LoggedOut(handle=_whatsapp.whatsapp_EventPayload_LoggedOut_Get(self.handle))
2842
+ @LoggedOut.setter
2843
+ def LoggedOut(self, value):
2844
+ if isinstance(value, go.GoClass):
2845
+ _whatsapp.whatsapp_EventPayload_LoggedOut_Set(self.handle, value.handle)
2846
+ else:
2847
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2848
+ @property
2849
+ def Contact(self):
2850
+ return Contact(handle=_whatsapp.whatsapp_EventPayload_Contact_Get(self.handle))
2851
+ @Contact.setter
2852
+ def Contact(self, value):
2853
+ if isinstance(value, go.GoClass):
2854
+ _whatsapp.whatsapp_EventPayload_Contact_Set(self.handle, value.handle)
2855
+ else:
2856
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2857
+ @property
2858
+ def Presence(self):
2859
+ return Presence(handle=_whatsapp.whatsapp_EventPayload_Presence_Get(self.handle))
2860
+ @Presence.setter
2861
+ def Presence(self, value):
2862
+ if isinstance(value, go.GoClass):
2863
+ _whatsapp.whatsapp_EventPayload_Presence_Set(self.handle, value.handle)
2864
+ else:
2865
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2866
+ @property
2867
+ def Message(self):
2868
+ return Message(handle=_whatsapp.whatsapp_EventPayload_Message_Get(self.handle))
2869
+ @Message.setter
2870
+ def Message(self, value):
2871
+ if isinstance(value, go.GoClass):
2872
+ _whatsapp.whatsapp_EventPayload_Message_Set(self.handle, value.handle)
2873
+ else:
2874
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2875
+ @property
2876
+ def ChatState(self):
2877
+ return ChatState(handle=_whatsapp.whatsapp_EventPayload_ChatState_Get(self.handle))
2878
+ @ChatState.setter
2879
+ def ChatState(self, value):
2880
+ if isinstance(value, go.GoClass):
2881
+ _whatsapp.whatsapp_EventPayload_ChatState_Set(self.handle, value.handle)
2882
+ else:
2883
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2884
+ @property
2885
+ def Receipt(self):
2886
+ return Receipt(handle=_whatsapp.whatsapp_EventPayload_Receipt_Get(self.handle))
2887
+ @Receipt.setter
2888
+ def Receipt(self, value):
2889
+ if isinstance(value, go.GoClass):
2890
+ _whatsapp.whatsapp_EventPayload_Receipt_Set(self.handle, value.handle)
2891
+ else:
2892
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2893
+ @property
2894
+ def Group(self):
2895
+ return Group(handle=_whatsapp.whatsapp_EventPayload_Group_Get(self.handle))
2896
+ @Group.setter
2897
+ def Group(self, value):
2898
+ if isinstance(value, go.GoClass):
2899
+ _whatsapp.whatsapp_EventPayload_Group_Set(self.handle, value.handle)
2900
+ else:
2901
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2902
+ @property
2903
+ def Call(self):
2904
+ return Call(handle=_whatsapp.whatsapp_EventPayload_Call_Get(self.handle))
2905
+ @Call.setter
2906
+ def Call(self, value):
2907
+ if isinstance(value, go.GoClass):
2908
+ _whatsapp.whatsapp_EventPayload_Call_Set(self.handle, value.handle)
2909
+ else:
2910
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
2930
2911
 
2931
- # Python type for struct whatsapp.Connect
2932
- class Connect(go.GoClass):
2933
- """Connect represents event data related to a connection to WhatsApp being established, or failing\nto do so (based on the [Connect.Error] result).\n"""
2912
+ # Python type for struct whatsapp.Gateway
2913
+ class Gateway(go.GoClass):
2914
+ """A Gateway represents a persistent process for establishing individual sessions between linked\ndevices and WhatsApp.\n"""
2934
2915
  def __init__(self, *args, **kwargs):
2935
2916
  """
2936
2917
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -2944,21 +2925,29 @@ class Connect(go.GoClass):
2944
2925
  self.handle = args[0].handle
2945
2926
  _whatsapp.IncRef(self.handle)
2946
2927
  else:
2947
- self.handle = _whatsapp.whatsapp_Connect_CTor()
2928
+ self.handle = _whatsapp.whatsapp_Gateway_CTor()
2948
2929
  _whatsapp.IncRef(self.handle)
2949
2930
  if 0 < len(args):
2950
- self.JID = args[0]
2951
- if "JID" in kwargs:
2952
- self.JID = kwargs["JID"]
2931
+ self.DBPath = args[0]
2932
+ if "DBPath" in kwargs:
2933
+ self.DBPath = kwargs["DBPath"]
2953
2934
  if 1 < len(args):
2954
- self.Error = args[1]
2955
- if "Error" in kwargs:
2956
- self.Error = kwargs["Error"]
2935
+ self.Name = args[1]
2936
+ if "Name" in kwargs:
2937
+ self.Name = kwargs["Name"]
2938
+ if 2 < len(args):
2939
+ self.LogLevel = args[2]
2940
+ if "LogLevel" in kwargs:
2941
+ self.LogLevel = kwargs["LogLevel"]
2942
+ if 3 < len(args):
2943
+ self.TempDir = args[3]
2944
+ if "TempDir" in kwargs:
2945
+ self.TempDir = kwargs["TempDir"]
2957
2946
  def __del__(self):
2958
2947
  _whatsapp.DecRef(self.handle)
2959
2948
  def __str__(self):
2960
2949
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2961
- sv = 'whatsapp.Connect{'
2950
+ sv = 'whatsapp.Gateway{'
2962
2951
  first = True
2963
2952
  for v in pr:
2964
2953
  if callable(v[1]):
@@ -2971,33 +2960,72 @@ class Connect(go.GoClass):
2971
2960
  return sv + '}'
2972
2961
  def __repr__(self):
2973
2962
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
2974
- sv = 'whatsapp.Connect ( '
2963
+ sv = 'whatsapp.Gateway ( '
2975
2964
  for v in pr:
2976
2965
  if not callable(v[1]):
2977
2966
  sv += v[0] + '=' + str(v[1]) + ', '
2978
2967
  return sv + ')'
2979
2968
  @property
2980
- def JID(self):
2981
- return _whatsapp.whatsapp_Connect_JID_Get(self.handle)
2982
- @JID.setter
2983
- def JID(self, value):
2969
+ def DBPath(self):
2970
+ return _whatsapp.whatsapp_Gateway_DBPath_Get(self.handle)
2971
+ @DBPath.setter
2972
+ def DBPath(self, value):
2973
+ if isinstance(value, go.GoClass):
2974
+ _whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value.handle)
2975
+ else:
2976
+ _whatsapp.whatsapp_Gateway_DBPath_Set(self.handle, value)
2977
+ @property
2978
+ def Name(self):
2979
+ return _whatsapp.whatsapp_Gateway_Name_Get(self.handle)
2980
+ @Name.setter
2981
+ def Name(self, value):
2982
+ if isinstance(value, go.GoClass):
2983
+ _whatsapp.whatsapp_Gateway_Name_Set(self.handle, value.handle)
2984
+ else:
2985
+ _whatsapp.whatsapp_Gateway_Name_Set(self.handle, value)
2986
+ @property
2987
+ def LogLevel(self):
2988
+ return _whatsapp.whatsapp_Gateway_LogLevel_Get(self.handle)
2989
+ @LogLevel.setter
2990
+ def LogLevel(self, value):
2984
2991
  if isinstance(value, go.GoClass):
2985
- _whatsapp.whatsapp_Connect_JID_Set(self.handle, value.handle)
2992
+ _whatsapp.whatsapp_Gateway_LogLevel_Set(self.handle, value.handle)
2986
2993
  else:
2987
- _whatsapp.whatsapp_Connect_JID_Set(self.handle, value)
2994
+ _whatsapp.whatsapp_Gateway_LogLevel_Set(self.handle, value)
2988
2995
  @property
2989
- def Error(self):
2990
- return _whatsapp.whatsapp_Connect_Error_Get(self.handle)
2991
- @Error.setter
2992
- def Error(self, value):
2996
+ def TempDir(self):
2997
+ return _whatsapp.whatsapp_Gateway_TempDir_Get(self.handle)
2998
+ @TempDir.setter
2999
+ def TempDir(self, value):
2993
3000
  if isinstance(value, go.GoClass):
2994
- _whatsapp.whatsapp_Connect_Error_Set(self.handle, value.handle)
3001
+ _whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value.handle)
2995
3002
  else:
2996
- _whatsapp.whatsapp_Connect_Error_Set(self.handle, value)
3003
+ _whatsapp.whatsapp_Gateway_TempDir_Set(self.handle, value)
3004
+ def Init(self):
3005
+ """Init() str
3006
+
3007
+ Init performs initialization procedures for the Gateway, and is expected to be run before any
3008
+ calls to [Gateway.Session].
3009
+ """
3010
+ return _whatsapp.whatsapp_Gateway_Init(self.handle)
3011
+ def NewSession(self, device):
3012
+ """NewSession(object device) object
3013
+
3014
+ NewSession returns a new [Session] for the LinkedDevice given. If the linked device does not have
3015
+ a valid ID, a pair operation will be required, as described in [Session.Login].
3016
+ """
3017
+ return Session(handle=_whatsapp.whatsapp_Gateway_NewSession(self.handle, device.handle))
3018
+ def CleanupSession(self, device):
3019
+ """CleanupSession(object device) str
3020
+
3021
+ CleanupSession will remove all invalid and obsolete references to the given device, and should be
3022
+ used when pairing a new device or unregistering from the Gateway.
3023
+ """
3024
+ return _whatsapp.whatsapp_Gateway_CleanupSession(self.handle, device.handle)
2997
3025
 
2998
- # Python type for struct whatsapp.GroupParticipant
2999
- class GroupParticipant(go.GoClass):
3000
- """A GroupParticipant represents a contact who is currently joined in a given group. Participants in\nWhatsApp can generally be derived back to their individual [Contact]; there are no anonymous groups\nin WhatsApp.\n"""
3026
+ # Python type for struct whatsapp.Group
3027
+ class Group(go.GoClass):
3028
+ """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"""
3001
3029
  def __init__(self, *args, **kwargs):
3002
3030
  """
3003
3031
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -3011,29 +3039,37 @@ class GroupParticipant(go.GoClass):
3011
3039
  self.handle = args[0].handle
3012
3040
  _whatsapp.IncRef(self.handle)
3013
3041
  else:
3014
- self.handle = _whatsapp.whatsapp_GroupParticipant_CTor()
3042
+ self.handle = _whatsapp.whatsapp_Group_CTor()
3015
3043
  _whatsapp.IncRef(self.handle)
3016
3044
  if 0 < len(args):
3017
3045
  self.JID = args[0]
3018
3046
  if "JID" in kwargs:
3019
3047
  self.JID = kwargs["JID"]
3020
3048
  if 1 < len(args):
3021
- self.Nickname = args[1]
3022
- if "Nickname" in kwargs:
3023
- self.Nickname = kwargs["Nickname"]
3049
+ self.Name = args[1]
3050
+ if "Name" in kwargs:
3051
+ self.Name = kwargs["Name"]
3024
3052
  if 2 < len(args):
3025
- self.Affiliation = args[2]
3026
- if "Affiliation" in kwargs:
3027
- self.Affiliation = kwargs["Affiliation"]
3053
+ self.Subject = args[2]
3054
+ if "Subject" in kwargs:
3055
+ self.Subject = kwargs["Subject"]
3028
3056
  if 3 < len(args):
3029
- self.Action = args[3]
3030
- if "Action" in kwargs:
3031
- self.Action = kwargs["Action"]
3057
+ self.Nickname = args[3]
3058
+ if "Nickname" in kwargs:
3059
+ self.Nickname = kwargs["Nickname"]
3060
+ if 4 < len(args):
3061
+ self.Participants = args[4]
3062
+ if "Participants" in kwargs:
3063
+ self.Participants = kwargs["Participants"]
3064
+ if 5 < len(args):
3065
+ self.InviteCode = args[5]
3066
+ if "InviteCode" in kwargs:
3067
+ self.InviteCode = kwargs["InviteCode"]
3032
3068
  def __del__(self):
3033
3069
  _whatsapp.DecRef(self.handle)
3034
3070
  def __str__(self):
3035
3071
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
3036
- sv = 'whatsapp.GroupParticipant{'
3072
+ sv = 'whatsapp.Group{'
3037
3073
  first = True
3038
3074
  for v in pr:
3039
3075
  if callable(v[1]):
@@ -3046,51 +3082,69 @@ class GroupParticipant(go.GoClass):
3046
3082
  return sv + '}'
3047
3083
  def __repr__(self):
3048
3084
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
3049
- sv = 'whatsapp.GroupParticipant ( '
3085
+ sv = 'whatsapp.Group ( '
3050
3086
  for v in pr:
3051
3087
  if not callable(v[1]):
3052
3088
  sv += v[0] + '=' + str(v[1]) + ', '
3053
3089
  return sv + ')'
3054
3090
  @property
3055
3091
  def JID(self):
3056
- return _whatsapp.whatsapp_GroupParticipant_JID_Get(self.handle)
3092
+ return _whatsapp.whatsapp_Group_JID_Get(self.handle)
3057
3093
  @JID.setter
3058
3094
  def JID(self, value):
3059
3095
  if isinstance(value, go.GoClass):
3060
- _whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value.handle)
3096
+ _whatsapp.whatsapp_Group_JID_Set(self.handle, value.handle)
3061
3097
  else:
3062
- _whatsapp.whatsapp_GroupParticipant_JID_Set(self.handle, value)
3098
+ _whatsapp.whatsapp_Group_JID_Set(self.handle, value)
3099
+ @property
3100
+ def Name(self):
3101
+ return _whatsapp.whatsapp_Group_Name_Get(self.handle)
3102
+ @Name.setter
3103
+ def Name(self, value):
3104
+ if isinstance(value, go.GoClass):
3105
+ _whatsapp.whatsapp_Group_Name_Set(self.handle, value.handle)
3106
+ else:
3107
+ _whatsapp.whatsapp_Group_Name_Set(self.handle, value)
3108
+ @property
3109
+ def Subject(self):
3110
+ return GroupSubject(handle=_whatsapp.whatsapp_Group_Subject_Get(self.handle))
3111
+ @Subject.setter
3112
+ def Subject(self, value):
3113
+ if isinstance(value, go.GoClass):
3114
+ _whatsapp.whatsapp_Group_Subject_Set(self.handle, value.handle)
3115
+ else:
3116
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
3063
3117
  @property
3064
3118
  def Nickname(self):
3065
- return _whatsapp.whatsapp_GroupParticipant_Nickname_Get(self.handle)
3119
+ return _whatsapp.whatsapp_Group_Nickname_Get(self.handle)
3066
3120
  @Nickname.setter
3067
3121
  def Nickname(self, value):
3068
3122
  if isinstance(value, go.GoClass):
3069
- _whatsapp.whatsapp_GroupParticipant_Nickname_Set(self.handle, value.handle)
3123
+ _whatsapp.whatsapp_Group_Nickname_Set(self.handle, value.handle)
3070
3124
  else:
3071
- _whatsapp.whatsapp_GroupParticipant_Nickname_Set(self.handle, value)
3125
+ _whatsapp.whatsapp_Group_Nickname_Set(self.handle, value)
3072
3126
  @property
3073
- def Affiliation(self):
3074
- return _whatsapp.whatsapp_GroupParticipant_Affiliation_Get(self.handle)
3075
- @Affiliation.setter
3076
- def Affiliation(self, value):
3127
+ def Participants(self):
3128
+ return Slice_whatsapp_GroupParticipant(handle=_whatsapp.whatsapp_Group_Participants_Get(self.handle))
3129
+ @Participants.setter
3130
+ def Participants(self, value):
3077
3131
  if isinstance(value, go.GoClass):
3078
- _whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value.handle)
3132
+ _whatsapp.whatsapp_Group_Participants_Set(self.handle, value.handle)
3079
3133
  else:
3080
- _whatsapp.whatsapp_GroupParticipant_Affiliation_Set(self.handle, value)
3134
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
3081
3135
  @property
3082
- def Action(self):
3083
- return _whatsapp.whatsapp_GroupParticipant_Action_Get(self.handle)
3084
- @Action.setter
3085
- def Action(self, value):
3136
+ def InviteCode(self):
3137
+ return _whatsapp.whatsapp_Group_InviteCode_Get(self.handle)
3138
+ @InviteCode.setter
3139
+ def InviteCode(self, value):
3086
3140
  if isinstance(value, go.GoClass):
3087
- _whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value.handle)
3141
+ _whatsapp.whatsapp_Group_InviteCode_Set(self.handle, value.handle)
3088
3142
  else:
3089
- _whatsapp.whatsapp_GroupParticipant_Action_Set(self.handle, value)
3143
+ _whatsapp.whatsapp_Group_InviteCode_Set(self.handle, value)
3090
3144
 
3091
- # Python type for struct whatsapp.Location
3092
- class Location(go.GoClass):
3093
- """A Location represents additional metadata given to location messages.\n"""
3145
+ # Python type for struct whatsapp.GroupSubject
3146
+ class GroupSubject(go.GoClass):
3147
+ """A GroupSubject represents the user-defined group description and attached metadata thereof, for a\ngiven [Group].\n"""
3094
3148
  def __init__(self, *args, **kwargs):
3095
3149
  """
3096
3150
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -3104,41 +3158,25 @@ class Location(go.GoClass):
3104
3158
  self.handle = args[0].handle
3105
3159
  _whatsapp.IncRef(self.handle)
3106
3160
  else:
3107
- self.handle = _whatsapp.whatsapp_Location_CTor()
3161
+ self.handle = _whatsapp.whatsapp_GroupSubject_CTor()
3108
3162
  _whatsapp.IncRef(self.handle)
3109
3163
  if 0 < len(args):
3110
- self.Latitude = args[0]
3111
- if "Latitude" in kwargs:
3112
- self.Latitude = kwargs["Latitude"]
3164
+ self.Subject = args[0]
3165
+ if "Subject" in kwargs:
3166
+ self.Subject = kwargs["Subject"]
3113
3167
  if 1 < len(args):
3114
- self.Longitude = args[1]
3115
- if "Longitude" in kwargs:
3116
- self.Longitude = kwargs["Longitude"]
3168
+ self.SetAt = args[1]
3169
+ if "SetAt" in kwargs:
3170
+ self.SetAt = kwargs["SetAt"]
3117
3171
  if 2 < len(args):
3118
- self.Accuracy = args[2]
3119
- if "Accuracy" in kwargs:
3120
- self.Accuracy = kwargs["Accuracy"]
3121
- if 3 < len(args):
3122
- self.IsLive = args[3]
3123
- if "IsLive" in kwargs:
3124
- self.IsLive = kwargs["IsLive"]
3125
- if 4 < len(args):
3126
- self.Name = args[4]
3127
- if "Name" in kwargs:
3128
- self.Name = kwargs["Name"]
3129
- if 5 < len(args):
3130
- self.Address = args[5]
3131
- if "Address" in kwargs:
3132
- self.Address = kwargs["Address"]
3133
- if 6 < len(args):
3134
- self.URL = args[6]
3135
- if "URL" in kwargs:
3136
- self.URL = kwargs["URL"]
3172
+ self.SetBy = args[2]
3173
+ if "SetBy" in kwargs:
3174
+ self.SetBy = kwargs["SetBy"]
3137
3175
  def __del__(self):
3138
3176
  _whatsapp.DecRef(self.handle)
3139
3177
  def __str__(self):
3140
3178
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
3141
- sv = 'whatsapp.Location{'
3179
+ sv = 'whatsapp.GroupSubject{'
3142
3180
  first = True
3143
3181
  for v in pr:
3144
3182
  if callable(v[1]):
@@ -3151,76 +3189,38 @@ class Location(go.GoClass):
3151
3189
  return sv + '}'
3152
3190
  def __repr__(self):
3153
3191
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
3154
- sv = 'whatsapp.Location ( '
3192
+ sv = 'whatsapp.GroupSubject ( '
3155
3193
  for v in pr:
3156
3194
  if not callable(v[1]):
3157
3195
  sv += v[0] + '=' + str(v[1]) + ', '
3158
3196
  return sv + ')'
3159
3197
  @property
3160
- def Latitude(self):
3161
- return _whatsapp.whatsapp_Location_Latitude_Get(self.handle)
3162
- @Latitude.setter
3163
- def Latitude(self, value):
3164
- if isinstance(value, go.GoClass):
3165
- _whatsapp.whatsapp_Location_Latitude_Set(self.handle, value.handle)
3166
- else:
3167
- _whatsapp.whatsapp_Location_Latitude_Set(self.handle, value)
3168
- @property
3169
- def Longitude(self):
3170
- return _whatsapp.whatsapp_Location_Longitude_Get(self.handle)
3171
- @Longitude.setter
3172
- def Longitude(self, value):
3173
- if isinstance(value, go.GoClass):
3174
- _whatsapp.whatsapp_Location_Longitude_Set(self.handle, value.handle)
3175
- else:
3176
- _whatsapp.whatsapp_Location_Longitude_Set(self.handle, value)
3177
- @property
3178
- def Accuracy(self):
3179
- return _whatsapp.whatsapp_Location_Accuracy_Get(self.handle)
3180
- @Accuracy.setter
3181
- def Accuracy(self, value):
3182
- if isinstance(value, go.GoClass):
3183
- _whatsapp.whatsapp_Location_Accuracy_Set(self.handle, value.handle)
3184
- else:
3185
- _whatsapp.whatsapp_Location_Accuracy_Set(self.handle, value)
3186
- @property
3187
- def IsLive(self):
3188
- return _whatsapp.whatsapp_Location_IsLive_Get(self.handle)
3189
- @IsLive.setter
3190
- def IsLive(self, value):
3191
- if isinstance(value, go.GoClass):
3192
- _whatsapp.whatsapp_Location_IsLive_Set(self.handle, value.handle)
3193
- else:
3194
- _whatsapp.whatsapp_Location_IsLive_Set(self.handle, value)
3195
- @property
3196
- def Name(self):
3197
- """Optional fields given for named locations.
3198
- """
3199
- return _whatsapp.whatsapp_Location_Name_Get(self.handle)
3200
- @Name.setter
3201
- def Name(self, value):
3198
+ def Subject(self):
3199
+ return _whatsapp.whatsapp_GroupSubject_Subject_Get(self.handle)
3200
+ @Subject.setter
3201
+ def Subject(self, value):
3202
3202
  if isinstance(value, go.GoClass):
3203
- _whatsapp.whatsapp_Location_Name_Set(self.handle, value.handle)
3203
+ _whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value.handle)
3204
3204
  else:
3205
- _whatsapp.whatsapp_Location_Name_Set(self.handle, value)
3205
+ _whatsapp.whatsapp_GroupSubject_Subject_Set(self.handle, value)
3206
3206
  @property
3207
- def Address(self):
3208
- return _whatsapp.whatsapp_Location_Address_Get(self.handle)
3209
- @Address.setter
3210
- def Address(self, value):
3207
+ def SetAt(self):
3208
+ return _whatsapp.whatsapp_GroupSubject_SetAt_Get(self.handle)
3209
+ @SetAt.setter
3210
+ def SetAt(self, value):
3211
3211
  if isinstance(value, go.GoClass):
3212
- _whatsapp.whatsapp_Location_Address_Set(self.handle, value.handle)
3212
+ _whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value.handle)
3213
3213
  else:
3214
- _whatsapp.whatsapp_Location_Address_Set(self.handle, value)
3214
+ _whatsapp.whatsapp_GroupSubject_SetAt_Set(self.handle, value)
3215
3215
  @property
3216
- def URL(self):
3217
- return _whatsapp.whatsapp_Location_URL_Get(self.handle)
3218
- @URL.setter
3219
- def URL(self, value):
3216
+ def SetBy(self):
3217
+ return _whatsapp.whatsapp_GroupSubject_SetBy_Get(self.handle)
3218
+ @SetBy.setter
3219
+ def SetBy(self, value):
3220
3220
  if isinstance(value, go.GoClass):
3221
- _whatsapp.whatsapp_Location_URL_Set(self.handle, value.handle)
3221
+ _whatsapp.whatsapp_GroupSubject_SetBy_Set(self.handle, value.handle)
3222
3222
  else:
3223
- _whatsapp.whatsapp_Location_URL_Set(self.handle, value)
3223
+ _whatsapp.whatsapp_GroupSubject_SetBy_Set(self.handle, value)
3224
3224
 
3225
3225
  # Python type for struct whatsapp.Preview
3226
3226
  class Preview(go.GoClass):