func (r SoftRef) IsValid() bool {
	return IsValidRID(string(r))
}
IsValid returns true if the soft reference RID is valid, otherwise false.
package res
import "encoding/json"
type Ref string
type SoftRef string
type DataValue struct {
	Data interface{} `json:"data"`
}
const (
	refPrefix     = `{"rid":`
	softRefSuffix = `,"soft":true}`
	refSuffix     = '}'
)
type ResourceType byte
const (
	TypeUnset ResourceType = iota
	TypeModel
	TypeCollection
)
var DeleteAction = &struct{ json.RawMessage }{RawMessage: json.RawMessage(`{"action":"delete"}`)}
func (r Ref) MarshalJSON() ([]byte, error) {
	rid, err := json.Marshal(string(r))
	if err != nil {
		return nil, err
	}
	o := make([]byte, len(rid)+8)
	copy(o, refPrefix)
	copy(o[7:], rid)
	o[len(o)-1] = refSuffix
	return o, nil
}
func (r *Ref) UnmarshalJSON(b []byte) error {
	var p struct {
		RID string `json:"rid"`
	}
	err := json.Unmarshal(b, &p)
	if err != nil {
		return err
	}
	*r = Ref(p.RID)
	return nil
}
func (r Ref) IsValid() bool {
	return IsValidRID(string(r))
}
func (r SoftRef) MarshalJSON() ([]byte, error) {
	rid, err := json.Marshal(string(r))
	if err != nil {
		return nil, err
	}
	o := make([]byte, len(rid)+20)
	copy(o, refPrefix)
	copy(o[7:], rid)
	copy(o[len(o)-13:], softRefSuffix)
	return o, nil
}
func (r *SoftRef) UnmarshalJSON(b []byte) error {
	var p struct {
		RID string `json:"rid"`
	}
	err := json.Unmarshal(b, &p)
	if err != nil {
		return err
	}
	*r = SoftRef(p.RID)
	return nil
}