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

/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

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

package v1beta1

import (
	unsafe "unsafe"

	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	config "k8s.io/kubectl/pkg/config"
)

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((*AliasOverride)(nil), (*config.AliasOverride)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta1_AliasOverride_To_config_AliasOverride(a.(*AliasOverride), b.(*config.AliasOverride), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*config.AliasOverride)(nil), (*AliasOverride)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_config_AliasOverride_To_v1beta1_AliasOverride(a.(*config.AliasOverride), b.(*AliasOverride), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*CommandDefaults)(nil), (*config.CommandDefaults)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta1_CommandDefaults_To_config_CommandDefaults(a.(*CommandDefaults), b.(*config.CommandDefaults), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*config.CommandDefaults)(nil), (*CommandDefaults)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_config_CommandDefaults_To_v1beta1_CommandDefaults(a.(*config.CommandDefaults), b.(*CommandDefaults), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*CommandOptionDefault)(nil), (*config.CommandOptionDefault)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta1_CommandOptionDefault_To_config_CommandOptionDefault(a.(*CommandOptionDefault), b.(*config.CommandOptionDefault), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*config.CommandOptionDefault)(nil), (*CommandOptionDefault)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_config_CommandOptionDefault_To_v1beta1_CommandOptionDefault(a.(*config.CommandOptionDefault), b.(*CommandOptionDefault), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*Preference)(nil), (*config.Preference)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta1_Preference_To_config_Preference(a.(*Preference), b.(*config.Preference), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*config.Preference)(nil), (*Preference)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_config_Preference_To_v1beta1_Preference(a.(*config.Preference), b.(*Preference), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*config.AllowlistEntry)(nil), (*AllowlistEntry)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_config_AllowlistEntry_To_v1beta1_AllowlistEntry(a.(*config.AllowlistEntry), b.(*AllowlistEntry), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*AllowlistEntry)(nil), (*config.AllowlistEntry)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta1_AllowlistEntry_To_config_AllowlistEntry(a.(*AllowlistEntry), b.(*config.AllowlistEntry), scope)
	}); err != nil {
		return err
	}
	return nil
}

func autoConvert_v1beta1_AliasOverride_To_config_AliasOverride(in *AliasOverride, out *config.AliasOverride, s conversion.Scope) error {
	out.Name = in.Name
	out.Command = in.Command
	out.PrependArgs = *(*[]string)(unsafe.Pointer(&in.PrependArgs))
	out.AppendArgs = *(*[]string)(unsafe.Pointer(&in.AppendArgs))
	out.Options = *(*[]config.CommandOptionDefault)(unsafe.Pointer(&in.Options))
	return nil
}

// Convert_v1beta1_AliasOverride_To_config_AliasOverride is an autogenerated conversion function.
func Convert_v1beta1_AliasOverride_To_config_AliasOverride(in *AliasOverride, out *config.AliasOverride, s conversion.Scope) error {
	return autoConvert_v1beta1_AliasOverride_To_config_AliasOverride(in, out, s)
}

func autoConvert_config_AliasOverride_To_v1beta1_AliasOverride(in *config.AliasOverride, out *AliasOverride, s conversion.Scope) error {
	out.Name = in.Name
	out.Command = in.Command
	out.PrependArgs = *(*[]string)(unsafe.Pointer(&in.PrependArgs))
	out.AppendArgs = *(*[]string)(unsafe.Pointer(&in.AppendArgs))
	out.Options = *(*[]CommandOptionDefault)(unsafe.Pointer(&in.Options))
	return nil
}

// Convert_config_AliasOverride_To_v1beta1_AliasOverride is an autogenerated conversion function.
func Convert_config_AliasOverride_To_v1beta1_AliasOverride(in *config.AliasOverride, out *AliasOverride, s conversion.Scope) error {
	return autoConvert_config_AliasOverride_To_v1beta1_AliasOverride(in, out, s)
}

func autoConvert_v1beta1_AllowlistEntry_To_config_AllowlistEntry(in *AllowlistEntry, out *config.AllowlistEntry, s conversion.Scope) error {
	// WARNING: in.Name requires manual conversion: does not exist in peer-type
	out.Command = in.Command
	return nil
}

func autoConvert_config_AllowlistEntry_To_v1beta1_AllowlistEntry(in *config.AllowlistEntry, out *AllowlistEntry, s conversion.Scope) error {
	out.Command = in.Command
	return nil
}

func autoConvert_v1beta1_CommandDefaults_To_config_CommandDefaults(in *CommandDefaults, out *config.CommandDefaults, s conversion.Scope) error {
	out.Command = in.Command
	out.Options = *(*[]config.CommandOptionDefault)(unsafe.Pointer(&in.Options))
	return nil
}

