slidge-whatsapp 0.2.7__cp311-cp311-manylinux_2_36_aarch64.whl → 0.3.0__cp311-cp311-manylinux_2_36_aarch64.whl

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

Potentially problematic release.


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

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