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

package chat_ban

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "ChatBanDelete"
)

type Delete = ChatBanDelete

type ChatBanDeleteHandler func(context.Context, *eventbus.Header, *ChatBanDelete) error

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

func RegisterChatBanDeleteHandler(mux *eventbus.Mux, f ChatBanDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f ChatBanDeleteHandler) {
	RegisterChatBanDeleteHandler(mux, f)
}

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