type DocumentChange … // Valid reports whether the DocumentChange sum-type value is valid, // that is, exactly one of create, delete, edit, or rename. func (ch DocumentChange) Valid() bool { … } func (d *DocumentChange) UnmarshalJSON(data []byte) error { … } func (d *DocumentChange) MarshalJSON() ([]byte, error) { … }