slidge-whatsapp 0.3.0b0__cp313-cp313-manylinux_2_36_aarch64.whl → 0.3.1__cp313-cp313-manylinux_2_36_aarch64.whl

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