// Code generated by pkg/config/schema/codegen/tools/collections.main.go. DO NOT EDIT.

package gvk

import (
	"k8s.io/apimachinery/pkg/runtime/schema"

	"istio.io/istio/pkg/config"
	"istio.io/istio/pkg/config/schema/gvr"
	"istio.io/istio/pkg/config/schema/kind"
)

var (
	AuthorizationPolicy            = config.GroupVersionKind{Group: "security.istio.io", Version: "v1", Kind: "AuthorizationPolicy"}
	AuthorizationPolicy_v1beta1    = config.GroupVersionKind{Group: "security.istio.io", Version: "v1beta1", Kind: "AuthorizationPolicy"}
	BackendTLSPolicy               = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha3", Kind: "BackendTLSPolicy"}
	CertificateSigningRequest      = config.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1", Kind: "CertificateSigningRequest"}
	ClusterTrustBundle             = config.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1beta1", Kind: "ClusterTrustBundle"}
	ConfigMap                      = config.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"}
	CustomResourceDefinition       = config.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "v1", Kind: "CustomResourceDefinition"}
	DaemonSet                      = config.GroupVersionKind{Group: "apps", Version: "v1", Kind: "DaemonSet"}
	Deployment                     = config.GroupVersionKind{Group: "apps", Version: "v1", Kind: "Deployment"}
	DestinationRule                = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1", Kind: "DestinationRule"}
	DestinationRule_v1alpha3       = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "DestinationRule"}
	DestinationRule_v1beta1        = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "DestinationRule"}
	EndpointSlice                  = config.GroupVersionKind{Group: "", Version: "v1", Kind: "EndpointSlice"}
	Endpoints                      = config.GroupVersionKind{Group: "", Version: "v1", Kind: "Endpoints"}
	EnvoyFilter                    = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "EnvoyFilter"}
	GRPCRoute                      = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1", Kind: "GRPCRoute"}
	GRPCRoute_v1alpha2             = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "GRPCRoute"}
	Gateway                        = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1", Kind: "Gateway"}
	Gateway_v1alpha3               = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "Gateway"}
	Gateway_v1beta1                = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "Gateway"}
	GatewayClass                   = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1beta1", Kind: "GatewayClass"}
	GatewayClass_v1alpha2          = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "GatewayClass"}
	GatewayClass_v1                = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1", Kind: "GatewayClass"}
	HTTPRoute                      = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1beta1", Kind: "HTTPRoute"}
	HTTPRoute_v1alpha2             = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "HTTPRoute"}
	HTTPRoute_v1                   = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1", Kind: "HTTPRoute"}
	HorizontalPodAutoscaler        = config.GroupVersionKind{Group: "autoscaling", Version: "v2", Kind: "HorizontalPodAutoscaler"}
	InferencePool                  = config.GroupVersionKind{Group: "inference.networking.x-k8s.io", Version: "v1alpha2", Kind: "InferencePool"}
	Ingress                        = config.GroupVersionKind{Group: "networking.k8s.io", Version: "v1", Kind: "Ingress"}
	IngressClass                   = config.GroupVersionKind{Group: "networking.k8s.io", Version: "v1", Kind: "IngressClass"}
	KubernetesGateway              = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1beta1", Kind: "Gateway"}
	KubernetesGateway_v1alpha2     = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "Gateway"}
	KubernetesGateway_v1           = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1", Kind: "Gateway"}
	Lease                          = config.GroupVersionKind{Group: "coordination.k8s.io", Version: "v1", Kind: "Lease"}
	MeshConfig                     = config.GroupVersionKind{Group: "", Version: "v1alpha1", Kind: "MeshConfig"}
	MeshNetworks                   = config.GroupVersionKind{Group: "", Version: "v1alpha1", Kind: "MeshNetworks"}
	MutatingWebhookConfiguration   = config.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfiguration"}
	Namespace                      = config.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"}
	Node                           = config.GroupVersionKind{Group: "", Version: "v1", Kind: "Node"}
	PeerAuthentication             = config.GroupVersionKind{Group: "security.istio.io", Version: "v1", Kind: "PeerAuthentication"}
	PeerAuthentication_v1beta1     = config.GroupVersionKind{Group: "security.istio.io", Version: "v1beta1", Kind: "PeerAuthentication"}
	Pod                            = config.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"}
	PodDisruptionBudget            = config.GroupVersionKind{Group: "policy", Version: "v1", Kind: "PodDisruptionBudget"}
	ProxyConfig                    = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "ProxyConfig"}
	ReferenceGrant                 = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1beta1", Kind: "ReferenceGrant"}
	ReferenceGrant_v1alpha2        = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "ReferenceGrant"}
	RequestAuthentication          = config.GroupVersionKind{Group: "security.istio.io", Version: "v1", Kind: "RequestAuthentication"}
	RequestAuthentication_v1beta1  = config.GroupVersionKind{Group: "security.istio.io", Version: "v1beta1", Kind: "RequestAuthentication"}
	Secret                         = config.GroupVersionKind{Group: "", Version: "v1", Kind: "Secret"}
	Service                        = config.GroupVersionKind{Group: "", Version: "v1", Kind: "Service"}
	ServiceAccount                 = config.GroupVersionKind{Group: "", Version: "v1", Kind: "ServiceAccount"}
	ServiceEntry                   = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1", Kind: "ServiceEntry"}
	ServiceEntry_v1alpha3          = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "ServiceEntry"}
	ServiceEntry_v1beta1           = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "ServiceEntry"}
	Sidecar                        = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1", Kind: "Sidecar"}
	Sidecar_v1alpha3               = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "Sidecar"}
	Sidecar_v1beta1                = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "Sidecar"}
	StatefulSet                    = config.GroupVersionKind{Group: "apps", Version: "v1", Kind: "StatefulSet"}
	TCPRoute                       = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "TCPRoute"}
	TLSRoute                       = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "TLSRoute"}
	Telemetry                      = config.GroupVersionKind{Group: "telemetry.istio.io", Version: "v1", Kind: "Telemetry"}
	Telemetry_v1alpha1             = config.GroupVersionKind{Group: "telemetry.istio.io", Version: "v1alpha1", Kind: "Telemetry"}
	UDPRoute                       = config.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1alpha2", Kind: "UDPRoute"}
	ValidatingWebhookConfiguration = config.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingWebhookConfiguration"}
	VirtualService                 = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1", Kind: "VirtualService"}
	VirtualService_v1alpha3        = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "VirtualService"}
	VirtualService_v1beta1         = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "VirtualService"}
	WasmPlugin                     = config.GroupVersionKind{Group: "extensions.istio.io", Version: "v1alpha1", Kind: "WasmPlugin"}
	WorkloadEntry                  = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1", Kind: "WorkloadEntry"}
	WorkloadEntry_v1alpha3         = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "WorkloadEntry"}
	WorkloadEntry_v1beta1          = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "WorkloadEntry"}
	WorkloadGroup                  = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1", Kind: "WorkloadGroup"}
	WorkloadGroup_v1alpha3         = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "WorkloadGroup"}
	WorkloadGroup_v1beta1          = config.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "WorkloadGroup"}
	XBackendTrafficPolicy          = config.GroupVersionKind{Group: "gateway.networking.x-k8s.io", Version: "v1alpha1", Kind: "XBackendTrafficPolicy"}
	XListenerSet                   = config.GroupVersionKind{Group: "gateway.networking.x-k8s.io", Version: "v1alpha1", Kind: "XListenerSet"}
)

