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

/*
Copyright The cert-manager 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 v1alpha1

import (
	unsafe "unsafe"

	v1alpha2 "github.com/cert-manager/trust-manager/pkg/apis/trustmanager/v1alpha2"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	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((*BundleSpec)(nil), (*v1alpha2.BundleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(a.(*BundleSpec), b.(*v1alpha2.BundleSpec), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*BundleStatus)(nil), (*v1alpha2.BundleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(a.(*BundleStatus), b.(*v1alpha2.BundleStatus), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*v1alpha2.BundleStatus)(nil), (*BundleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(a.(*v1alpha2.BundleStatus), b.(*BundleStatus), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*v1alpha2.PKCS12)(nil), (*PKCS12)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(a.(*v1alpha2.PKCS12), b.(*PKCS12), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*TargetMetadata)(nil), (*v1alpha2.TargetMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_TargetMetadata_To_v1alpha2_TargetMetadata(a.(*TargetMetadata), b.(*v1alpha2.TargetMetadata), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*v1alpha2.TargetMetadata)(nil), (*TargetMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha2_TargetMetadata_To_v1alpha1_TargetMetadata(a.(*v1alpha2.TargetMetadata), b.(*TargetMetadata), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*BundleSource)(nil), (*v1alpha2.BundleSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_BundleSource_To_v1alpha2_BundleSource(a.(*BundleSource), b.(*v1alpha2.BundleSource), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*BundleTarget)(nil), (*v1alpha2.BundleTarget)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(a.(*BundleTarget), b.(*v1alpha2.BundleTarget), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*PKCS12)(nil), (*v1alpha2.PKCS12)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_PKCS12_To_v1alpha2_PKCS12(a.(*PKCS12), b.(*v1alpha2.PKCS12), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*TargetTemplate)(nil), (*v1alpha2.KeyValueTarget)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_TargetTemplate_To_v1alpha2_KeyValueTarget(a.(*TargetTemplate), b.(*v1alpha2.KeyValueTarget), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*v1alpha2.BundleSource)(nil), (*BundleSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha2_BundleSource_To_v1alpha1_BundleSource(a.(*v1alpha2.BundleSource), b.(*BundleSource), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*v1alpha2.BundleSpec)(nil), (*BundleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha2_BundleSpec_To_v1alpha1_BundleSpec(a.(*v1alpha2.BundleSpec), b.(*BundleSpec), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*v1alpha2.BundleTarget)(nil), (*BundleTarget)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(a.(*v1alpha2.BundleTarget), b.(*BundleTarget), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*v1alpha2.KeyValueTarget)(nil), (*TargetTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha2_KeyValueTarget_To_v1alpha1_TargetTemplate(a.(*v1alpha2.KeyValueTarget), b.(*TargetTemplate), scope)
	}); err != nil {
		return err
	}
	return nil
}

func autoConvert_v1alpha1_BundleSource_To_v1alpha2_BundleSource(in *BundleSource, out *v1alpha2.BundleSource, s conversion.Scope) error {
	// WARNING: in.ConfigMap requires manual conversion: does not exist in peer-type
	// WARNING: in.Secret requires manual conversion: does not exist in peer-type
	// WARNING: in.InLine requires manual conversion: does not exist in peer-type
	// WARNING: in.UseDefaultCAs requires manual conversion: does not exist in peer-type
	return nil
}

func autoConvert_v1alpha2_BundleSource_To_v1alpha1_BundleSource(in *v1alpha2.BundleSource, out *BundleSource, s conversion.Scope) error {
	// WARNING: in.SourceReference requires manual conversion: does not exist in peer-type
	// WARNING: in.Key requires manual conversion: does not exist in peer-type
	return nil
}

func autoConvert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(in *BundleSpec, out *v1alpha2.BundleSpec, s conversion.Scope) error {
	if in.Sources != nil {
		in, out := &in.Sources, &out.Sources
		*out = make([]v1alpha2.BundleSource, len(*in))
		for i := range *in {
			if err := Convert_v1alpha1_BundleSource_To_v1alpha2_BundleSource(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Sources = nil
	}
	if err := Convert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(&in.Target, &out.Target, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec is an autogenerated conversion function.
func Convert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(in *BundleSpec, out *v1alpha2.BundleSpec, s conversion.Scope) error {
	return autoConvert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(in, out, s)
}

func autoConvert_v1alpha2_BundleSpec_To_v1alpha1_BundleSpec(in *v1alpha2.BundleSpec, out *BundleSpec, s conversion.Scope) error {
	if in.Sources != nil {
		in, out := &in.Sources, &out.Sources
		*out = make([]BundleSource, len(*in))
		for i := range *in {
			if err := Convert_v1alpha2_BundleSource_To_v1alpha1_BundleSource(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Sources = nil
	}
	// WARNING: in.IncludeDefaultCAs requires manual conversion: does not exist in peer-type
	// WARNING: in.InLineCAs requires manual conversion: does not exist in peer-type
	if err := Convert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(&in.Target, &out.Target, s); err != nil {
		return err
	}
	return nil
}

func autoConvert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(in *BundleStatus, out *v1alpha2.BundleStatus, s conversion.Scope) error {
	out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions))
	out.DefaultCAPackageVersion = (*string)(unsafe.Pointer(in.DefaultCAPackageVersion))
	return nil
}

// Convert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus is an autogenerated conversion function.
func Convert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(in *BundleStatus, out *v1alpha2.BundleStatus, s conversion.Scope) error {
	return autoConvert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(in, out, s)
}

func autoConvert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(in *v1alpha2.BundleStatus, out *BundleStatus, s conversion.Scope) error {
	out.Conditions = *(*[]v1.Condition)(unsafe.Pointer(&in.Conditions))
	out.DefaultCAPackageVersion = (*string)(unsafe.Pointer(in.DefaultCAPackageVersion))
	return nil
}

// Convert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus is an autogenerated conversion function.
func Convert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(in *v1alpha2.BundleStatus, out *BundleStatus, s conversion.Scope) error {
	return autoConvert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(in, out, s)
}

func autoConvert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(in *BundleTarget, out *v1alpha2.BundleTarget, s conversion.Scope) error {
	if in.ConfigMap != nil {
		in, out := &in.ConfigMap, &out.ConfigMap
		*out = new(v1alpha2.KeyValueTarget)
		if err := Convert_v1alpha1_TargetTemplate_To_v1alpha2_KeyValueTarget(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.ConfigMap = nil
	}
	if in.Secret != nil {
		in, out := &in.Secret, &out.Secret
		*out = new(v1alpha2.KeyValueTarget)
		if err := Convert_v1alpha1_TargetTemplate_To_v1alpha2_KeyValueTarget(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.Secret = nil
	}
	// WARNING: in.AdditionalFormats requires manual conversion: does not exist in peer-type
	out.NamespaceSelector = (*v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
	return nil
}

func autoConvert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(in *v1alpha2.BundleTarget, out *BundleTarget, s conversion.Scope) error {
	if in.ConfigMap != nil {
		in, out := &in.ConfigMap, &out.ConfigMap
		*out = new(TargetTemplate)
		if err := Convert_v1alpha2_KeyValueTarget_To_v1alpha1_TargetTemplate(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.ConfigMap = nil
	}
	if in.Secret != nil {
		in, out := &in.Secret, &out.Secret
		*out = new(TargetTemplate)
		if err := Convert_v1alpha2_KeyValueTarget_To_v1alpha1_TargetTemplate(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.Secret = nil
	}
	out.NamespaceSelector = (*v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
	return nil
}

func autoConvert_v1alpha1_PKCS12_To_v1alpha2_PKCS12(in *PKCS12, out *v1alpha2.PKCS12, s conversion.Scope) error {
	// WARNING: in.KeySelector requires manual conversion: does not exist in peer-type
	out.Password = (*string)(unsafe.Pointer(in.Password))
	out.Profile = v1alpha2.PKCS12Profile(in.Profile)
	return nil
}

func autoConvert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(in *v1alpha2.PKCS12, out *PKCS12, s conversion.Scope) error {
	out.Password = (*string)(unsafe.Pointer(in.Password))
	out.Profile = PKCS12Profile(in.Profile)
	return nil
}

// Convert_v1alpha2_PKCS12_To_v1alpha1_PKCS12 is an autogenerated conversion function.
func Convert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(in *v1alpha2.PKCS12, out *PKCS12, s conversion.Scope) error {
	return autoConvert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(in, out, s)
}

func autoConvert_v1alpha1_TargetMetadata_To_v1alpha2_TargetMetadata(in *TargetMetadata, out *v1alpha2.TargetMetadata, s conversion.Scope) error {
	out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations))
	out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels))
	return nil
}

// Convert_v1alpha1_TargetMetadata_To_v1alpha2_TargetMetadata is an autogenerated conversion function.
func Convert_v1alpha1_TargetMetadata_To_v1alpha2_TargetMetadata(in *TargetMetadata, out *v1alpha2.TargetMetadata, s conversion.Scope) error {
	return autoConvert_v1alpha1_TargetMetadata_To_v1alpha2_TargetMetadata(in, out, s)
}

func autoConvert_v1alpha2_TargetMetadata_To_v1alpha1_TargetMetadata(in *v1alpha2.TargetMetadata, out *TargetMetadata, s conversion.Scope) error {
	out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations))
	out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels))
	return nil
}

// Convert_v1alpha2_TargetMetadata_To_v1alpha1_TargetMetadata is an autogenerated conversion function.
func Convert_v1alpha2_TargetMetadata_To_v1alpha1_TargetMetadata(in *v1alpha2.TargetMetadata, out *TargetMetadata, s conversion.Scope) error {
	return autoConvert_v1alpha2_TargetMetadata_To_v1alpha1_TargetMetadata(in, out, s)
}
