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

package shared_ban_information_relationship

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "SharedBanInformationRelationshipCreate"
)

type Create = SharedBanInformationRelationshipCreate

type SharedBanInformationRelationshipCreateHandler func(context.Context, *eventbus.Header, *SharedBanInformationRelationshipCreate) error

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

func RegisterSharedBanInformationRelationshipCreateHandler(mux *eventbus.Mux, f SharedBanInformationRelationshipCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f SharedBanInformationRelationshipCreateHandler) {
	RegisterSharedBanInformationRelationshipCreateHandler(mux, f)
}

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