// ToGVR converts a GVK to a GVR.
func ToGVR(g config.GroupVersionKind) (schema.GroupVersionResource, bool) {
	switch g {
	case AuthorizationPolicy:
		return gvr.AuthorizationPolicy, true
	case AuthorizationPolicy_v1beta1:
		return gvr.AuthorizationPolicy_v1beta1, true
	case BackendTLSPolicy:
		return gvr.BackendTLSPolicy, true
	case CertificateSigningRequest:
		return gvr.CertificateSigningRequest, true
	case ClusterTrustBundle:
		return gvr.ClusterTrustBundle, true
	case ConfigMap:
		return gvr.ConfigMap, true
	case CustomResourceDefinition:
		return gvr.CustomResourceDefinition, true
	case DaemonSet:
		return gvr.DaemonSet, true
	case Deployment:
		return gvr.Deployment, true
	case DestinationRule:
		return gvr.DestinationRule, true
	case DestinationRule_v1alpha3:
		return gvr.DestinationRule_v1alpha3, true
	case DestinationRule_v1beta1:
		return gvr.DestinationRule_v1beta1, true
	case EndpointSlice:
		return gvr.EndpointSlice, true
	case Endpoints:
		return gvr.Endpoints, true
	case EnvoyFilter:
		return gvr.EnvoyFilter, true
	case GRPCRoute:
		return gvr.GRPCRoute, true
	case GRPCRoute_v1alpha2:
		return gvr.GRPCRoute_v1alpha2, true
	case Gateway:
		return gvr.Gateway, true
	case Gateway_v1alpha3:
		return gvr.Gateway_v1alpha3, true
	case Gateway_v1beta1:
		return gvr.Gateway_v1beta1, true
	case GatewayClass:
		return gvr.GatewayClass, true
	case GatewayClass_v1alpha2:
		return gvr.GatewayClass_v1alpha2, true
	case GatewayClass_v1:
		return gvr.GatewayClass_v1, true
	case HTTPRoute:
		return gvr.HTTPRoute, true
	case HTTPRoute_v1alpha2:
		return gvr.HTTPRoute_v1alpha2, true
	case HTTPRoute_v1:
		return gvr.HTTPRoute_v1, true
	case HorizontalPodAutoscaler:
		return gvr.HorizontalPodAutoscaler, true
	case InferencePool:
		return gvr.InferencePool, true
	case Ingress:
		return gvr.Ingress, true
	case IngressClass:
		return gvr.IngressClass, true
	case KubernetesGateway:
		return gvr.KubernetesGateway, true
	case KubernetesGateway_v1alpha2:
		return gvr.KubernetesGateway_v1alpha2, true
	case KubernetesGateway_v1:
		return gvr.KubernetesGateway_v1, true
	case Lease:
		return gvr.Lease, true
	case MeshConfig:
		return gvr.MeshConfig, true
	case MeshNetworks:
		return gvr.MeshNetworks, true
	case MutatingWebhookConfiguration:
		return gvr.MutatingWebhookConfiguration, true
	case Namespace:
		return gvr.Namespace, true
	case Node:
		return gvr.Node, true
	case PeerAuthentication:
		return gvr.PeerAuthentication, true
	case PeerAuthentication_v1beta1:
		return gvr.PeerAuthentication_v1beta1, true
	case Pod:
		return gvr.Pod, true
	case PodDisruptionBudget:
		return gvr.PodDisruptionBudget, true
	case ProxyConfig:
		return gvr.ProxyConfig, true
	case ReferenceGrant:
		return gvr.ReferenceGrant, true
	case ReferenceGrant_v1alpha2:
		return gvr.ReferenceGrant_v1alpha2, true
	case RequestAuthentication:
		return gvr.RequestAuthentication, true
	case RequestAuthentication_v1beta1:
		return gvr.RequestAuthentication_v1beta1, true
	case Secret:
		return gvr.Secret, true
	case Service:
		return gvr.Service, true
	case ServiceAccount:
		return gvr.ServiceAccount, true
	case ServiceEntry:
		return gvr.ServiceEntry, true
	case ServiceEntry_v1alpha3:
		return gvr.ServiceEntry_v1alpha3, true
	case ServiceEntry_v1beta1:
		return gvr.ServiceEntry_v1beta1, true
	case Sidecar:
		return gvr.Sidecar, true
	case Sidecar_v1alpha3:
		return gvr.Sidecar_v1alpha3, true
	case Sidecar_v1beta1:
		return gvr.Sidecar_v1beta1, true
	case StatefulSet:
		return gvr.StatefulSet, true
	case TCPRoute:
		return gvr.TCPRoute, true
	case TLSRoute:
		return gvr.TLSRoute, true
	case Telemetry:
		return gvr.Telemetry, true
	case Telemetry_v1alpha1:
		return gvr.Telemetry_v1alpha1, true
	case UDPRoute:
		return gvr.UDPRoute, true
	case ValidatingWebhookConfiguration:
		return gvr.ValidatingWebhookConfiguration, true
	case VirtualService:
		return gvr.VirtualService, true
	case VirtualService_v1alpha3:
		return gvr.VirtualService_v1alpha3, true
	case VirtualService_v1beta1:
		return gvr.VirtualService_v1beta1, true
	case WasmPlugin:
		return gvr.WasmPlugin, true
	case WorkloadEntry:
		return gvr.WorkloadEntry, true
	case WorkloadEntry_v1alpha3:
		return gvr.WorkloadEntry_v1alpha3, true
	case WorkloadEntry_v1beta1:
		return gvr.WorkloadEntry_v1beta1, true
	case WorkloadGroup:
		return gvr.WorkloadGroup, true
	case WorkloadGroup_v1alpha3:
		return gvr.WorkloadGroup_v1alpha3, true
	case WorkloadGroup_v1beta1:
		return gvr.WorkloadGroup_v1beta1, true
	case XBackendTrafficPolicy:
		return gvr.XBackendTrafficPolicy, true
	case XListenerSet:
		return gvr.XListenerSet, true
	}

	return schema.GroupVersionResource{}, false
}

