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

package host_moderation_action

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "HostModerationActionDelete"
)

type Delete = HostModerationActionDelete

type HostModerationActionDeleteHandler func(context.Context, *eventbus.Header, *HostModerationActionDelete) error

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

func RegisterHostModerationActionDeleteHandler(mux *eventbus.Mux, f HostModerationActionDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f HostModerationActionDeleteHandler) {
	RegisterHostModerationActionDeleteHandler(mux, f)
}

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