// 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 (
	CreateEventType = "BoostOrderCreate"
)

type Create = BoostOrderCreate

type BoostOrderCreateHandler func(context.Context, *eventbus.Header, *BoostOrderCreate) error

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

func RegisterBoostOrderCreateHandler(mux *eventbus.Mux, f BoostOrderCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f BoostOrderCreateHandler) {
	RegisterBoostOrderCreateHandler(mux, f)
}

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