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

package user_block_user

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "UserBlockUserCreate"
)

type Create = UserBlockUserCreate

type UserBlockUserCreateHandler func(context.Context, *eventbus.Header, *UserBlockUserCreate) error

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

func RegisterUserBlockUserCreateHandler(mux *eventbus.Mux, f UserBlockUserCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f UserBlockUserCreateHandler) {
	RegisterUserBlockUserCreateHandler(mux, f)
}

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