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

package user_social_media_link

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "UserSocialMediaLinkDelete"
)

type Delete = UserSocialMediaLinkDelete

type UserSocialMediaLinkDeleteHandler func(context.Context, *eventbus.Header, *UserSocialMediaLinkDelete) error

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

func RegisterUserSocialMediaLinkDeleteHandler(mux *eventbus.Mux, f UserSocialMediaLinkDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f UserSocialMediaLinkDeleteHandler) {
	RegisterUserSocialMediaLinkDeleteHandler(mux, f)
}

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