summaryrefslogtreecommitdiffhomepage
path: root/pkg/client/generated-event.go
blob: 0d8e67eb737f0ad23d1bde9933ac7642b3f88b73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT.

package client

import "encoding/json"
import "fmt"

type EventLspClientDiagnostics struct {
	// Path corresponds to the JSON schema field "path".
	Path string `json:"path" yaml:"path" mapstructure:"path"`

	// ServerID corresponds to the JSON schema field "serverID".
	ServerID string `json:"serverID" yaml:"serverID" mapstructure:"serverID"`
}

// UnmarshalJSON implements json.Unmarshaler.
func (j *EventLspClientDiagnostics) UnmarshalJSON(value []byte) error {
	var raw map[string]interface{}
	if err := json.Unmarshal(value, &raw); err != nil {
		return err
	}
	if _, ok := raw["path"]; raw != nil && !ok {
		return fmt.Errorf("field path in EventLspClientDiagnostics: required")
	}
	if _, ok := raw["serverID"]; raw != nil && !ok {
		return fmt.Errorf("field serverID in EventLspClientDiagnostics: required")
	}
	type Plain EventLspClientDiagnostics
	var plain Plain
	if err := json.Unmarshal(value, &plain); err != nil {
		return err
	}
	*j = EventLspClientDiagnostics(plain)
	return nil
}

type EventStorageWrite struct {
	// Content corresponds to the JSON schema field "content".
	Content interface{} `json:"content" yaml:"content" mapstructure:"content"`

	// Key corresponds to the JSON schema field "key".
	Key string `json:"key" yaml:"key" mapstructure:"key"`
}

// UnmarshalJSON implements json.Unmarshaler.
func (j *EventStorageWrite) UnmarshalJSON(value []byte) error {
	var raw map[string]interface{}
	if err := json.Unmarshal(value, &raw); err != nil {
		return err
	}
	if _, ok := raw["content"]; raw != nil && !ok {
		return fmt.Errorf("field content in EventStorageWrite: required")
	}
	if _, ok := raw["key"]; raw != nil && !ok {
		return fmt.Errorf("field key in EventStorageWrite: required")
	}
	type Plain EventStorageWrite
	var plain Plain
	if err := json.Unmarshal(value, &plain); err != nil {
		return err
	}
	*j = EventStorageWrite(plain)
	return nil
}