1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00
focalboard/server/model/sharing.go

37 lines
702 B
Go
Raw Normal View History

2021-01-13 01:35:30 +02:00
package model
2021-01-13 02:44:50 +02:00
import (
"encoding/json"
"io"
)
2021-02-17 21:29:20 +02:00
// Sharing is sharing information for a root block
// swagger:model
2021-01-13 01:35:30 +02:00
type Sharing struct {
2021-02-17 21:29:20 +02:00
// ID of the root block
// required: true
ID string `json:"id"`
// Is sharing enabled
// required: true
Enabled bool `json:"enabled"`
// Access token
// required: true
Token string `json:"token"`
// ID of the user who last modified this
// required: true
2021-01-13 01:35:30 +02:00
ModifiedBy string `json:"modifiedBy"`
2021-02-17 21:29:20 +02:00
// Updated time in miliseconds since the current epoch
2021-02-17 21:29:20 +02:00
// required: true
UpdateAt int64 `json:"update_at,omitempty"`
2021-01-13 01:35:30 +02:00
}
2021-01-13 02:44:50 +02:00
func SharingFromJSON(data io.Reader) Sharing {
var sharing Sharing
_ = json.NewDecoder(data).Decode(&sharing)
2021-01-13 02:44:50 +02:00
return sharing
}