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

package user_session

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	DeleteEventType = "UserSessionDelete"
)

type Delete = UserSessionDelete

type UserSessionDeleteHandler func(context.Context, *eventbus.Header, *UserSessionDelete) error

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

func RegisterUserSessionDeleteHandler(mux *eventbus.Mux, f UserSessionDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f UserSessionDeleteHandler) {
	RegisterUserSessionDeleteHandler(mux, f)
}

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