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

// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

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

package types

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *Family) DeepEqual(other *Family) bool {
	if other == nil {
		return false
	}

	if in.Afi != other.Afi {
		return false
	}
	if in.Safi != other.Safi {
		return false
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicy) DeepEqual(other *RoutePolicy) bool {
	if other == nil {
		return false
	}

	if in.Name != other.Name {
		return false
	}
	if in.Type != other.Type {
		return false
	}
	if ((in.Statements != nil) && (other.Statements != nil)) || ((in.Statements == nil) != (other.Statements == nil)) {
		in, other := &in.Statements, &other.Statements
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if !inElement.DeepEqual((*other)[i]) {
					return false
				}
			}
		}
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyActionNextHop) DeepEqual(other *RoutePolicyActionNextHop) bool {
	if other == nil {
		return false
	}

	if in.Self != other.Self {
		return false
	}
	if in.Unchanged != other.Unchanged {
		return false
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyActions) DeepEqual(other *RoutePolicyActions) bool {
	if other == nil {
		return false
	}

	if in.RouteAction != other.RouteAction {
		return false
	}
	if ((in.AddCommunities != nil) && (other.AddCommunities != nil)) || ((in.AddCommunities == nil) != (other.AddCommunities == nil)) {
		in, other := &in.AddCommunities, &other.AddCommunities
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if inElement != (*other)[i] {
					return false
				}
			}
		}
	}

	if ((in.AddLargeCommunities != nil) && (other.AddLargeCommunities != nil)) || ((in.AddLargeCommunities == nil) != (other.AddLargeCommunities == nil)) {
		in, other := &in.AddLargeCommunities, &other.AddLargeCommunities
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if inElement != (*other)[i] {
					return false
				}
			}
		}
	}

	if (in.SetLocalPreference == nil) != (other.SetLocalPreference == nil) {
		return false
	} else if in.SetLocalPreference != nil {
		if *in.SetLocalPreference != *other.SetLocalPreference {
			return false
		}
	}

	if (in.NextHop == nil) != (other.NextHop == nil) {
		return false
	} else if in.NextHop != nil {
		if !in.NextHop.DeepEqual(other.NextHop) {
			return false
		}
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyConditions) DeepEqual(other *RoutePolicyConditions) bool {
	if other == nil {
		return false
	}

	if (in.MatchNeighbors == nil) != (other.MatchNeighbors == nil) {
		return false
	} else if in.MatchNeighbors != nil {
		if !in.MatchNeighbors.DeepEqual(other.MatchNeighbors) {
			return false
		}
	}

	if (in.MatchPrefixes == nil) != (other.MatchPrefixes == nil) {
		return false
	} else if in.MatchPrefixes != nil {
		if !in.MatchPrefixes.DeepEqual(other.MatchPrefixes) {
			return false
		}
	}

	if ((in.MatchFamilies != nil) && (other.MatchFamilies != nil)) || ((in.MatchFamilies == nil) != (other.MatchFamilies == nil)) {
		in, other := &in.MatchFamilies, &other.MatchFamilies
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if !inElement.DeepEqual(&(*other)[i]) {
					return false
				}
			}
		}
	}

	return true
}

// deepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyNeighborMatch) deepEqual(other *RoutePolicyNeighborMatch) bool {
	if other == nil {
		return false
	}

	if in.Type != other.Type {
		return false
	}

	return true
}

// deepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyPrefix) deepEqual(other *RoutePolicyPrefix) bool {
	if other == nil {
		return false
	}

	if in.PrefixLenMin != other.PrefixLenMin {
		return false
	}
	if in.PrefixLenMax != other.PrefixLenMax {
		return false
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyPrefixMatch) DeepEqual(other *RoutePolicyPrefixMatch) bool {
	if other == nil {
		return false
	}

	if in.Type != other.Type {
		return false
	}
	if ((in.Prefixes != nil) && (other.Prefixes != nil)) || ((in.Prefixes == nil) != (other.Prefixes == nil)) {
		in, other := &in.Prefixes, &other.Prefixes
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if !inElement.DeepEqual(&(*other)[i]) {
					return false
				}
			}
		}
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyStatement) DeepEqual(other *RoutePolicyStatement) bool {
	if other == nil {
		return false
	}

	if !in.Conditions.DeepEqual(&other.Conditions) {
		return false
	}

	if !in.Actions.DeepEqual(&other.Actions) {
		return false
	}

	return true
}
