// NOTE this is a generated file! do not edit!

package igdb_game

import (
	"context"

	"github.com/golang/protobuf/proto"

	eventbus "code.justin.tv/eventbus/client"
)

const (
	CreateEventType = "IgdbGameCreate"
)

type Create = IgdbGameCreate

type IgdbGameCreateHandler func(context.Context, *eventbus.Header, *IgdbGameCreate) error

func (h IgdbGameCreateHandler) Handler() eventbus.Handler {
	return func(ctx context.Context, message eventbus.RawMessage) error {
		dst := &IgdbGameCreate{}
		err := proto.Unmarshal(message.Payload, dst)
		if err != nil {
			return err
		}
		return h(ctx, message.Header, dst)
	}
}

func RegisterIgdbGameCreateHandler(mux *eventbus.Mux, f IgdbGameCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f IgdbGameCreateHandler) {
	RegisterIgdbGameCreateHandler(mux, f)
}

func (*IgdbGameCreate) EventBusName() string {
	return CreateEventType
}
