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

package chat_ban

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "ChatBanCreate"
)

type Create = ChatBanCreate

type ChatBanCreateHandler func(context.Context, *eventbus.Header, *ChatBanCreate) error

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

func RegisterChatBanCreateHandler(mux *eventbus.Mux, f ChatBanCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f ChatBanCreateHandler) {
	RegisterChatBanCreateHandler(mux, f)
}

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