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

package user_recover

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "UserRecoverCreate"
)

type Create = UserRecoverCreate

type UserRecoverCreateHandler func(context.Context, *eventbus.Header, *UserRecoverCreate) error

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

func RegisterUserRecoverCreateHandler(mux *eventbus.Mux, f UserRecoverCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f UserRecoverCreateHandler) {
	RegisterUserRecoverCreateHandler(mux, f)
}

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