Debian Codegraph @

socketmode/request.go

raw symbols SCIP
1 package socketmode
2
3 import "encoding/json"
4
5 // Request maps to the content of each WebSocket message received via a Socket Mode WebSocket connection
6 //
7 // We call this a "request" rather than e.g. a WebSocket message or an Socket Mode "event" following python-slack-sdk:
8 //
9 // https://github.com/slackapi/python-slack-sdk/blob/3f1c4c6e27bf7ee8af57699b2543e6eb7848bcf9/slack_sdk/socket_mode/request.py#L6
10 //
11 // We know that node-slack-sdk calls it an "event", that makes it hard for us to distinguish our client's own event
12 // that wraps both internal events and Socket Mode "events", vs node-slack-sdk's is for the latter only.
13 //
14 // https://github.com/slackapi/node-slack-sdk/blob/main/packages/socket-mode/src/SocketModeClient.ts#L537
15 type Request struct {
16 Type string `json:"type"`
17
18 // `hello` type only
19 NumConnections int `json:"num_connections"`
20 ConnectionInfo ConnectionInfo `json:"connection_info"`
21
22 // `disconnect` type only
23
24 // Reason can be "warning" or else
25 Reason string `json:"reason"`
26
27 // `hello` and `disconnect` types only
28 DebugInfo DebugInfo `json:"debug_info"`
29
30 // `events_api` type only
31 EnvelopeID string `json:"envelope_id"`
32 // TODO Can it really be a non-object type?
33 // See https://github.com/slackapi/python-slack-sdk/blob/3f1c4c6e27bf7ee8af57699b2543e6eb7848bcf9/slack_sdk/socket_mode/request.py#L26-L31
34 Payload json.RawMessage `json:"payload"`
35 AcceptsResponsePayload bool `json:"accepts_response_payload"`
36 RetryAttempt int `json:"retry_attempt"`
37 RetryReason string `json:"retry_reason"`
38 }