func (r profiles) Delete(ctx context.Context, name string, opts options.DeleteOptions) (*apiv3.Profile, error) {
	if name == cresources.DefaultAllowProfileName {
		return nil, cerrors.ErrorOperationNotSupported{
			Operation:  "Delete",
			Identifier: cresources.DefaultAllowProfileName,
			Reason:     fmt.Sprintf("The profile %q is a default provided by Calico and cannot be deleted", cresources.DefaultAllowProfileName),
		}
	}
	out, err := r.client.resources.Delete(ctx, opts, apiv3.KindProfile, noNamespace, name)
	if out != nil {
		return out.(*apiv3.Profile), err
	}
	return nil, err
}
Delete takes name of the Profile and deletes it. Returns an error if one occurs.
package clientv3
import (
	"context"
	"fmt"
	apiv3 "github.com/projectcalico/api/pkg/apis/projectcalico/v3"
	cerrors "github.com/projectcalico/libcalico-go/lib/errors"
	"github.com/projectcalico/libcalico-go/lib/options"
	cresources "github.com/projectcalico/libcalico-go/lib/resources"
	validator "github.com/projectcalico/libcalico-go/lib/validator/v3"
	"github.com/projectcalico/libcalico-go/lib/watch"
)
type ProfileInterface interface {
	Create(ctx context.Context, res *apiv3.Profile, opts options.SetOptions) (*apiv3.Profile, error)
	Update(ctx context.Context, res *apiv3.Profile, opts options.SetOptions) (*apiv3.Profile, error)
	Delete(ctx context.Context, name string, opts options.DeleteOptions) (*apiv3.Profile, error)
	Get(ctx context.Context, name string, opts options.GetOptions) (*apiv3.Profile, error)
	List(ctx context.Context, opts options.ListOptions) (*apiv3.ProfileList, error)
	Watch(ctx context.Context, opts options.ListOptions) (watch.Interface, error)
}
type profiles struct {
	client client
}
func (r profiles) Create(ctx context.Context, res *apiv3.Profile, opts options.SetOptions) (*apiv3.Profile, error) {
	if res.Name == cresources.DefaultAllowProfileName {
		return nil, cerrors.ErrorResourceAlreadyExists{
			Err:        fmt.Errorf("%v already exists. The profile %q is default provided by Calico", cresources.DefaultAllowProfileName, cresources.DefaultAllowProfileName),
			Identifier: cresources.DefaultAllowProfileName,
		}
	}
	if err := validator.Validate(res); err != nil {
		return nil, err
	}
	out, err := r.client.resources.Create(ctx, opts, apiv3.KindProfile, res)
	if out != nil {
		return out.(*apiv3.Profile), err
	}
	return nil, err
}
func (r profiles) Update(ctx context.Context, res *apiv3.Profile, opts options.SetOptions) (*apiv3.Profile, error) {
	if res.Name == cresources.DefaultAllowProfileName {
		return nil, cerrors.ErrorOperationNotSupported{
			Operation:  "Update",
			Identifier: cresources.DefaultAllowProfileName,
			Reason:     fmt.Sprintf("The profile %q is a default provided by Calico and cannot be updated", cresources.DefaultAllowProfileName),
		}
	}
	if err := validator.Validate(res); err != nil {
		return nil, err
	}
	out, err := r.client.resources.Update(ctx, opts, apiv3.KindProfile, res)
	if out != nil {
		return out.(*apiv3.Profile), err
	}
	return nil, err
}