// 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 (
	CreateEventType = "UserSocialMediaLinkCreate"
)

type Create = UserSocialMediaLinkCreate

type UserSocialMediaLinkCreateHandler func(context.Context, *eventbus.Header, *UserSocialMediaLinkCreate) error

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

func RegisterUserSocialMediaLinkCreateHandler(mux *eventbus.Mux, f UserSocialMediaLinkCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f UserSocialMediaLinkCreateHandler) {
	RegisterUserSocialMediaLinkCreateHandler(mux, f)
}

func (*UserSocialMediaLinkCreate) EventBusName() string {
	return CreateEventType
}
