func CheckEventType(e Event) error {
	if GetEventTypeName(e) == "" {
		return UnknownEventTypeErr(fmt.Sprintf(
			"unknown event type %s", reflect.TypeOf(e),
		))
	}
	return nil
}
CheckEventType returns an error if the given object isn't a valid event,
otherwise returns nil.
package generated
import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"os"
	"reflect"
	"time"
	srctickets "tickets"
	srcticketsid "tickets/id"
	srcticketsserviceticketsio "tickets/service/tickets/io"
	srcticketsserviceusersio "tickets/service/users/io"
)
type Logger interface {
	Printf(format string, values ...interface{})
}
type fallbackLog struct{ w io.Writer }
func (l *fallbackLog) Printf(format string, values ...interface{}) {
	fmt.Fprintf(l.w, format, values...)
}
var defaultLogErr = &fallbackLog{os.Stderr}
type Event = interface{}
type EventTicketClosed struct {
	Ticket srcticketsid.Ticket "json:\"ticket\""
	By srcticketsid.User "json:\"by\""
}
type EventTicketCommented struct {
	Id srcticketsid.Comment "json:\"id\""
	Ticket srcticketsid.Ticket "json:\"ticket\""
	Message srctickets.TicketCommentMessage "json:\"message\""
	By srcticketsid.User "json:\"by\""
}
type EventTicketCreated struct {
	Id srcticketsid.Ticket "json:\"id\""
	Title srctickets.TicketTitle "json:\"title\""
	Description srctickets.TicketDescription "json:\"description\""
	Author srcticketsid.User "json:\"author\""
}
type EventTicketDescriptionChanged struct {
	Ticket srcticketsid.Ticket "json:\"ticket\""
	NewDescription srctickets.TicketDescription "json:\"newDescription\""
	By srcticketsid.User "json:\"by\""
}
type EventTicketTitleChanged struct {
	Ticket srcticketsid.Ticket "json:\"ticket\""
	NewTitle srctickets.TicketTitle "json:\"newTitle\""
	By srcticketsid.User "json:\"by\""
}
type EventUserAssignedToTicket struct {
	User srcticketsid.User "json:\"user\""
	Ticket srcticketsid.Ticket "json:\"ticket\""
	By srcticketsid.User "json:\"by\""
}
type EventUserCreated struct {
	Id srcticketsid.User "json:\"id\""
	Name srctickets.UserName "json:\"name\""
}
type EventUserUnassignedFromTicket struct {
	User srcticketsid.User "json:\"user\""
	Ticket srcticketsid.Ticket "json:\"ticket\""
	By srcticketsid.User "json:\"by\""
}
func GetEventTypeName(e Event) string {
	switch e.(type) {
	case EventTicketClosed:
		return "TicketClosed"
	case EventTicketCommented:
		return "TicketCommented"
	case EventTicketCreated:
		return "TicketCreated"
	case EventTicketDescriptionChanged:
		return "TicketDescriptionChanged"
	case EventTicketTitleChanged:
		return "TicketTitleChanged"
	case EventUserAssignedToTicket:
		return "UserAssignedToTicket"
	case EventUserCreated:
		return "UserCreated"
	case EventUserUnassignedFromTicket:
		return "UserUnassignedFromTicket"
	}
	return ""
}