func MustToKind(g config.GroupVersionKind) kind.Kind {
	switch g {
	case AuthorizationPolicy:
		return kind.AuthorizationPolicy
	case BackendTLSPolicy:
		return kind.BackendTLSPolicy
	case CertificateSigningRequest:
		return kind.CertificateSigningRequest
	case ClusterTrustBundle:
		return kind.ClusterTrustBundle
	case ConfigMap:
		return kind.ConfigMap
	case CustomResourceDefinition:
		return kind.CustomResourceDefinition
	case DaemonSet:
		return kind.DaemonSet
	case Deployment:
		return kind.Deployment
	case DestinationRule:
		return kind.DestinationRule
	case EndpointSlice:
		return kind.EndpointSlice
	case Endpoints:
		return kind.Endpoints
	case EnvoyFilter:
		return kind.EnvoyFilter
	case GRPCRoute:
		return kind.GRPCRoute
	case Gateway:
		return kind.Gateway
	case GatewayClass:
		return kind.GatewayClass
	case HTTPRoute:
		return kind.HTTPRoute
	case HorizontalPodAutoscaler:
		return kind.HorizontalPodAutoscaler
	case InferencePool:
		return kind.InferencePool
	case Ingress:
		return kind.Ingress
	case IngressClass:
		return kind.IngressClass
	case KubernetesGateway:
		return kind.KubernetesGateway
	case Lease:
		return kind.Lease
	case MeshConfig:
		return kind.MeshConfig
	case MeshNetworks:
		return kind.MeshNetworks
	case MutatingWebhookConfiguration:
		return kind.MutatingWebhookConfiguration
	case Namespace:
		return kind.Namespace
	case Node:
		return kind.Node
	case PeerAuthentication:
		return kind.PeerAuthentication
	case Pod:
		return kind.Pod
	case PodDisruptionBudget:
		return kind.PodDisruptionBudget
	case ProxyConfig:
		return kind.ProxyConfig
	case ReferenceGrant:
		return kind.ReferenceGrant
	case RequestAuthentication:
		return kind.RequestAuthentication
	case Secret:
		return kind.Secret
	case Service:
		return kind.Service
	case ServiceAccount:
		return kind.ServiceAccount
	case ServiceEntry:
		return kind.ServiceEntry
	case Sidecar:
		return kind.Sidecar
	case StatefulSet:
		return kind.StatefulSet
	case TCPRoute:
		return kind.TCPRoute
	case TLSRoute:
		return kind.TLSRoute
	case Telemetry:
		return kind.Telemetry
	case UDPRoute:
		return kind.UDPRoute
	case ValidatingWebhookConfiguration:
		return kind.ValidatingWebhookConfiguration
	case VirtualService:
		return kind.VirtualService
	case WasmPlugin:
		return kind.WasmPlugin
	case WorkloadEntry:
		return kind.WorkloadEntry
	case WorkloadGroup:
		return kind.WorkloadGroup
	case XBackendTrafficPolicy:
		return kind.XBackendTrafficPolicy
	case XListenerSet:
		return kind.XListenerSet
	}

	panic("unknown kind: " + g.String())
}

