// 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 (
	DeleteEventType = "IgdbGameDelete"
)

type Delete = IgdbGameDelete

type IgdbGameDeleteHandler func(context.Context, *eventbus.Header, *IgdbGameDelete) error

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

func RegisterIgdbGameDeleteHandler(mux *eventbus.Mux, f IgdbGameDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f IgdbGameDeleteHandler) {
	RegisterIgdbGameDeleteHandler(mux, f)
}

func (*IgdbGameDelete) EventBusName() string {
	return DeleteEventType
}
