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

package entitlement_drop

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "EntitlementDropCreate"
)

type Create = EntitlementDropCreate

type EntitlementDropCreateHandler func(context.Context, *eventbus.Header, *EntitlementDropCreate) error

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

func RegisterEntitlementDropCreateHandler(mux *eventbus.Mux, f EntitlementDropCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f EntitlementDropCreateHandler) {
	RegisterEntitlementDropCreateHandler(mux, f)
}

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