// MustToGVR converts a GVK to a GVR, and panics if it cannot be converted
// Warning: this is only safe for known types; do not call on arbitrary GVKs
func MustToGVR(g config.GroupVersionKind) schema.GroupVersionResource {
	r, ok := ToGVR(g)
	if !ok {
		panic("unknown kind: " + g.String())
	}
	return r
}

// FromGVR converts a GVR to a GVK.
func FromGVR(g schema.GroupVersionResource) (config.GroupVersionKind, bool) {
	switch g {
	case gvr.AuthorizationPolicy:
		return AuthorizationPolicy, true
	case gvr.BackendTLSPolicy:
		return BackendTLSPolicy, true
	case gvr.CertificateSigningRequest:
		return CertificateSigningRequest, true
	case gvr.ClusterTrustBundle:
		return ClusterTrustBundle, true
	case gvr.ConfigMap:
		return ConfigMap, true
	case gvr.CustomResourceDefinition:
		return CustomResourceDefinition, true
	case gvr.DaemonSet:
		return DaemonSet, true
	case gvr.Deployment:
		return Deployment, true
	case gvr.DestinationRule:
		return DestinationRule, true
	case gvr.EndpointSlice:
		return EndpointSlice, true
	case gvr.Endpoints:
		return Endpoints, true
	case gvr.EnvoyFilter:
		return EnvoyFilter, true
	case gvr.GRPCRoute:
		return GRPCRoute, true
	case gvr.Gateway:
		return Gateway, true
	case gvr.GatewayClass:
		return GatewayClass, true
	case gvr.HTTPRoute:
		return HTTPRoute, true
	case gvr.HorizontalPodAutoscaler:
		return HorizontalPodAutoscaler, true
	case gvr.InferencePool:
		return InferencePool, true
	case gvr.Ingress:
		return Ingress, true
	case gvr.IngressClass:
		return IngressClass, true
	case gvr.KubernetesGateway:
		return KubernetesGateway, true
	case gvr.Lease:
		return Lease, true
	case gvr.MeshConfig:
		return MeshConfig, true
	case gvr.MeshNetworks:
		return MeshNetworks, true
	case gvr.MutatingWebhookConfiguration:
		return MutatingWebhookConfiguration, true
	case gvr.Namespace:
		return Namespace, true
	case gvr.Node:
		return Node, true
	case gvr.PeerAuthentication:
		return PeerAuthentication, true
	case gvr.Pod:
		return Pod, true
	case gvr.PodDisruptionBudget:
		return PodDisruptionBudget, true
	case gvr.ProxyConfig:
		return ProxyConfig, true
	case gvr.ReferenceGrant:
		return ReferenceGrant, true
	case gvr.RequestAuthentication:
		return RequestAuthentication, true
	case gvr.Secret:
		return Secret, true
	case gvr.Service:
		return Service, true
	case gvr.ServiceAccount:
		return ServiceAccount, true
	case gvr.ServiceEntry:
		return ServiceEntry, true
	case gvr.Sidecar:
		return Sidecar, true
	case gvr.StatefulSet:
		return StatefulSet, true
	case gvr.TCPRoute:
		return TCPRoute, true
	case gvr.TLSRoute:
		return TLSRoute, true
	case gvr.Telemetry:
		return Telemetry, true
	case gvr.UDPRoute:
		return UDPRoute, true
	case gvr.ValidatingWebhookConfiguration:
		return ValidatingWebhookConfiguration, true
	case gvr.VirtualService:
		return VirtualService, true
	case gvr.WasmPlugin:
		return WasmPlugin, true
	case gvr.WorkloadEntry:
		return WorkloadEntry, true
	case gvr.WorkloadGroup:
		return WorkloadGroup, true
	case gvr.XBackendTrafficPolicy:
		return XBackendTrafficPolicy, true
	case gvr.XListenerSet:
		return XListenerSet, true
	}

	return config.GroupVersionKind{}, false
}

// FromGVR converts a GVR to a GVK, and panics if it cannot be converted
// Warning: this is only safe for known types; do not call on arbitrary GVRs
func MustFromGVR(g schema.GroupVersionResource) config.GroupVersionKind {
	r, ok := FromGVR(g)
	if !ok {
		panic("unknown kind: " + g.String())
	}
	return r
}
