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

package user_data_request

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "UserDataRequestCreate"
)

type Create = UserDataRequestCreate

type UserDataRequestCreateHandler func(context.Context, *eventbus.Header, *UserDataRequestCreate) error

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

func RegisterUserDataRequestCreateHandler(mux *eventbus.Mux, f UserDataRequestCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f UserDataRequestCreateHandler) {
	RegisterUserDataRequestCreateHandler(mux, f)
}

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