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

package content_tags

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	UpdateEventType = "ContentTagsUpdate"
)

type Update = ContentTagsUpdate

type ContentTagsUpdateHandler func(context.Context, *eventbus.Header, *ContentTagsUpdate) error

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

func RegisterContentTagsUpdateHandler(mux *eventbus.Mux, f ContentTagsUpdateHandler) {
	mux.RegisterHandler(UpdateEventType, f.Handler())
}

func RegisterUpdateHandler(mux *eventbus.Mux, f ContentTagsUpdateHandler) {
	RegisterContentTagsUpdateHandler(mux, f)
}

func (*ContentTagsUpdate) EventBusName() string {
	return UpdateEventType
}
