5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-27 00:51:36 +00:00
matterbridge/vendor/github.com/mattermost/platform/model/team_signup.go
2016-04-10 23:39:38 +02:00

41 lines
693 B
Go

// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
import (
"encoding/json"
"fmt"
"io"
)
type TeamSignup struct {
Team Team `json:"team"`
User User `json:"user"`
Invites []string `json:"invites"`
Data string `json:"data"`
Hash string `json:"hash"`
}
func TeamSignupFromJson(data io.Reader) *TeamSignup {
decoder := json.NewDecoder(data)
var o TeamSignup
err := decoder.Decode(&o)
if err == nil {
return &o
} else {
fmt.Println(err)
return nil
}
}
func (o *TeamSignup) ToJson() string {
b, err := json.Marshal(o)
if err != nil {
return ""
} else {
return string(b)
}
}