// 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 (
	UpdateEventType = "BoostOrderUpdate"
)

type Update = BoostOrderUpdate

type BoostOrderUpdateHandler func(context.Context, *eventbus.Header, *BoostOrderUpdate) error

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

func RegisterBoostOrderUpdateHandler(mux *eventbus.Mux, f BoostOrderUpdateHandler) {
	mux.RegisterHandler(UpdateEventType, f.Handler())
}

func RegisterUpdateHandler(mux *eventbus.Mux, f BoostOrderUpdateHandler) {
	RegisterBoostOrderUpdateHandler(mux, f)
}

func (*BoostOrderUpdate) EventBusName() string {
	return UpdateEventType
}
