// NOTE: Boilerplate only.  Ignore this file.

// Package v1 contains API Schema definitions for the ptp v1 API group
// +k8s:deepcopy-gen=package,register
// +groupName=ptp.openshift.io
package v1

import (
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
        "k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/runtime/scheme"
)

var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "ptp.openshift.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme is a global function that registers this API group & version to a scheme
        AddToScheme = SchemeBuilder.AddToScheme
)

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
        return SchemeGroupVersion.WithResource(resource).GroupResource()
}

// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
        return SchemeGroupVersion.WithKind(kind).GroupKind()
}

// addKnownTypes adds our types to the API scheme by registering
// Network and NetworkList
func addKnownTypes(scheme *runtime.Scheme) error {
        scheme.AddKnownTypes(
                SchemeGroupVersion,
                &PtpConfig{},
                &PtpConfigList{},
                &PtpOperatorConfig{},
                &PtpOperatorConfigList{},
                &NodePtpDevice{},
                &NodePtpDeviceList{},
        )
        // register the type in the scheme
        metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
        return nil
}
