summaryrefslogtreecommitdiffhomepage
path: root/pkg/client/generated-event.go
blob: 5062d1169e19339b2ee524a62cfa2ece159d4de6 (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
// Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT.

package client

import "encoding/json"
import "fmt"

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

	// 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["body"]; raw != nil && !ok {
		return fmt.Errorf("field body 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
}