generated-event.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT.
  2. package client
  3. import "encoding/json"
  4. import "fmt"
  5. type EventLspClientDiagnostics struct {
  6. // Path corresponds to the JSON schema field "path".
  7. Path string `json:"path" yaml:"path" mapstructure:"path"`
  8. // ServerID corresponds to the JSON schema field "serverID".
  9. ServerID string `json:"serverID" yaml:"serverID" mapstructure:"serverID"`
  10. }
  11. // UnmarshalJSON implements json.Unmarshaler.
  12. func (j *EventLspClientDiagnostics) UnmarshalJSON(value []byte) error {
  13. var raw map[string]interface{}
  14. if err := json.Unmarshal(value, &raw); err != nil {
  15. return err
  16. }
  17. if _, ok := raw["path"]; raw != nil && !ok {
  18. return fmt.Errorf("field path in EventLspClientDiagnostics: required")
  19. }
  20. if _, ok := raw["serverID"]; raw != nil && !ok {
  21. return fmt.Errorf("field serverID in EventLspClientDiagnostics: required")
  22. }
  23. type Plain EventLspClientDiagnostics
  24. var plain Plain
  25. if err := json.Unmarshal(value, &plain); err != nil {
  26. return err
  27. }
  28. *j = EventLspClientDiagnostics(plain)
  29. return nil
  30. }
  31. type EventStorageWrite struct {
  32. // Content corresponds to the JSON schema field "content".
  33. Content interface{} `json:"content" yaml:"content" mapstructure:"content"`
  34. // Key corresponds to the JSON schema field "key".
  35. Key string `json:"key" yaml:"key" mapstructure:"key"`
  36. }
  37. // UnmarshalJSON implements json.Unmarshaler.
  38. func (j *EventStorageWrite) UnmarshalJSON(value []byte) error {
  39. var raw map[string]interface{}
  40. if err := json.Unmarshal(value, &raw); err != nil {
  41. return err
  42. }
  43. if _, ok := raw["content"]; raw != nil && !ok {
  44. return fmt.Errorf("field content in EventStorageWrite: required")
  45. }
  46. if _, ok := raw["key"]; raw != nil && !ok {
  47. return fmt.Errorf("field key in EventStorageWrite: required")
  48. }
  49. type Plain EventStorageWrite
  50. var plain Plain
  51. if err := json.Unmarshal(value, &plain); err != nil {
  52. return err
  53. }
  54. *j = EventStorageWrite(plain)
  55. return nil
  56. }