func (k *KatibClient) GetSuggestion(name string, namespace ...string) (
	*suggestionsv1beta1.Suggestion, error) {
	ns := getNamespace(namespace...)
	suggestion := &suggestionsv1beta1.Suggestion{}
	if err := k.client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: ns}, suggestion); err != nil {
		return nil, err
	}
	return suggestion, nil
}
GetSuggestion returns the Suggestion CR for the given name and namespace
package katibclient
import (
	"context"
	apiv1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/client-go/kubernetes/scheme"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/client/config"
	experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1"
	suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1"
	trialsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1"
	"github.com/kubeflow/katib/pkg/controller.v1beta1/consts"
)
type Client interface {
	InjectClient(c client.Client)
	GetClient() client.Client
	GetExperimentList(namespace ...string) (*experimentsv1beta1.ExperimentList, error)
	GetExperiment(name string, namespace ...string) (*experimentsv1beta1.Experiment, error)
	GetConfigMap(name string, namespace ...string) (map[string]string, error)
	GetTrial(name string, namespace ...string) (*trialsv1beta1.Trial, error)
	GetTrialList(name string, namespace ...string) (*trialsv1beta1.TrialList, error)
	GetTrialTemplates(namespace ...string) (*apiv1.ConfigMapList, error)
	GetSuggestion(name string, namespace ...string) (*suggestionsv1beta1.Suggestion, error)
	GetNamespaceList() (*apiv1.NamespaceList, error)
	CreateRuntimeObject(object client.Object) error
	DeleteRuntimeObject(object client.Object) error
	UpdateRuntimeObject(object client.Object) error
}
type KatibClient struct {
	client client.Client
}
func NewWithGivenClient(c client.Client) Client {
	return &KatibClient{
		client: c,
	}
}
func NewClient(options client.Options) (Client, error) {
	cfg, err := config.GetConfig()
	if err != nil {
		return nil, err
	}
	if err = experimentsv1beta1.AddToScheme(scheme.Scheme); err != nil {
		return nil, err
	}
	if err = trialsv1beta1.AddToScheme(scheme.Scheme); err != nil {
		return nil, err
	}
	if err = suggestionsv1beta1.AddToScheme(scheme.Scheme); err != nil {
		return nil, err
	}
	cl, err := client.New(cfg, options)
	if err != nil {
		return nil, err
	}
	return &KatibClient{
		client: cl,
	}, nil
}
func (k *KatibClient) InjectClient(c client.Client) {
	k.client = c
}
func (k *KatibClient) GetClient() client.Client {
	return k.client
}
func (k *KatibClient) GetExperimentList(namespace ...string) (*experimentsv1beta1.ExperimentList, error) {
	ns := getNamespace(namespace...)
	expList := &experimentsv1beta1.ExperimentList{}
	listOpt := client.InNamespace(ns)
	if err := k.client.List(context.Background(), expList, listOpt); err != nil {
		return expList, err
	}
	return expList, nil
}