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

package entitlement_emote

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "EntitlementEmoteDelete"
)

type Delete = EntitlementEmoteDelete

type EntitlementEmoteDeleteHandler func(context.Context, *eventbus.Header, *EntitlementEmoteDelete) error

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

func RegisterEntitlementEmoteDeleteHandler(mux *eventbus.Mux, f EntitlementEmoteDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f EntitlementEmoteDeleteHandler) {
	RegisterEntitlementEmoteDeleteHandler(mux, f)
}

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