diff options
Diffstat (limited to 'model/post.go')
-rw-r--r-- | model/post.go | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/model/post.go b/model/post.go index 635493c9d..82cc0a0e9 100644 --- a/model/post.go +++ b/model/post.go @@ -50,6 +50,8 @@ const ( PROPS_ADD_CHANNEL_MEMBER = "add_channel_member" POST_PROPS_ADDED_USER_ID = "addedUserId" POST_PROPS_DELETE_BY = "deleteBy" + POST_ACTION_TYPE_BUTTON = "button" + POST_ACTION_TYPE_SELECT = "select" ) type Post struct { @@ -108,21 +110,35 @@ type PostForIndexing struct { ParentCreateAt *int64 `json:"parent_create_at"` } +type DoPostActionRequest struct { + SelectedOption string `json:"selected_option"` +} + type PostAction struct { Id string `json:"id"` Name string `json:"name"` + Type string `json:"type"` + DataSource string `json:"data_source"` + Options []*PostActionOptions `json:"options"` Integration *PostActionIntegration `json:"integration,omitempty"` } +type PostActionOptions struct { + Text string `json:"text"` + Value string `json:"value"` +} + type PostActionIntegration struct { URL string `json:"url,omitempty"` Context StringInterface `json:"context,omitempty"` } type PostActionIntegrationRequest struct { - UserId string `json:"user_id"` - PostId string `json:"post_id"` - Context StringInterface `json:"context,omitempty"` + UserId string `json:"user_id"` + PostId string `json:"post_id"` + Type string `json:"type"` + DataSource string `json:"data_source"` + Context StringInterface `json:"context,omitempty"` } type PostActionIntegrationResponse struct { @@ -455,6 +471,12 @@ func (o *PostEphemeral) ToUnsanitizedJson() string { return string(b) } +func DoPostActionRequestFromJson(data io.Reader) *DoPostActionRequest { + var o *DoPostActionRequest + json.NewDecoder(data).Decode(&o) + return o +} + // RewriteImageURLs takes a message and returns a copy that has all of the image URLs replaced // according to the function f. For each image URL, f will be invoked, and the resulting markdown // will contain the URL returned by that invocation instead. |