slidge-whatsapp 0.2.6__cp312-cp312-manylinux_2_36_aarch64.whl → 0.3.0__cp312-cp312-manylinux_2_36_aarch64.whl

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

Potentially problematic release.


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

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