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

package channel_moderator

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "ChannelModeratorDelete"
)

type Delete = ChannelModeratorDelete

type ChannelModeratorDeleteHandler func(context.Context, *eventbus.Header, *ChannelModeratorDelete) error

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

func RegisterChannelModeratorDeleteHandler(mux *eventbus.Mux, f ChannelModeratorDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f ChannelModeratorDeleteHandler) {
	RegisterChannelModeratorDeleteHandler(mux, f)
}

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