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

package raid_moderation_action

import (
	"context"

	"github.com/golang/protobuf/proto"

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

const (
	CreateEventType = "RaidModerationActionCreate"
)

type Create = RaidModerationActionCreate

type RaidModerationActionCreateHandler func(context.Context, *eventbus.Header, *RaidModerationActionCreate) error

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

func RegisterRaidModerationActionCreateHandler(mux *eventbus.Mux, f RaidModerationActionCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f RaidModerationActionCreateHandler) {
	RegisterRaidModerationActionCreateHandler(mux, f)
}

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