//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 v1alpha1

import (
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
	v1beta1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1"
	v1beta2 "sigs.k8s.io/cluster-api/api/ipam/v1beta2"
)

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((*IPAddress)(nil), (*v1beta2.IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_IPAddress_To_v1beta2_IPAddress(a.(*IPAddress), b.(*v1beta2.IPAddress), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddress)(nil), (*IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta2_IPAddress_To_v1alpha1_IPAddress(a.(*v1beta2.IPAddress), b.(*IPAddress), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*IPAddressClaim)(nil), (*v1beta2.IPAddressClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_IPAddressClaim_To_v1beta2_IPAddressClaim(a.(*IPAddressClaim), b.(*v1beta2.IPAddressClaim), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddressClaim)(nil), (*IPAddressClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta2_IPAddressClaim_To_v1alpha1_IPAddressClaim(a.(*v1beta2.IPAddressClaim), b.(*IPAddressClaim), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*IPAddressClaimList)(nil), (*v1beta2.IPAddressClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(a.(*IPAddressClaimList), b.(*v1beta2.IPAddressClaimList), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddressClaimList)(nil), (*IPAddressClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta2_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(a.(*v1beta2.IPAddressClaimList), b.(*IPAddressClaimList), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*IPAddressClaimSpec)(nil), (*v1beta2.IPAddressClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(a.(*IPAddressClaimSpec), b.(*v1beta2.IPAddressClaimSpec), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*IPAddressClaimStatus)(nil), (*v1beta2.IPAddressClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(a.(*IPAddressClaimStatus), b.(*v1beta2.IPAddressClaimStatus), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*IPAddressList)(nil), (*v1beta2.IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_IPAddressList_To_v1beta2_IPAddressList(a.(*IPAddressList), b.(*v1beta2.IPAddressList), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddressList)(nil), (*IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta2_IPAddressList_To_v1alpha1_IPAddressList(a.(*v1beta2.IPAddressList), b.(*IPAddressList), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*IPAddressSpec)(nil), (*v1beta2.IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_IPAddressSpec_To_v1beta2_IPAddressSpec(a.(*IPAddressSpec), b.(*v1beta2.IPAddressSpec), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*v1beta2.IPAddressClaimSpec)(nil), (*IPAddressClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta2_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(a.(*v1beta2.IPAddressClaimSpec), b.(*IPAddressClaimSpec), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*v1beta2.IPAddressClaimStatus)(nil), (*IPAddressClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta2_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(a.(*v1beta2.IPAddressClaimStatus), b.(*IPAddressClaimStatus), scope)
	}); err != nil {
		return err
	}
	if err := s.AddConversionFunc((*v1beta2.IPAddressSpec)(nil), (*IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1beta2_IPAddressSpec_To_v1alpha1_IPAddressSpec(a.(*v1beta2.IPAddressSpec), b.(*IPAddressSpec), scope)
	}); err != nil {
		return err
	}
	return nil
}

func autoConvert_v1alpha1_IPAddress_To_v1beta2_IPAddress(in *IPAddress, out *v1beta2.IPAddress, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_v1alpha1_IPAddressSpec_To_v1beta2_IPAddressSpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1alpha1_IPAddress_To_v1beta2_IPAddress is an autogenerated conversion function.
func Convert_v1alpha1_IPAddress_To_v1beta2_IPAddress(in *IPAddress, out *v1beta2.IPAddress, s conversion.Scope) error {
	return autoConvert_v1alpha1_IPAddress_To_v1beta2_IPAddress(in, out, s)
}

func autoConvert_v1beta2_IPAddress_To_v1alpha1_IPAddress(in *v1beta2.IPAddress, out *IPAddress, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_v1beta2_IPAddressSpec_To_v1alpha1_IPAddressSpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1beta2_IPAddress_To_v1alpha1_IPAddress is an autogenerated conversion function.
func Convert_v1beta2_IPAddress_To_v1alpha1_IPAddress(in *v1beta2.IPAddress, out *IPAddress, s conversion.Scope) error {
	return autoConvert_v1beta2_IPAddress_To_v1alpha1_IPAddress(in, out, s)
}

func autoConvert_v1alpha1_IPAddressClaim_To_v1beta2_IPAddressClaim(in *IPAddressClaim, out *v1beta2.IPAddressClaim, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_v1alpha1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	if err := Convert_v1alpha1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(&in.Status, &out.Status, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1alpha1_IPAddressClaim_To_v1beta2_IPAddressClaim is an autogenerated conversion function.
func Convert_v1alpha1_IPAddressClaim_To_v1beta2_IPAddressClaim(in *IPAddressClaim, out *v1beta2.IPAddressClaim, s conversion.Scope) error {
	return autoConvert_v1alpha1_IPAddressClaim_To_v1beta2_IPAddressClaim(in, out, s)
}

func autoConvert_v1beta2_IPAddressClaim_To_v1alpha1_IPAddressClaim(in *v1beta2.IPAddressClaim, out *IPAddressClaim, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_v1beta2_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	if err := Convert_v1beta2_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(&in.Status, &out.Status, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1beta2_IPAddressClaim_To_v1alpha1_IPAddressClaim is an autogenerated conversion function.
func Convert_v1beta2_IPAddressClaim_To_v1alpha1_IPAddressClaim(in *v1beta2.IPAddressClaim, out *IPAddressClaim, s conversion.Scope) error {
	return autoConvert_v1beta2_IPAddressClaim_To_v1alpha1_IPAddressClaim(in, out, s)
}

func autoConvert_v1alpha1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(in *IPAddressClaimList, out *v1beta2.IPAddressClaimList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]v1beta2.IPAddressClaim, len(*in))
		for i := range *in {
			if err := Convert_v1alpha1_IPAddressClaim_To_v1beta2_IPAddressClaim(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_v1alpha1_IPAddressClaimList_To_v1beta2_IPAddressClaimList is an autogenerated conversion function.
func Convert_v1alpha1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(in *IPAddressClaimList, out *v1beta2.IPAddressClaimList, s conversion.Scope) error {
	return autoConvert_v1alpha1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(in, out, s)
}

func autoConvert_v1beta2_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(in *v1beta2.IPAddressClaimList, out *IPAddressClaimList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]IPAddressClaim, len(*in))
		for i := range *in {
			if err := Convert_v1beta2_IPAddressClaim_To_v1alpha1_IPAddressClaim(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_v1beta2_IPAddressClaimList_To_v1alpha1_IPAddressClaimList is an autogenerated conversion function.
func Convert_v1beta2_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(in *v1beta2.IPAddressClaimList, out *IPAddressClaimList, s conversion.Scope) error {
	return autoConvert_v1beta2_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(in, out, s)
}

func autoConvert_v1alpha1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(in *IPAddressClaimSpec, out *v1beta2.IPAddressClaimSpec, s conversion.Scope) error {
	if err := v1beta1.Convert_v1_TypedLocalObjectReference_To_v1beta2_IPPoolReference(&in.PoolRef, &out.PoolRef, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1alpha1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec is an autogenerated conversion function.
func Convert_v1alpha1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(in *IPAddressClaimSpec, out *v1beta2.IPAddressClaimSpec, s conversion.Scope) error {
	return autoConvert_v1alpha1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(in, out, s)
}

func autoConvert_v1beta2_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(in *v1beta2.IPAddressClaimSpec, out *IPAddressClaimSpec, s conversion.Scope) error {
	// WARNING: in.ClusterName requires manual conversion: does not exist in peer-type
	if err := v1beta1.Convert_v1beta2_IPPoolReference_To_v1_TypedLocalObjectReference(&in.PoolRef, &out.PoolRef, s); err != nil {
		return err
	}
	return nil
}

func autoConvert_v1alpha1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(in *IPAddressClaimStatus, out *v1beta2.IPAddressClaimStatus, s conversion.Scope) error {
	if err := v1beta1.Convert_v1_LocalObjectReference_To_v1beta2_IPAddressReference(&in.AddressRef, &out.AddressRef, s); err != nil {
		return err
	}
	if in.Conditions != nil {
		in, out := &in.Conditions, &out.Conditions
		*out = make([]v1.Condition, len(*in))
		for i := range *in {
			if err := v1beta1.Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Conditions = nil
	}
	return nil
}

// Convert_v1alpha1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus is an autogenerated conversion function.
func Convert_v1alpha1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(in *IPAddressClaimStatus, out *v1beta2.IPAddressClaimStatus, s conversion.Scope) error {
	return autoConvert_v1alpha1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(in, out, s)
}

func autoConvert_v1beta2_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(in *v1beta2.IPAddressClaimStatus, out *IPAddressClaimStatus, s conversion.Scope) error {
	if in.Conditions != nil {
		in, out := &in.Conditions, &out.Conditions
		*out = make(corev1beta1.Conditions, len(*in))
		for i := range *in {
			if err := v1beta1.Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Conditions = nil
	}
	if err := v1beta1.Convert_v1beta2_IPAddressReference_To_v1_LocalObjectReference(&in.AddressRef, &out.AddressRef, s); err != nil {
		return err
	}
	// WARNING: in.Deprecated requires manual conversion: does not exist in peer-type
	return nil
}

func autoConvert_v1alpha1_IPAddressList_To_v1beta2_IPAddressList(in *IPAddressList, out *v1beta2.IPAddressList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]v1beta2.IPAddress, len(*in))
		for i := range *in {
			if err := Convert_v1alpha1_IPAddress_To_v1beta2_IPAddress(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_v1alpha1_IPAddressList_To_v1beta2_IPAddressList is an autogenerated conversion function.
func Convert_v1alpha1_IPAddressList_To_v1beta2_IPAddressList(in *IPAddressList, out *v1beta2.IPAddressList, s conversion.Scope) error {
	return autoConvert_v1alpha1_IPAddressList_To_v1beta2_IPAddressList(in, out, s)
}

func autoConvert_v1beta2_IPAddressList_To_v1alpha1_IPAddressList(in *v1beta2.IPAddressList, out *IPAddressList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]IPAddress, len(*in))
		for i := range *in {
			if err := Convert_v1beta2_IPAddress_To_v1alpha1_IPAddress(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_v1beta2_IPAddressList_To_v1alpha1_IPAddressList is an autogenerated conversion function.
func Convert_v1beta2_IPAddressList_To_v1alpha1_IPAddressList(in *v1beta2.IPAddressList, out *IPAddressList, s conversion.Scope) error {
	return autoConvert_v1beta2_IPAddressList_To_v1alpha1_IPAddressList(in, out, s)
}

func autoConvert_v1alpha1_IPAddressSpec_To_v1beta2_IPAddressSpec(in *IPAddressSpec, out *v1beta2.IPAddressSpec, s conversion.Scope) error {
	if err := v1beta1.Convert_v1_LocalObjectReference_To_v1beta2_IPAddressClaimReference(&in.ClaimRef, &out.ClaimRef, s); err != nil {
		return err
	}
	if err := v1beta1.Convert_v1_TypedLocalObjectReference_To_v1beta2_IPPoolReference(&in.PoolRef, &out.PoolRef, s); err != nil {
		return err
	}
	out.Address = in.Address
	// WARNING: in.Prefix requires manual conversion: inconvertible types (int vs *int32)
	out.Gateway = in.Gateway
	return nil
}

func autoConvert_v1beta2_IPAddressSpec_To_v1alpha1_IPAddressSpec(in *v1beta2.IPAddressSpec, out *IPAddressSpec, s conversion.Scope) error {
	if err := v1beta1.Convert_v1beta2_IPAddressClaimReference_To_v1_LocalObjectReference(&in.ClaimRef, &out.ClaimRef, s); err != nil {
		return err
	}
	if err := v1beta1.Convert_v1beta2_IPPoolReference_To_v1_TypedLocalObjectReference(&in.PoolRef, &out.PoolRef, s); err != nil {
		return err
	}
	out.Address = in.Address
	// WARNING: in.Prefix requires manual conversion: inconvertible types (*int32 vs int)
	out.Gateway = in.Gateway
	return nil
}
