summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/team_member.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/team_member.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/team_member.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/vendor/github.com/mattermost/platform/model/team_member.go b/vendor/github.com/mattermost/platform/model/team_member.go
index 36a567a4..3a0befa3 100644
--- a/vendor/github.com/mattermost/platform/model/team_member.go
+++ b/vendor/github.com/mattermost/platform/model/team_member.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
@@ -31,6 +31,15 @@ func (o *TeamMember) ToJson() string {
}
}
+func (o *TeamUnread) ToJson() string {
+ b, err := json.Marshal(o)
+ if err != nil {
+ return ""
+ } else {
+ return string(b)
+ }
+}
+
func TeamMemberFromJson(data io.Reader) *TeamMember {
decoder := json.NewDecoder(data)
var o TeamMember
@@ -42,6 +51,17 @@ func TeamMemberFromJson(data io.Reader) *TeamMember {
}
}
+func TeamUnreadFromJson(data io.Reader) *TeamUnread {
+ decoder := json.NewDecoder(data)
+ var o TeamUnread
+ err := decoder.Decode(&o)
+ if err == nil {
+ return &o
+ } else {
+ return nil
+ }
+}
+
func TeamMembersToJson(o []*TeamMember) string {
if b, err := json.Marshal(o); err != nil {
return "[]"