// 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
}
