func newResourceDelta(
	a *resource,
	b *resource,
) *ackcompare.Delta {
	delta := ackcompare.NewDelta()
	if (a == nil && b != nil) ||
		(a != nil && b == nil) {
		delta.Add("", a, b)
		return delta
	}
	if ackcompare.HasNilDifference(a.ko.Spec.AtRestEncryptionEnabled, b.ko.Spec.AtRestEncryptionEnabled) {
		delta.Add("Spec.AtRestEncryptionEnabled", a.ko.Spec.AtRestEncryptionEnabled, b.ko.Spec.AtRestEncryptionEnabled)
	} else if a.ko.Spec.AtRestEncryptionEnabled != nil && b.ko.Spec.AtRestEncryptionEnabled != nil {
		if *a.ko.Spec.AtRestEncryptionEnabled != *b.ko.Spec.AtRestEncryptionEnabled {
			delta.Add("Spec.AtRestEncryptionEnabled", a.ko.Spec.AtRestEncryptionEnabled, b.ko.Spec.AtRestEncryptionEnabled)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.AuthToken, b.ko.Spec.AuthToken) {
		delta.Add("Spec.AuthToken", a.ko.Spec.AuthToken, b.ko.Spec.AuthToken)
	} else if a.ko.Spec.AuthToken != nil && b.ko.Spec.AuthToken != nil {
		if *a.ko.Spec.AuthToken != *b.ko.Spec.AuthToken {
			delta.Add("Spec.AuthToken", a.ko.Spec.AuthToken, b.ko.Spec.AuthToken)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.AutomaticFailoverEnabled, b.ko.Spec.AutomaticFailoverEnabled) {
		delta.Add("Spec.AutomaticFailoverEnabled", a.ko.Spec.AutomaticFailoverEnabled, b.ko.Spec.AutomaticFailoverEnabled)
	} else if a.ko.Spec.AutomaticFailoverEnabled != nil && b.ko.Spec.AutomaticFailoverEnabled != nil {
		if *a.ko.Spec.AutomaticFailoverEnabled != *b.ko.Spec.AutomaticFailoverEnabled {
			delta.Add("Spec.AutomaticFailoverEnabled", a.ko.Spec.AutomaticFailoverEnabled, b.ko.Spec.AutomaticFailoverEnabled)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.CacheNodeType, b.ko.Spec.CacheNodeType) {
		delta.Add("Spec.CacheNodeType", a.ko.Spec.CacheNodeType, b.ko.Spec.CacheNodeType)
	} else if a.ko.Spec.CacheNodeType != nil && b.ko.Spec.CacheNodeType != nil {
		if *a.ko.Spec.CacheNodeType != *b.ko.Spec.CacheNodeType {
			delta.Add("Spec.CacheNodeType", a.ko.Spec.CacheNodeType, b.ko.Spec.CacheNodeType)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.CacheParameterGroupName, b.ko.Spec.CacheParameterGroupName) {
		delta.Add("Spec.CacheParameterGroupName", a.ko.Spec.CacheParameterGroupName, b.ko.Spec.CacheParameterGroupName)
	} else if a.ko.Spec.CacheParameterGroupName != nil && b.ko.Spec.CacheParameterGroupName != nil {
		if *a.ko.Spec.CacheParameterGroupName != *b.ko.Spec.CacheParameterGroupName {
			delta.Add("Spec.CacheParameterGroupName", a.ko.Spec.CacheParameterGroupName, b.ko.Spec.CacheParameterGroupName)
		}
	}
	if !ackcompare.SliceStringPEqual(a.ko.Spec.CacheSecurityGroupNames, b.ko.Spec.CacheSecurityGroupNames) {
		delta.Add("Spec.CacheSecurityGroupNames", a.ko.Spec.CacheSecurityGroupNames, b.ko.Spec.CacheSecurityGroupNames)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.CacheSubnetGroupName, b.ko.Spec.CacheSubnetGroupName) {
		delta.Add("Spec.CacheSubnetGroupName", a.ko.Spec.CacheSubnetGroupName, b.ko.Spec.CacheSubnetGroupName)
	} else if a.ko.Spec.CacheSubnetGroupName != nil && b.ko.Spec.CacheSubnetGroupName != nil {
		if *a.ko.Spec.CacheSubnetGroupName != *b.ko.Spec.CacheSubnetGroupName {
			delta.Add("Spec.CacheSubnetGroupName", a.ko.Spec.CacheSubnetGroupName, b.ko.Spec.CacheSubnetGroupName)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.Engine, b.ko.Spec.Engine) {
		delta.Add("Spec.Engine", a.ko.Spec.Engine, b.ko.Spec.Engine)
	} else if a.ko.Spec.Engine != nil && b.ko.Spec.Engine != nil {
		if *a.ko.Spec.Engine != *b.ko.Spec.Engine {
			delta.Add("Spec.Engine", a.ko.Spec.Engine, b.ko.Spec.Engine)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.EngineVersion, b.ko.Spec.EngineVersion) {
		delta.Add("Spec.EngineVersion", a.ko.Spec.EngineVersion, b.ko.Spec.EngineVersion)
	} else if a.ko.Spec.EngineVersion != nil && b.ko.Spec.EngineVersion != nil {
		if *a.ko.Spec.EngineVersion != *b.ko.Spec.EngineVersion {
			delta.Add("Spec.EngineVersion", a.ko.Spec.EngineVersion, b.ko.Spec.EngineVersion)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.KMSKeyID, b.ko.Spec.KMSKeyID) {
		delta.Add("Spec.KMSKeyID", a.ko.Spec.KMSKeyID, b.ko.Spec.KMSKeyID)
	} else if a.ko.Spec.KMSKeyID != nil && b.ko.Spec.KMSKeyID != nil {
		if *a.ko.Spec.KMSKeyID != *b.ko.Spec.KMSKeyID {
			delta.Add("Spec.KMSKeyID", a.ko.Spec.KMSKeyID, b.ko.Spec.KMSKeyID)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MultiAZEnabled, b.ko.Spec.MultiAZEnabled) {
		delta.Add("Spec.MultiAZEnabled", a.ko.Spec.MultiAZEnabled, b.ko.Spec.MultiAZEnabled)
	} else if a.ko.Spec.MultiAZEnabled != nil && b.ko.Spec.MultiAZEnabled != nil {
		if *a.ko.Spec.MultiAZEnabled != *b.ko.Spec.MultiAZEnabled {
			delta.Add("Spec.MultiAZEnabled", a.ko.Spec.MultiAZEnabled, b.ko.Spec.MultiAZEnabled)
		}
	}
	if !reflect.DeepEqual(a.ko.Spec.NodeGroupConfiguration, b.ko.Spec.NodeGroupConfiguration) {
		delta.Add("Spec.NodeGroupConfiguration", a.ko.Spec.NodeGroupConfiguration, b.ko.Spec.NodeGroupConfiguration)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.NotificationTopicARN, b.ko.Spec.NotificationTopicARN) {
		delta.Add("Spec.NotificationTopicARN", a.ko.Spec.NotificationTopicARN, b.ko.Spec.NotificationTopicARN)
	} else if a.ko.Spec.NotificationTopicARN != nil && b.ko.Spec.NotificationTopicARN != nil {
		if *a.ko.Spec.NotificationTopicARN != *b.ko.Spec.NotificationTopicARN {
			delta.Add("Spec.NotificationTopicARN", a.ko.Spec.NotificationTopicARN, b.ko.Spec.NotificationTopicARN)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.NumNodeGroups, b.ko.Spec.NumNodeGroups) {
		delta.Add("Spec.NumNodeGroups", a.ko.Spec.NumNodeGroups, b.ko.Spec.NumNodeGroups)
	} else if a.ko.Spec.NumNodeGroups != nil && b.ko.Spec.NumNodeGroups != nil {
		if *a.ko.Spec.NumNodeGroups != *b.ko.Spec.NumNodeGroups {
			delta.Add("Spec.NumNodeGroups", a.ko.Spec.NumNodeGroups, b.ko.Spec.NumNodeGroups)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.Port, b.ko.Spec.Port) {
		delta.Add("Spec.Port", a.ko.Spec.Port, b.ko.Spec.Port)
	} else if a.ko.Spec.Port != nil && b.ko.Spec.Port != nil {
		if *a.ko.Spec.Port != *b.ko.Spec.Port {
			delta.Add("Spec.Port", a.ko.Spec.Port, b.ko.Spec.Port)
		}
	}
	if !ackcompare.SliceStringPEqual(a.ko.Spec.PreferredCacheClusterAZs, b.ko.Spec.PreferredCacheClusterAZs) {
		delta.Add("Spec.PreferredCacheClusterAZs", a.ko.Spec.PreferredCacheClusterAZs, b.ko.Spec.PreferredCacheClusterAZs)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PreferredMaintenanceWindow, b.ko.Spec.PreferredMaintenanceWindow) {
		delta.Add("Spec.PreferredMaintenanceWindow", a.ko.Spec.PreferredMaintenanceWindow, b.ko.Spec.PreferredMaintenanceWindow)
	} else if a.ko.Spec.PreferredMaintenanceWindow != nil && b.ko.Spec.PreferredMaintenanceWindow != nil {
		if *a.ko.Spec.PreferredMaintenanceWindow != *b.ko.Spec.PreferredMaintenanceWindow {
			delta.Add("Spec.PreferredMaintenanceWindow", a.ko.Spec.PreferredMaintenanceWindow, b.ko.Spec.PreferredMaintenanceWindow)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PrimaryClusterID, b.ko.Spec.PrimaryClusterID) {
		delta.Add("Spec.PrimaryClusterID", a.ko.Spec.PrimaryClusterID, b.ko.Spec.PrimaryClusterID)
	} else if a.ko.Spec.PrimaryClusterID != nil && b.ko.Spec.PrimaryClusterID != nil {
		if *a.ko.Spec.PrimaryClusterID != *b.ko.Spec.PrimaryClusterID {
			delta.Add("Spec.PrimaryClusterID", a.ko.Spec.PrimaryClusterID, b.ko.Spec.PrimaryClusterID)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.ReplicasPerNodeGroup, b.ko.Spec.ReplicasPerNodeGroup) {
		delta.Add("Spec.ReplicasPerNodeGroup", a.ko.Spec.ReplicasPerNodeGroup, b.ko.Spec.ReplicasPerNodeGroup)
	} else if a.ko.Spec.ReplicasPerNodeGroup != nil && b.ko.Spec.ReplicasPerNodeGroup != nil {
		if *a.ko.Spec.ReplicasPerNodeGroup != *b.ko.Spec.ReplicasPerNodeGroup {
			delta.Add("Spec.ReplicasPerNodeGroup", a.ko.Spec.ReplicasPerNodeGroup, b.ko.Spec.ReplicasPerNodeGroup)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.ReplicationGroupDescription, b.ko.Spec.ReplicationGroupDescription) {
		delta.Add("Spec.ReplicationGroupDescription", a.ko.Spec.ReplicationGroupDescription, b.ko.Spec.ReplicationGroupDescription)
	} else if a.ko.Spec.ReplicationGroupDescription != nil && b.ko.Spec.ReplicationGroupDescription != nil {
		if *a.ko.Spec.ReplicationGroupDescription != *b.ko.Spec.ReplicationGroupDescription {
			delta.Add("Spec.ReplicationGroupDescription", a.ko.Spec.ReplicationGroupDescription, b.ko.Spec.ReplicationGroupDescription)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.ReplicationGroupID, b.ko.Spec.ReplicationGroupID) {
		delta.Add("Spec.ReplicationGroupID", a.ko.Spec.ReplicationGroupID, b.ko.Spec.ReplicationGroupID)
	} else if a.ko.Spec.ReplicationGroupID != nil && b.ko.Spec.ReplicationGroupID != nil {
		if *a.ko.Spec.ReplicationGroupID != *b.ko.Spec.ReplicationGroupID {
			delta.Add("Spec.ReplicationGroupID", a.ko.Spec.ReplicationGroupID, b.ko.Spec.ReplicationGroupID)
		}
	}
	if !ackcompare.SliceStringPEqual(a.ko.Spec.SecurityGroupIDs, b.ko.Spec.SecurityGroupIDs) {
		delta.Add("Spec.SecurityGroupIDs", a.ko.Spec.SecurityGroupIDs, b.ko.Spec.SecurityGroupIDs)
	}
	if !ackcompare.SliceStringPEqual(a.ko.Spec.SnapshotARNs, b.ko.Spec.SnapshotARNs) {
		delta.Add("Spec.SnapshotARNs", a.ko.Spec.SnapshotARNs, b.ko.Spec.SnapshotARNs)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.SnapshotName, b.ko.Spec.SnapshotName) {
		delta.Add("Spec.SnapshotName", a.ko.Spec.SnapshotName, b.ko.Spec.SnapshotName)
	} else if a.ko.Spec.SnapshotName != nil && b.ko.Spec.SnapshotName != nil {
		if *a.ko.Spec.SnapshotName != *b.ko.Spec.SnapshotName {
			delta.Add("Spec.SnapshotName", a.ko.Spec.SnapshotName, b.ko.Spec.SnapshotName)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.SnapshotRetentionLimit, b.ko.Spec.SnapshotRetentionLimit) {
		delta.Add("Spec.SnapshotRetentionLimit", a.ko.Spec.SnapshotRetentionLimit, b.ko.Spec.SnapshotRetentionLimit)
	} else if a.ko.Spec.SnapshotRetentionLimit != nil && b.ko.Spec.SnapshotRetentionLimit != nil {
		if *a.ko.Spec.SnapshotRetentionLimit != *b.ko.Spec.SnapshotRetentionLimit {
			delta.Add("Spec.SnapshotRetentionLimit", a.ko.Spec.SnapshotRetentionLimit, b.ko.Spec.SnapshotRetentionLimit)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.SnapshotWindow, b.ko.Spec.SnapshotWindow) {
		delta.Add("Spec.SnapshotWindow", a.ko.Spec.SnapshotWindow, b.ko.Spec.SnapshotWindow)
	} else if a.ko.Spec.SnapshotWindow != nil && b.ko.Spec.SnapshotWindow != nil {
		if *a.ko.Spec.SnapshotWindow != *b.ko.Spec.SnapshotWindow {
			delta.Add("Spec.SnapshotWindow", a.ko.Spec.SnapshotWindow, b.ko.Spec.SnapshotWindow)
		}
	}
	if !reflect.DeepEqual(a.ko.Spec.Tags, b.ko.Spec.Tags) {
		delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.TransitEncryptionEnabled, b.ko.Spec.TransitEncryptionEnabled) {
		delta.Add("Spec.TransitEncryptionEnabled", a.ko.Spec.TransitEncryptionEnabled, b.ko.Spec.TransitEncryptionEnabled)
	} else if a.ko.Spec.TransitEncryptionEnabled != nil && b.ko.Spec.TransitEncryptionEnabled != nil {
		if *a.ko.Spec.TransitEncryptionEnabled != *b.ko.Spec.TransitEncryptionEnabled {
			delta.Add("Spec.TransitEncryptionEnabled", a.ko.Spec.TransitEncryptionEnabled, b.ko.Spec.TransitEncryptionEnabled)
		}
	}
	if !ackcompare.SliceStringPEqual(a.ko.Spec.UserGroupIDs, b.ko.Spec.UserGroupIDs) {
		delta.Add("Spec.UserGroupIDs", a.ko.Spec.UserGroupIDs, b.ko.Spec.UserGroupIDs)
	}
	filterDelta(delta, a, b)
	return delta
}
newResourceDelta returns a new `ackcompare.Delta` used to compare two
resources
package replication_group
import (
	"bytes"
	"reflect"
	ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
)
var (
	_ = &bytes.Buffer{}
	_ = &reflect.Method{}
)