slidge-whatsapp 0.3.0b0__cp312-cp312-manylinux_2_36_aarch64.whl → 0.3.1__cp312-cp312-manylinux_2_36_aarch64.whl

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

Potentially problematic release.


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

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