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

package shared_ban_information_settings

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	UpdateEventType = "SharedBanInformationSettingsUpdate"
)

type Update = SharedBanInformationSettingsUpdate

type SharedBanInformationSettingsUpdateHandler func(context.Context, *eventbus.Header, *SharedBanInformationSettingsUpdate) error

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

func RegisterSharedBanInformationSettingsUpdateHandler(mux *eventbus.Mux, f SharedBanInformationSettingsUpdateHandler) {
	mux.RegisterHandler(UpdateEventType, f.Handler())
}

func RegisterUpdateHandler(mux *eventbus.Mux, f SharedBanInformationSettingsUpdateHandler) {
	RegisterSharedBanInformationSettingsUpdateHandler(mux, f)
}

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