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

package entitlement_drop_batch

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "EntitlementDropBatchCreate"
)

type Create = EntitlementDropBatchCreate

type EntitlementDropBatchCreateHandler func(context.Context, *eventbus.Header, *EntitlementDropBatchCreate) error

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

func RegisterEntitlementDropBatchCreateHandler(mux *eventbus.Mux, f EntitlementDropBatchCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f EntitlementDropBatchCreateHandler) {
	RegisterEntitlementDropBatchCreateHandler(mux, f)
}

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