// Convert_v1beta1_CommandDefaults_To_config_CommandDefaults is an autogenerated conversion function.
func Convert_v1beta1_CommandDefaults_To_config_CommandDefaults(in *CommandDefaults, out *config.CommandDefaults, s conversion.Scope) error {
	return autoConvert_v1beta1_CommandDefaults_To_config_CommandDefaults(in, out, s)
}

func autoConvert_config_CommandDefaults_To_v1beta1_CommandDefaults(in *config.CommandDefaults, out *CommandDefaults, s conversion.Scope) error {
	out.Command = in.Command
	out.Options = *(*[]CommandOptionDefault)(unsafe.Pointer(&in.Options))
	return nil
}

// Convert_config_CommandDefaults_To_v1beta1_CommandDefaults is an autogenerated conversion function.
func Convert_config_CommandDefaults_To_v1beta1_CommandDefaults(in *config.CommandDefaults, out *CommandDefaults, s conversion.Scope) error {
	return autoConvert_config_CommandDefaults_To_v1beta1_CommandDefaults(in, out, s)
}

func autoConvert_v1beta1_CommandOptionDefault_To_config_CommandOptionDefault(in *CommandOptionDefault, out *config.CommandOptionDefault, s conversion.Scope) error {
	out.Name = in.Name
	out.Default = in.Default
	return nil
}

// Convert_v1beta1_CommandOptionDefault_To_config_CommandOptionDefault is an autogenerated conversion function.
func Convert_v1beta1_CommandOptionDefault_To_config_CommandOptionDefault(in *CommandOptionDefault, out *config.CommandOptionDefault, s conversion.Scope) error {
	return autoConvert_v1beta1_CommandOptionDefault_To_config_CommandOptionDefault(in, out, s)
}

func autoConvert_config_CommandOptionDefault_To_v1beta1_CommandOptionDefault(in *config.CommandOptionDefault, out *CommandOptionDefault, s conversion.Scope) error {
	out.Name = in.Name
	out.Default = in.Default
	return nil
}

// Convert_config_CommandOptionDefault_To_v1beta1_CommandOptionDefault is an autogenerated conversion function.
func Convert_config_CommandOptionDefault_To_v1beta1_CommandOptionDefault(in *config.CommandOptionDefault, out *CommandOptionDefault, s conversion.Scope) error {
	return autoConvert_config_CommandOptionDefault_To_v1beta1_CommandOptionDefault(in, out, s)
}

func autoConvert_v1beta1_Preference_To_config_Preference(in *Preference, out *config.Preference, s conversion.Scope) error {
	out.Defaults = *(*[]config.CommandDefaults)(unsafe.Pointer(&in.Defaults))
	out.Aliases = *(*[]config.AliasOverride)(unsafe.Pointer(&in.Aliases))
	out.CredentialPluginPolicy = config.CredentialPluginPolicy(in.CredentialPluginPolicy)
	if in.CredentialPluginAllowlist != nil {
		in, out := &in.CredentialPluginAllowlist, &out.CredentialPluginAllowlist
		*out = make([]config.AllowlistEntry, len(*in))
		for i := range *in {
			if err := Convert_v1beta1_AllowlistEntry_To_config_AllowlistEntry(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.CredentialPluginAllowlist = nil
	}
	return nil
}

// Convert_v1beta1_Preference_To_config_Preference is an autogenerated conversion function.
func Convert_v1beta1_Preference_To_config_Preference(in *Preference, out *config.Preference, s conversion.Scope) error {
	return autoConvert_v1beta1_Preference_To_config_Preference(in, out, s)
}

func autoConvert_config_Preference_To_v1beta1_Preference(in *config.Preference, out *Preference, s conversion.Scope) error {
	out.Defaults = *(*[]CommandDefaults)(unsafe.Pointer(&in.Defaults))
	out.Aliases = *(*[]AliasOverride)(unsafe.Pointer(&in.Aliases))
	out.CredentialPluginPolicy = CredentialPluginPolicy(in.CredentialPluginPolicy)
	if in.CredentialPluginAllowlist != nil {
		in, out := &in.CredentialPluginAllowlist, &out.CredentialPluginAllowlist
		*out = make([]AllowlistEntry, len(*in))
		for i := range *in {
			if err := Convert_config_AllowlistEntry_To_v1beta1_AllowlistEntry(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.CredentialPluginAllowlist = nil
	}
	return nil
}

// Convert_config_Preference_To_v1beta1_Preference is an autogenerated conversion function.
func Convert_config_Preference_To_v1beta1_Preference(in *config.Preference, out *Preference, s conversion.Scope) error {
	return autoConvert_config_Preference_To_v1beta1_Preference(in, out, s)
}
