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

package entitlement_emote

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "EntitlementEmoteCreate"
)

type Create = EntitlementEmoteCreate

type EntitlementEmoteCreateHandler func(context.Context, *eventbus.Header, *EntitlementEmoteCreate) error

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

func RegisterEntitlementEmoteCreateHandler(mux *eventbus.Mux, f EntitlementEmoteCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f EntitlementEmoteCreateHandler) {
	RegisterEntitlementEmoteCreateHandler(mux, f)
}

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