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

package host_moderation_action

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "HostModerationActionCreate"
)

type Create = HostModerationActionCreate

type HostModerationActionCreateHandler func(context.Context, *eventbus.Header, *HostModerationActionCreate) error

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

func RegisterHostModerationActionCreateHandler(mux *eventbus.Mux, f HostModerationActionCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f HostModerationActionCreateHandler) {
	RegisterHostModerationActionCreateHandler(mux, f)
}

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