func (n *Note) MarshalJSON() ([]byte, error) {
	if err := n.Validate(); err != nil {
		return nil, err
	}
	doc := struct {
		noteAlias
		Type     string     `json:"type"`
		Imported *time.Time `json:"imported,omitempty"`
	}{
		Type:      "note",
		noteAlias: noteAlias(*n),
	}
	if !n.Imported.IsZero() {
		doc.Imported = &n.Imported
	}
	return json.Marshal(doc)
}
// MarshalJSON implements the json.Marshaler interface for the Note type.
MarshalJSON implements the json.Marshaler interface for the Note type.
// MarshalJSON implements the json . Marshaler interface for the Note type .
func (n *Note) MarshalJSON() ([]byte, error) {
	if err := n.Validate(); err != nil {
		return nil, err
	}
	doc := struct {
		noteAlias
		Type     string     `json:"type"`
		Imported *time.Time `json:"imported,omitempty"`
	}{
		Type:      "note",
		noteAlias: noteAlias(*n),
	}
	if !n.Imported.IsZero() {
		doc.Imported = &n.Imported
	}
	return json.Marshal(doc)
}
func ( n * Note ) MarshalJSON ( ) ( [ ] byte , error ) { if err := n . Validate ( ) ; err != nil { return nil , err } doc := struct { noteAlias Type string `json:"type"` Imported * time . Time `json:"imported,omitempty"` } { Type : " " , noteAlias : noteAlias ( * n ) , } if ! n . Imported . IsZero ( ) { doc . Imported = & n . Imported } return json . Marshal ( doc ) }
MarshalJSON implements the json.Marshaler interface for the Note type.
MarshalJSON implements the json . Marshaler interface for the Note type .