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

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

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

package v2

import (
	unsafe "unsafe"

	dashboard "github.com/grafana/grafana/apps/dashboard/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_v2_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_v2_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_v2_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_v2_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_v2_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_v2_DashboardAccess(a.(*dashboard.DashboardAccess), b.(*DashboardAccess), scope)
	}); err != nil {
		return err
	}
	return nil
}

func autoConvert_v2_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_v2_AnnotationActions_To_dashboard_AnnotationActions is an autogenerated conversion function.
func Convert_v2_AnnotationActions_To_dashboard_AnnotationActions(in *AnnotationActions, out *dashboard.AnnotationActions, s conversion.Scope) error {
	return autoConvert_v2_AnnotationActions_To_dashboard_AnnotationActions(in, out, s)
}

func autoConvert_dashboard_AnnotationActions_To_v2_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_v2_AnnotationActions is an autogenerated conversion function.
func Convert_dashboard_AnnotationActions_To_v2_AnnotationActions(in *dashboard.AnnotationActions, out *AnnotationActions, s conversion.Scope) error {
	return autoConvert_dashboard_AnnotationActions_To_v2_AnnotationActions(in, out, s)
}

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

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

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

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

func autoConvert_v2_DashboardAccess_To_dashboard_DashboardAccess(in *DashboardAccess, out *dashboard.DashboardAccess, s conversion.Scope) error {
	out.Slug = in.Slug
	out.Url = in.Url
	out.IsPublic = in.IsPublic
	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_v2_DashboardAccess_To_dashboard_DashboardAccess is an autogenerated conversion function.
func Convert_v2_DashboardAccess_To_dashboard_DashboardAccess(in *DashboardAccess, out *dashboard.DashboardAccess, s conversion.Scope) error {
	return autoConvert_v2_DashboardAccess_To_dashboard_DashboardAccess(in, out, s)
}

func autoConvert_dashboard_DashboardAccess_To_v2_DashboardAccess(in *dashboard.DashboardAccess, out *DashboardAccess, s conversion.Scope) error {
	out.Slug = in.Slug
	out.Url = in.Url
	out.IsPublic = in.IsPublic
	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_v2_DashboardAccess is an autogenerated conversion function.
func Convert_dashboard_DashboardAccess_To_v2_DashboardAccess(in *dashboard.DashboardAccess, out *DashboardAccess, s conversion.Scope) error {
	return autoConvert_dashboard_DashboardAccess_To_v2_DashboardAccess(in, out, s)
}
