github.com/mattermosttest/mattermost-server/v5@v5.0.0-20200917143240-9dfa12e121f9/model/typing_request.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package model 5 6 import ( 7 "encoding/json" 8 "io" 9 ) 10 11 type TypingRequest struct { 12 ChannelId string `json:"channel_id"` 13 ParentId string `json:"parent_id"` 14 } 15 16 func (o *TypingRequest) ToJson() string { 17 b, _ := json.Marshal(o) 18 return string(b) 19 } 20 21 func TypingRequestFromJson(data io.Reader) *TypingRequest { 22 var o *TypingRequest 23 json.NewDecoder(data).Decode(&o) 24 return o 25 }