focalboard/server/model/sharing.go

37 lines
663 B
Go
Raw Permalink Normal View History

2021-01-12 15:35:30 -08:00
package model
2021-01-12 16:44:50 -08:00
import (
"encoding/json"
"io"
)
2021-02-17 11:29:20 -08:00
// Sharing is sharing information for a root block
// swagger:model
2021-01-12 15:35:30 -08:00
type Sharing struct {
2021-02-17 11:29:20 -08: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-12 15:35:30 -08:00
ModifiedBy string `json:"modifiedBy"`
2021-02-17 11:29:20 -08:00
// Updated time
// required: true
UpdateAt int64 `json:"update_at,omitempty"`
2021-01-12 15:35:30 -08:00
}
2021-01-12 16:44:50 -08:00
func SharingFromJSON(data io.Reader) Sharing {
var sharing Sharing
_ = json.NewDecoder(data).Decode(&sharing)
2021-01-12 16:44:50 -08:00
return sharing
}