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

package ban_evasion_detection_settings

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	UpdateEventType = "BanEvasionDetectionSettingsUpdate"
)

type Update = BanEvasionDetectionSettingsUpdate

type BanEvasionDetectionSettingsUpdateHandler func(context.Context, *eventbus.Header, *BanEvasionDetectionSettingsUpdate) error

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

func RegisterBanEvasionDetectionSettingsUpdateHandler(mux *eventbus.Mux, f BanEvasionDetectionSettingsUpdateHandler) {
	mux.RegisterHandler(UpdateEventType, f.Handler())
}

func RegisterUpdateHandler(mux *eventbus.Mux, f BanEvasionDetectionSettingsUpdateHandler) {
	RegisterBanEvasionDetectionSettingsUpdateHandler(mux, f)
}

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