//go:build !ignore_autogenerated
// +build !ignore_autogenerated

// SPDX-License-Identifier: AGPL-3.0-only

// Code generated by conversion-gen. DO NOT EDIT.

package v2alpha1

import (
	url "net/url"
	unsafe "unsafe"

	dashboard "github.com/grafana/grafana/pkg/apis/dashboard"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
)

func init() {
	localSchemeBuilder.Register(RegisterConversions)
}

// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
	if err := s.AddGeneratedConversionFunc((*AnnotationActions)(nil), (*dashboard.AnnotationActions)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v2alpha1_AnnotationActions_To_dashboard_AnnotationActions(a.(*AnnotationActions), b.(*dashboard.AnnotationActions), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*dashboard.AnnotationActions)(nil), (*AnnotationActions)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_dashboard_AnnotationActions_To_v2alpha1_AnnotationActions(a.(*dashboard.AnnotationActions), b.(*AnnotationActions), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*AnnotationPermission)(nil), (*dashboard.AnnotationPermission)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v2alpha1_AnnotationPermission_To_dashboard_AnnotationPermission(a.(*AnnotationPermission), b.(*dashboard.AnnotationPermission), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*dashboard.AnnotationPermission)(nil), (*AnnotationPermission)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_dashboard_AnnotationPermission_To_v2alpha1_AnnotationPermission(a.(*dashboard.AnnotationPermission), b.(*AnnotationPermission), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*DashboardAccess)(nil), (*dashboard.DashboardAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v2alpha1_DashboardAccess_To_dashboard_DashboardAccess(a.(*DashboardAccess), b.(*dashboard.DashboardAccess), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*dashboard.DashboardAccess)(nil), (*DashboardAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_dashboard_DashboardAccess_To_v2alpha1_DashboardAccess(a.(*dashboard.DashboardAccess), b.(*DashboardAccess), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*VersionsQueryOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_url_Values_To_v2alpha1_VersionsQueryOptions(a.(*url.Values), b.(*VersionsQueryOptions), scope)
	}); err != nil {
		return err
	}
	return nil
}

func autoConvert_v2alpha1_AnnotationActions_To_dashboard_AnnotationActions(in *AnnotationActions, out *dashboard.AnnotationActions, s conversion.Scope) error {
	out.CanAdd = in.CanAdd
	out.CanEdit = in.CanEdit
	out.CanDelete = in.CanDelete
	return nil
}

// Convert_v2alpha1_AnnotationActions_To_dashboard_AnnotationActions is an autogenerated conversion function.
func Convert_v2alpha1_AnnotationActions_To_dashboard_AnnotationActions(in *AnnotationActions, out *dashboard.AnnotationActions, s conversion.Scope) error {
	return autoConvert_v2alpha1_AnnotationActions_To_dashboard_AnnotationActions(in, out, s)
}

func autoConvert_dashboard_AnnotationActions_To_v2alpha1_AnnotationActions(in *dashboard.AnnotationActions, out *AnnotationActions, s conversion.Scope) error {
	out.CanAdd = in.CanAdd
	out.CanEdit = in.CanEdit
	out.CanDelete = in.CanDelete
	return nil
}

// Convert_dashboard_AnnotationActions_To_v2alpha1_AnnotationActions is an autogenerated conversion function.
func Convert_dashboard_AnnotationActions_To_v2alpha1_AnnotationActions(in *dashboard.AnnotationActions, out *AnnotationActions, s conversion.Scope) error {
	return autoConvert_dashboard_AnnotationActions_To_v2alpha1_AnnotationActions(in, out, s)
}

func autoConvert_v2alpha1_AnnotationPermission_To_dashboard_AnnotationPermission(in *AnnotationPermission, out *dashboard.AnnotationPermission, s conversion.Scope) error {
	if err := Convert_v2alpha1_AnnotationActions_To_dashboard_AnnotationActions(&in.Dashboard, &out.Dashboard, s); err != nil {
		return err
	}
	if err := Convert_v2alpha1_AnnotationActions_To_dashboard_AnnotationActions(&in.Organization, &out.Organization, s); err != nil {
		return err
	}
	return nil
}

// Convert_v2alpha1_AnnotationPermission_To_dashboard_AnnotationPermission is an autogenerated conversion function.
func Convert_v2alpha1_AnnotationPermission_To_dashboard_AnnotationPermission(in *AnnotationPermission, out *dashboard.AnnotationPermission, s conversion.Scope) error {
	return autoConvert_v2alpha1_AnnotationPermission_To_dashboard_AnnotationPermission(in, out, s)
}

func autoConvert_dashboard_AnnotationPermission_To_v2alpha1_AnnotationPermission(in *dashboard.AnnotationPermission, out *AnnotationPermission, s conversion.Scope) error {
	if err := Convert_dashboard_AnnotationActions_To_v2alpha1_AnnotationActions(&in.Dashboard, &out.Dashboard, s); err != nil {
		return err
	}
	if err := Convert_dashboard_AnnotationActions_To_v2alpha1_AnnotationActions(&in.Organization, &out.Organization, s); err != nil {
		return err
	}
	return nil
}

// Convert_dashboard_AnnotationPermission_To_v2alpha1_AnnotationPermission is an autogenerated conversion function.
func Convert_dashboard_AnnotationPermission_To_v2alpha1_AnnotationPermission(in *dashboard.AnnotationPermission, out *AnnotationPermission, s conversion.Scope) error {
	return autoConvert_dashboard_AnnotationPermission_To_v2alpha1_AnnotationPermission(in, out, s)
}

func autoConvert_v2alpha1_DashboardAccess_To_dashboard_DashboardAccess(in *DashboardAccess, out *dashboard.DashboardAccess, s conversion.Scope) error {
	out.Slug = in.Slug
	out.Url = in.Url
	out.CanSave = in.CanSave
	out.CanEdit = in.CanEdit
	out.CanAdmin = in.CanAdmin
	out.CanStar = in.CanStar
	out.CanDelete = in.CanDelete
	out.AnnotationsPermissions = (*dashboard.AnnotationPermission)(unsafe.Pointer(in.AnnotationsPermissions))
	return nil
}

// Convert_v2alpha1_DashboardAccess_To_dashboard_DashboardAccess is an autogenerated conversion function.
func Convert_v2alpha1_DashboardAccess_To_dashboard_DashboardAccess(in *DashboardAccess, out *dashboard.DashboardAccess, s conversion.Scope) error {
	return autoConvert_v2alpha1_DashboardAccess_To_dashboard_DashboardAccess(in, out, s)
}

func autoConvert_dashboard_DashboardAccess_To_v2alpha1_DashboardAccess(in *dashboard.DashboardAccess, out *DashboardAccess, s conversion.Scope) error {
	out.Slug = in.Slug
	out.Url = in.Url
	out.CanSave = in.CanSave
	out.CanEdit = in.CanEdit
	out.CanAdmin = in.CanAdmin
	out.CanStar = in.CanStar
	out.CanDelete = in.CanDelete
	out.AnnotationsPermissions = (*AnnotationPermission)(unsafe.Pointer(in.AnnotationsPermissions))
	return nil
}

// Convert_dashboard_DashboardAccess_To_v2alpha1_DashboardAccess is an autogenerated conversion function.
func Convert_dashboard_DashboardAccess_To_v2alpha1_DashboardAccess(in *dashboard.DashboardAccess, out *DashboardAccess, s conversion.Scope) error {
	return autoConvert_dashboard_DashboardAccess_To_v2alpha1_DashboardAccess(in, out, s)
}

func autoConvert_url_Values_To_v2alpha1_VersionsQueryOptions(in *url.Values, out *VersionsQueryOptions, s conversion.Scope) error {
	// WARNING: Field TypeMeta does not have json tag, skipping.

	if values, ok := map[string][]string(*in)["path"]; ok && len(values) > 0 {
		if err := runtime.Convert_Slice_string_To_string(&values, &out.Path, s); err != nil {
			return err
		}
	} else {
		out.Path = ""
	}
	if values, ok := map[string][]string(*in)["version"]; ok && len(values) > 0 {
		if err := runtime.Convert_Slice_string_To_int64(&values, &out.Version, s); err != nil {
			return err
		}
	} else {
		out.Version = 0
	}
	return nil
}

// Convert_url_Values_To_v2alpha1_VersionsQueryOptions is an autogenerated conversion function.
func Convert_url_Values_To_v2alpha1_VersionsQueryOptions(in *url.Values, out *VersionsQueryOptions, s conversion.Scope) error {
	return autoConvert_url_Values_To_v2alpha1_VersionsQueryOptions(in, out, s)
}
