func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) {
	if e.ns != "" && event.Namespace != e.ns {
		return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.ns)
	}
	result := &v1.Event{}
	err := e.client.Post().
		NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0).
		Resource("events").
		Body(event).
		Do(context.TODO()).
		Into(result)
	return result, err
}
CreateWithEventNamespace makes a new event. Returns the copy of the event the server returns,
or an error. The namespace to create the event within is deduced from the
event; it must either match this event client's namespace, or this event
client must have been created with the "" namespace.
package v1
import (
	"context"
	"fmt"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/fields"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/types"
	ref "k8s.io/client-go/tools/reference"
)
type EventExpansion interface {
	CreateWithEventNamespace(event *v1.Event) (*v1.Event, error)
	UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error)
	PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error)
	Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error)
	GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector
}