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

package boost_order

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "BoostOrderDelete"
)

type Delete = BoostOrderDelete

type BoostOrderDeleteHandler func(context.Context, *eventbus.Header, *BoostOrderDelete) error

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

func RegisterBoostOrderDeleteHandler(mux *eventbus.Mux, f BoostOrderDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f BoostOrderDeleteHandler) {
	RegisterBoostOrderDeleteHandler(mux, f)
}

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