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

package user_ban

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "UserBanDelete"
)

type Delete = UserBanDelete

type UserBanDeleteHandler func(context.Context, *eventbus.Header, *UserBanDelete) error

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

func RegisterUserBanDeleteHandler(mux *eventbus.Mux, f UserBanDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f UserBanDeleteHandler) {
	RegisterUserBanDeleteHandler(mux, f)
}

func (*UserBanDelete) EventBusName() string {
	return DeleteEventType
}
