2021-01-13 00:35:30 +01:00
|
|
|
package model
|
|
|
|
|
2021-01-13 01:44:50 +01:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
2021-02-17 20:29:20 +01:00
|
|
|
// Sharing is sharing information for a root block
|
|
|
|
// swagger:model
|
2021-01-13 00:35:30 +01:00
|
|
|
type Sharing struct {
|
2021-02-17 20:29:20 +01: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 00:35:30 +01:00
|
|
|
ModifiedBy string `json:"modifiedBy"`
|
2021-02-17 20:29:20 +01:00
|
|
|
|
2022-04-15 19:21:10 +02:00
|
|
|
// Updated time in miliseconds since the current epoch
|
2021-02-17 20:29:20 +01:00
|
|
|
// required: true
|
|
|
|
UpdateAt int64 `json:"update_at,omitempty"`
|
2021-01-13 00:35:30 +01:00
|
|
|
}
|
2021-01-13 01:44:50 +01:00
|
|
|
|
|
|
|
func SharingFromJSON(data io.Reader) Sharing {
|
|
|
|
var sharing Sharing
|
2021-06-21 11:21:42 +02:00
|
|
|
_ = json.NewDecoder(data).Decode(&sharing)
|
2021-01-13 01:44:50 +01:00
|
|
|
return sharing
|
|
|
|
}
|