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

package raid_moderation_action

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "RaidModerationActionDelete"
)

type Delete = RaidModerationActionDelete

type RaidModerationActionDeleteHandler func(context.Context, *eventbus.Header, *RaidModerationActionDelete) error

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

func RegisterRaidModerationActionDeleteHandler(mux *eventbus.Mux, f RaidModerationActionDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f RaidModerationActionDeleteHandler) {
	RegisterRaidModerationActionDeleteHandler(mux, f)
}

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