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

package chat_unban_request

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	UpdateEventType = "ChatUnbanRequestUpdate"
)

type Update = ChatUnbanRequestUpdate

type ChatUnbanRequestUpdateHandler func(context.Context, *eventbus.Header, *ChatUnbanRequestUpdate) error

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

func RegisterChatUnbanRequestUpdateHandler(mux *eventbus.Mux, f ChatUnbanRequestUpdateHandler) {
	mux.RegisterHandler(UpdateEventType, f.Handler())
}

func RegisterUpdateHandler(mux *eventbus.Mux, f ChatUnbanRequestUpdateHandler) {
	RegisterChatUnbanRequestUpdateHandler(mux, f)
}

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