generated-event.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 EventMessageUpdated struct {
  32. // MessageID corresponds to the JSON schema field "messageID".
  33. MessageID string `json:"messageID" yaml:"messageID" mapstructure:"messageID"`
  34. // SessionID corresponds to the JSON schema field "sessionID".
  35. SessionID string `json:"sessionID" yaml:"sessionID" mapstructure:"sessionID"`
  36. }
  37. // UnmarshalJSON implements json.Unmarshaler.
  38. func (j *EventMessageUpdated) 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["messageID"]; raw != nil && !ok {
  44. return fmt.Errorf("field messageID in EventMessageUpdated: required")
  45. }
  46. if _, ok := raw["sessionID"]; raw != nil && !ok {
  47. return fmt.Errorf("field sessionID in EventMessageUpdated: required")
  48. }
  49. type Plain EventMessageUpdated
  50. var plain Plain
  51. if err := json.Unmarshal(value, &plain); err != nil {
  52. return err
  53. }
  54. *j = EventMessageUpdated(plain)
  55. return nil
  56. }
  57. type EventSessionUpdated struct {
  58. // SessionID corresponds to the JSON schema field "sessionID".
  59. SessionID string `json:"sessionID" yaml:"sessionID" mapstructure:"sessionID"`
  60. }
  61. // UnmarshalJSON implements json.Unmarshaler.
  62. func (j *EventSessionUpdated) UnmarshalJSON(value []byte) error {
  63. var raw map[string]interface{}
  64. if err := json.Unmarshal(value, &raw); err != nil {
  65. return err
  66. }
  67. if _, ok := raw["sessionID"]; raw != nil && !ok {
  68. return fmt.Errorf("field sessionID in EventSessionUpdated: required")
  69. }
  70. type Plain EventSessionUpdated
  71. var plain Plain
  72. if err := json.Unmarshal(value, &plain); err != nil {
  73. return err
  74. }
  75. *j = EventSessionUpdated(plain)
  76. return nil
  77. }
  78. type EventStorageWrite struct {
  79. // Content corresponds to the JSON schema field "content".
  80. Content interface{} `json:"content" yaml:"content" mapstructure:"content"`
  81. // Key corresponds to the JSON schema field "key".
  82. Key string `json:"key" yaml:"key" mapstructure:"key"`
  83. }
  84. // UnmarshalJSON implements json.Unmarshaler.
  85. func (j *EventStorageWrite) UnmarshalJSON(value []byte) error {
  86. var raw map[string]interface{}
  87. if err := json.Unmarshal(value, &raw); err != nil {
  88. return err
  89. }
  90. if _, ok := raw["content"]; raw != nil && !ok {
  91. return fmt.Errorf("field content in EventStorageWrite: required")
  92. }
  93. if _, ok := raw["key"]; raw != nil && !ok {
  94. return fmt.Errorf("field key in EventStorageWrite: required")
  95. }
  96. type Plain EventStorageWrite
  97. var plain Plain
  98. if err := json.Unmarshal(value, &plain); err != nil {
  99. return err
  100. }
  101. *j = EventStorageWrite(plain)
  102. return nil
  103. }