// 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 (
	CreateEventType = "ChatUnbanRequestCreate"
)

type Create = ChatUnbanRequestCreate

type ChatUnbanRequestCreateHandler func(context.Context, *eventbus.Header, *ChatUnbanRequestCreate) error

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

func RegisterChatUnbanRequestCreateHandler(mux *eventbus.Mux, f ChatUnbanRequestCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f ChatUnbanRequestCreateHandler) {
	RegisterChatUnbanRequestCreateHandler(mux, f)
}

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