func (e *Event) SetDataContentType(ct string) {
	if err := e.Context.SetDataContentType(ct); err != nil {
		e.fieldError("datacontenttype", err)
	} else {
		e.fieldOK("datacontenttype")
	}
}
SetDataContentType implements EventWriter.SetDataContentType
package event
import (
	"fmt"
	"time"
)
var _ EventWriter = (*Event)(nil)
func (e *Event) SetSpecVersion(v string) {
	switch v {
	case CloudEventsVersionV03:
		if e.Context == nil {
			e.Context = &EventContextV03{}
		} else {
			e.Context = e.Context.AsV03()
		}
	case CloudEventsVersionV1:
		if e.Context == nil {
			e.Context = &EventContextV1{}
		} else {
			e.Context = e.Context.AsV1()
		}
	default:
		e.fieldError("specversion", fmt.Errorf("a valid spec version is required: [%s, %s]",
			CloudEventsVersionV03, CloudEventsVersionV1))
		return
	}
	e.fieldOK("specversion")
}
func (e *Event) SetType(t string) {
	if err := e.Context.SetType(t); err != nil {
		e.fieldError("type", err)
	} else {
		e.fieldOK("type")
	}
}
func (e *Event) SetSource(s string) {
	if err := e.Context.SetSource(s); err != nil {
		e.fieldError("source", err)
	} else {
		e.fieldOK("source")
	}
}
func (e *Event) SetSubject(s string) {
	if err := e.Context.SetSubject(s); err != nil {
		e.fieldError("subject", err)
	} else {
		e.fieldOK("subject")
	}
}
func (e *Event) SetID(id string) {
	if err := e.Context.SetID(id); err != nil {
		e.fieldError("id", err)
	} else {
		e.fieldOK("id")
	}
}
func (e *Event) SetTime(t time.Time) {
	if err := e.Context.SetTime(t); err != nil {
		e.fieldError("time", err)
	} else {
		e.fieldOK("time")
	}
}
func (e *Event) SetDataSchema(s string) {
	if err := e.Context.SetDataSchema(s); err != nil {
		e.fieldError("dataschema", err)
	} else {
		e.fieldOK("dataschema")
	}
}