slidge-whatsapp 0.2.7__cp313-cp313-manylinux_2_36_aarch64.whl → 0.3.0__cp313-cp313-manylinux_2_36_aarch64.whl

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

Potentially problematic release.


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

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