// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//     http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file 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 ack-generate. DO NOT EDIT.

package db_instance

import (
	"bytes"
	"reflect"

	ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
	acktags "github.com/aws-controllers-k8s/runtime/pkg/tags"
)

// Hack to avoid import errors during build...
var (
	_ = &bytes.Buffer{}
	_ = &reflect.Method{}
	_ = &acktags.Tags{}
)

// newResourceDelta returns a new `ackcompare.Delta` used to compare two
// resources
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
	}
	// Do not consider any of the following fields for delta if they are missing in
	// desired(a) but are present in latest(b) because each of these fields is
	// late-initialized
	// This special handling is only needed for DBInstance because late
	// initialized values are not returned after successful ModifyDBInstance
	// call. They are only populated once the DBInstance returns back to
	// available.
	if a.ko.Spec.AvailabilityZone == nil &&
		b.ko.Spec.AvailabilityZone != nil {
		a.ko.Spec.AvailabilityZone = b.ko.Spec.AvailabilityZone
	}
	if a.ko.Spec.BackupTarget == nil &&
		b.ko.Spec.BackupTarget != nil &&
		*b.ko.Spec.BackupTarget == ServiceDefaultBackupTarget {
		a.ko.Spec.BackupTarget = b.ko.Spec.BackupTarget
	}
	if a.ko.Spec.NetworkType == nil &&
		b.ko.Spec.NetworkType != nil &&
		*b.ko.Spec.NetworkType == ServiceDefaultNetworkType {
		a.ko.Spec.NetworkType = b.ko.Spec.NetworkType
	}
	if a.ko.Spec.PerformanceInsightsEnabled == nil &&
		b.ko.Spec.PerformanceInsightsEnabled != nil {
		a.ko.Spec.PerformanceInsightsEnabled = func() *bool { a := false; return &a }()
	}

	// RDS will choose preferred engine minor version if only
	// engine major version is provided and controler should not
	// treat them as different, such as spec has 14, status has 14.1
	// controller should treat them as same
	reconcileEngineVersion(a, b)
	compareTags(delta, a, b)
	compareSecretReferenceChanges(delta, a, b)

	if ackcompare.HasNilDifference(a.ko.Spec.AllocatedStorage, b.ko.Spec.AllocatedStorage) {
		delta.Add("Spec.AllocatedStorage", a.ko.Spec.AllocatedStorage, b.ko.Spec.AllocatedStorage)
	} else if a.ko.Spec.AllocatedStorage != nil && b.ko.Spec.AllocatedStorage != nil {
		if *a.ko.Spec.AllocatedStorage != *b.ko.Spec.AllocatedStorage {
			delta.Add("Spec.AllocatedStorage", a.ko.Spec.AllocatedStorage, b.ko.Spec.AllocatedStorage)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.AutoMinorVersionUpgrade, b.ko.Spec.AutoMinorVersionUpgrade) {
		delta.Add("Spec.AutoMinorVersionUpgrade", a.ko.Spec.AutoMinorVersionUpgrade, b.ko.Spec.AutoMinorVersionUpgrade)
	} else if a.ko.Spec.AutoMinorVersionUpgrade != nil && b.ko.Spec.AutoMinorVersionUpgrade != nil {
		if *a.ko.Spec.AutoMinorVersionUpgrade != *b.ko.Spec.AutoMinorVersionUpgrade {
			delta.Add("Spec.AutoMinorVersionUpgrade", a.ko.Spec.AutoMinorVersionUpgrade, b.ko.Spec.AutoMinorVersionUpgrade)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.AvailabilityZone, b.ko.Spec.AvailabilityZone) {
		delta.Add("Spec.AvailabilityZone", a.ko.Spec.AvailabilityZone, b.ko.Spec.AvailabilityZone)
	} else if a.ko.Spec.AvailabilityZone != nil && b.ko.Spec.AvailabilityZone != nil {
		if *a.ko.Spec.AvailabilityZone != *b.ko.Spec.AvailabilityZone {
			delta.Add("Spec.AvailabilityZone", a.ko.Spec.AvailabilityZone, b.ko.Spec.AvailabilityZone)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.BackupRetentionPeriod, b.ko.Spec.BackupRetentionPeriod) {
		delta.Add("Spec.BackupRetentionPeriod", a.ko.Spec.BackupRetentionPeriod, b.ko.Spec.BackupRetentionPeriod)
	} else if a.ko.Spec.BackupRetentionPeriod != nil && b.ko.Spec.BackupRetentionPeriod != nil {
		if *a.ko.Spec.BackupRetentionPeriod != *b.ko.Spec.BackupRetentionPeriod {
			delta.Add("Spec.BackupRetentionPeriod", a.ko.Spec.BackupRetentionPeriod, b.ko.Spec.BackupRetentionPeriod)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.BackupTarget, b.ko.Spec.BackupTarget) {
		delta.Add("Spec.BackupTarget", a.ko.Spec.BackupTarget, b.ko.Spec.BackupTarget)
	} else if a.ko.Spec.BackupTarget != nil && b.ko.Spec.BackupTarget != nil {
		if *a.ko.Spec.BackupTarget != *b.ko.Spec.BackupTarget {
			delta.Add("Spec.BackupTarget", a.ko.Spec.BackupTarget, b.ko.Spec.BackupTarget)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.CACertificateIdentifier, b.ko.Spec.CACertificateIdentifier) {
		delta.Add("Spec.CACertificateIdentifier", a.ko.Spec.CACertificateIdentifier, b.ko.Spec.CACertificateIdentifier)
	} else if a.ko.Spec.CACertificateIdentifier != nil && b.ko.Spec.CACertificateIdentifier != nil {
		if *a.ko.Spec.CACertificateIdentifier != *b.ko.Spec.CACertificateIdentifier {
			delta.Add("Spec.CACertificateIdentifier", a.ko.Spec.CACertificateIdentifier, b.ko.Spec.CACertificateIdentifier)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.CharacterSetName, b.ko.Spec.CharacterSetName) {
		delta.Add("Spec.CharacterSetName", a.ko.Spec.CharacterSetName, b.ko.Spec.CharacterSetName)
	} else if a.ko.Spec.CharacterSetName != nil && b.ko.Spec.CharacterSetName != nil {
		if *a.ko.Spec.CharacterSetName != *b.ko.Spec.CharacterSetName {
			delta.Add("Spec.CharacterSetName", a.ko.Spec.CharacterSetName, b.ko.Spec.CharacterSetName)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.CopyTagsToSnapshot, b.ko.Spec.CopyTagsToSnapshot) {
		delta.Add("Spec.CopyTagsToSnapshot", a.ko.Spec.CopyTagsToSnapshot, b.ko.Spec.CopyTagsToSnapshot)
	} else if a.ko.Spec.CopyTagsToSnapshot != nil && b.ko.Spec.CopyTagsToSnapshot != nil {
		if *a.ko.Spec.CopyTagsToSnapshot != *b.ko.Spec.CopyTagsToSnapshot {
			delta.Add("Spec.CopyTagsToSnapshot", a.ko.Spec.CopyTagsToSnapshot, b.ko.Spec.CopyTagsToSnapshot)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.CustomIAMInstanceProfile, b.ko.Spec.CustomIAMInstanceProfile) {
		delta.Add("Spec.CustomIAMInstanceProfile", a.ko.Spec.CustomIAMInstanceProfile, b.ko.Spec.CustomIAMInstanceProfile)
	} else if a.ko.Spec.CustomIAMInstanceProfile != nil && b.ko.Spec.CustomIAMInstanceProfile != nil {
		if *a.ko.Spec.CustomIAMInstanceProfile != *b.ko.Spec.CustomIAMInstanceProfile {
			delta.Add("Spec.CustomIAMInstanceProfile", a.ko.Spec.CustomIAMInstanceProfile, b.ko.Spec.CustomIAMInstanceProfile)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBClusterIdentifier, b.ko.Spec.DBClusterIdentifier) {
		delta.Add("Spec.DBClusterIdentifier", a.ko.Spec.DBClusterIdentifier, b.ko.Spec.DBClusterIdentifier)
	} else if a.ko.Spec.DBClusterIdentifier != nil && b.ko.Spec.DBClusterIdentifier != nil {
		if *a.ko.Spec.DBClusterIdentifier != *b.ko.Spec.DBClusterIdentifier {
			delta.Add("Spec.DBClusterIdentifier", a.ko.Spec.DBClusterIdentifier, b.ko.Spec.DBClusterIdentifier)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBClusterSnapshotIdentifier, b.ko.Spec.DBClusterSnapshotIdentifier) {
		delta.Add("Spec.DBClusterSnapshotIdentifier", a.ko.Spec.DBClusterSnapshotIdentifier, b.ko.Spec.DBClusterSnapshotIdentifier)
	} else if a.ko.Spec.DBClusterSnapshotIdentifier != nil && b.ko.Spec.DBClusterSnapshotIdentifier != nil {
		if *a.ko.Spec.DBClusterSnapshotIdentifier != *b.ko.Spec.DBClusterSnapshotIdentifier {
			delta.Add("Spec.DBClusterSnapshotIdentifier", a.ko.Spec.DBClusterSnapshotIdentifier, b.ko.Spec.DBClusterSnapshotIdentifier)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBInstanceClass, b.ko.Spec.DBInstanceClass) {
		delta.Add("Spec.DBInstanceClass", a.ko.Spec.DBInstanceClass, b.ko.Spec.DBInstanceClass)
	} else if a.ko.Spec.DBInstanceClass != nil && b.ko.Spec.DBInstanceClass != nil {
		if *a.ko.Spec.DBInstanceClass != *b.ko.Spec.DBInstanceClass {
			delta.Add("Spec.DBInstanceClass", a.ko.Spec.DBInstanceClass, b.ko.Spec.DBInstanceClass)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBInstanceIdentifier, b.ko.Spec.DBInstanceIdentifier) {
		delta.Add("Spec.DBInstanceIdentifier", a.ko.Spec.DBInstanceIdentifier, b.ko.Spec.DBInstanceIdentifier)
	} else if a.ko.Spec.DBInstanceIdentifier != nil && b.ko.Spec.DBInstanceIdentifier != nil {
		if *a.ko.Spec.DBInstanceIdentifier != *b.ko.Spec.DBInstanceIdentifier {
			delta.Add("Spec.DBInstanceIdentifier", a.ko.Spec.DBInstanceIdentifier, b.ko.Spec.DBInstanceIdentifier)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBName, b.ko.Spec.DBName) {
		delta.Add("Spec.DBName", a.ko.Spec.DBName, b.ko.Spec.DBName)
	} else if a.ko.Spec.DBName != nil && b.ko.Spec.DBName != nil {
		if *a.ko.Spec.DBName != *b.ko.Spec.DBName {
			delta.Add("Spec.DBName", a.ko.Spec.DBName, b.ko.Spec.DBName)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBParameterGroupName, b.ko.Spec.DBParameterGroupName) {
		delta.Add("Spec.DBParameterGroupName", a.ko.Spec.DBParameterGroupName, b.ko.Spec.DBParameterGroupName)
	} else if a.ko.Spec.DBParameterGroupName != nil && b.ko.Spec.DBParameterGroupName != nil {
		if *a.ko.Spec.DBParameterGroupName != *b.ko.Spec.DBParameterGroupName {
			delta.Add("Spec.DBParameterGroupName", a.ko.Spec.DBParameterGroupName, b.ko.Spec.DBParameterGroupName)
		}
	}
	if !reflect.DeepEqual(a.ko.Spec.DBParameterGroupRef, b.ko.Spec.DBParameterGroupRef) {
		delta.Add("Spec.DBParameterGroupRef", a.ko.Spec.DBParameterGroupRef, b.ko.Spec.DBParameterGroupRef)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBSnapshotIdentifier, b.ko.Spec.DBSnapshotIdentifier) {
		delta.Add("Spec.DBSnapshotIdentifier", a.ko.Spec.DBSnapshotIdentifier, b.ko.Spec.DBSnapshotIdentifier)
	} else if a.ko.Spec.DBSnapshotIdentifier != nil && b.ko.Spec.DBSnapshotIdentifier != nil {
		if *a.ko.Spec.DBSnapshotIdentifier != *b.ko.Spec.DBSnapshotIdentifier {
			delta.Add("Spec.DBSnapshotIdentifier", a.ko.Spec.DBSnapshotIdentifier, b.ko.Spec.DBSnapshotIdentifier)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DBSubnetGroupName, b.ko.Spec.DBSubnetGroupName) {
		delta.Add("Spec.DBSubnetGroupName", a.ko.Spec.DBSubnetGroupName, b.ko.Spec.DBSubnetGroupName)
	} else if a.ko.Spec.DBSubnetGroupName != nil && b.ko.Spec.DBSubnetGroupName != nil {
		if *a.ko.Spec.DBSubnetGroupName != *b.ko.Spec.DBSubnetGroupName {
			delta.Add("Spec.DBSubnetGroupName", a.ko.Spec.DBSubnetGroupName, b.ko.Spec.DBSubnetGroupName)
		}
	}
	if !reflect.DeepEqual(a.ko.Spec.DBSubnetGroupRef, b.ko.Spec.DBSubnetGroupRef) {
		delta.Add("Spec.DBSubnetGroupRef", a.ko.Spec.DBSubnetGroupRef, b.ko.Spec.DBSubnetGroupRef)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DatabaseInsightsMode, b.ko.Spec.DatabaseInsightsMode) {
		delta.Add("Spec.DatabaseInsightsMode", a.ko.Spec.DatabaseInsightsMode, b.ko.Spec.DatabaseInsightsMode)
	} else if a.ko.Spec.DatabaseInsightsMode != nil && b.ko.Spec.DatabaseInsightsMode != nil {
		if *a.ko.Spec.DatabaseInsightsMode != *b.ko.Spec.DatabaseInsightsMode {
			delta.Add("Spec.DatabaseInsightsMode", a.ko.Spec.DatabaseInsightsMode, b.ko.Spec.DatabaseInsightsMode)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DeletionProtection, b.ko.Spec.DeletionProtection) {
		delta.Add("Spec.DeletionProtection", a.ko.Spec.DeletionProtection, b.ko.Spec.DeletionProtection)
	} else if a.ko.Spec.DeletionProtection != nil && b.ko.Spec.DeletionProtection != nil {
		if *a.ko.Spec.DeletionProtection != *b.ko.Spec.DeletionProtection {
			delta.Add("Spec.DeletionProtection", a.ko.Spec.DeletionProtection, b.ko.Spec.DeletionProtection)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DestinationRegion, b.ko.Spec.DestinationRegion) {
		delta.Add("Spec.DestinationRegion", a.ko.Spec.DestinationRegion, b.ko.Spec.DestinationRegion)
	} else if a.ko.Spec.DestinationRegion != nil && b.ko.Spec.DestinationRegion != nil {
		if *a.ko.Spec.DestinationRegion != *b.ko.Spec.DestinationRegion {
			delta.Add("Spec.DestinationRegion", a.ko.Spec.DestinationRegion, b.ko.Spec.DestinationRegion)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.Domain, b.ko.Spec.Domain) {
		delta.Add("Spec.Domain", a.ko.Spec.Domain, b.ko.Spec.Domain)
	} else if a.ko.Spec.Domain != nil && b.ko.Spec.Domain != nil {
		if *a.ko.Spec.Domain != *b.ko.Spec.Domain {
			delta.Add("Spec.Domain", a.ko.Spec.Domain, b.ko.Spec.Domain)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.DomainIAMRoleName, b.ko.Spec.DomainIAMRoleName) {
		delta.Add("Spec.DomainIAMRoleName", a.ko.Spec.DomainIAMRoleName, b.ko.Spec.DomainIAMRoleName)
	} else if a.ko.Spec.DomainIAMRoleName != nil && b.ko.Spec.DomainIAMRoleName != nil {
		if *a.ko.Spec.DomainIAMRoleName != *b.ko.Spec.DomainIAMRoleName {
			delta.Add("Spec.DomainIAMRoleName", a.ko.Spec.DomainIAMRoleName, b.ko.Spec.DomainIAMRoleName)
		}
	}
	if len(a.ko.Spec.EnableCloudwatchLogsExports) != len(b.ko.Spec.EnableCloudwatchLogsExports) {
		delta.Add("Spec.EnableCloudwatchLogsExports", a.ko.Spec.EnableCloudwatchLogsExports, b.ko.Spec.EnableCloudwatchLogsExports)
	} else if len(a.ko.Spec.EnableCloudwatchLogsExports) > 0 {
		if !ackcompare.SliceStringPEqual(a.ko.Spec.EnableCloudwatchLogsExports, b.ko.Spec.EnableCloudwatchLogsExports) {
			delta.Add("Spec.EnableCloudwatchLogsExports", a.ko.Spec.EnableCloudwatchLogsExports, b.ko.Spec.EnableCloudwatchLogsExports)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.EnableCustomerOwnedIP, b.ko.Spec.EnableCustomerOwnedIP) {
		delta.Add("Spec.EnableCustomerOwnedIP", a.ko.Spec.EnableCustomerOwnedIP, b.ko.Spec.EnableCustomerOwnedIP)
	} else if a.ko.Spec.EnableCustomerOwnedIP != nil && b.ko.Spec.EnableCustomerOwnedIP != nil {
		if *a.ko.Spec.EnableCustomerOwnedIP != *b.ko.Spec.EnableCustomerOwnedIP {
			delta.Add("Spec.EnableCustomerOwnedIP", a.ko.Spec.EnableCustomerOwnedIP, b.ko.Spec.EnableCustomerOwnedIP)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.EnableIAMDatabaseAuthentication, b.ko.Spec.EnableIAMDatabaseAuthentication) {
		delta.Add("Spec.EnableIAMDatabaseAuthentication", a.ko.Spec.EnableIAMDatabaseAuthentication, b.ko.Spec.EnableIAMDatabaseAuthentication)
	} else if a.ko.Spec.EnableIAMDatabaseAuthentication != nil && b.ko.Spec.EnableIAMDatabaseAuthentication != nil {
		if *a.ko.Spec.EnableIAMDatabaseAuthentication != *b.ko.Spec.EnableIAMDatabaseAuthentication {
			delta.Add("Spec.EnableIAMDatabaseAuthentication", a.ko.Spec.EnableIAMDatabaseAuthentication, b.ko.Spec.EnableIAMDatabaseAuthentication)
		}
	}
	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.IOPS, b.ko.Spec.IOPS) {
		delta.Add("Spec.IOPS", a.ko.Spec.IOPS, b.ko.Spec.IOPS)
	} else if a.ko.Spec.IOPS != nil && b.ko.Spec.IOPS != nil {
		if *a.ko.Spec.IOPS != *b.ko.Spec.IOPS {
			delta.Add("Spec.IOPS", a.ko.Spec.IOPS, b.ko.Spec.IOPS)
		}
	}
	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 !reflect.DeepEqual(a.ko.Spec.KMSKeyRef, b.ko.Spec.KMSKeyRef) {
		delta.Add("Spec.KMSKeyRef", a.ko.Spec.KMSKeyRef, b.ko.Spec.KMSKeyRef)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.LicenseModel, b.ko.Spec.LicenseModel) {
		delta.Add("Spec.LicenseModel", a.ko.Spec.LicenseModel, b.ko.Spec.LicenseModel)
	} else if a.ko.Spec.LicenseModel != nil && b.ko.Spec.LicenseModel != nil {
		if *a.ko.Spec.LicenseModel != *b.ko.Spec.LicenseModel {
			delta.Add("Spec.LicenseModel", a.ko.Spec.LicenseModel, b.ko.Spec.LicenseModel)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.ManageMasterUserPassword, b.ko.Spec.ManageMasterUserPassword) {
		delta.Add("Spec.ManageMasterUserPassword", a.ko.Spec.ManageMasterUserPassword, b.ko.Spec.ManageMasterUserPassword)
	} else if a.ko.Spec.ManageMasterUserPassword != nil && b.ko.Spec.ManageMasterUserPassword != nil {
		if *a.ko.Spec.ManageMasterUserPassword != *b.ko.Spec.ManageMasterUserPassword {
			delta.Add("Spec.ManageMasterUserPassword", a.ko.Spec.ManageMasterUserPassword, b.ko.Spec.ManageMasterUserPassword)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MasterUserPassword, b.ko.Spec.MasterUserPassword) {
		delta.Add("Spec.MasterUserPassword", a.ko.Spec.MasterUserPassword, b.ko.Spec.MasterUserPassword)
	} else if a.ko.Spec.MasterUserPassword != nil && b.ko.Spec.MasterUserPassword != nil {
		if *a.ko.Spec.MasterUserPassword != *b.ko.Spec.MasterUserPassword {
			delta.Add("Spec.MasterUserPassword", a.ko.Spec.MasterUserPassword, b.ko.Spec.MasterUserPassword)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MasterUserSecretKMSKeyID, b.ko.Spec.MasterUserSecretKMSKeyID) {
		delta.Add("Spec.MasterUserSecretKMSKeyID", a.ko.Spec.MasterUserSecretKMSKeyID, b.ko.Spec.MasterUserSecretKMSKeyID)
	} else if a.ko.Spec.MasterUserSecretKMSKeyID != nil && b.ko.Spec.MasterUserSecretKMSKeyID != nil {
		if *a.ko.Spec.MasterUserSecretKMSKeyID != *b.ko.Spec.MasterUserSecretKMSKeyID {
			delta.Add("Spec.MasterUserSecretKMSKeyID", a.ko.Spec.MasterUserSecretKMSKeyID, b.ko.Spec.MasterUserSecretKMSKeyID)
		}
	}
	if !reflect.DeepEqual(a.ko.Spec.MasterUserSecretKMSKeyRef, b.ko.Spec.MasterUserSecretKMSKeyRef) {
		delta.Add("Spec.MasterUserSecretKMSKeyRef", a.ko.Spec.MasterUserSecretKMSKeyRef, b.ko.Spec.MasterUserSecretKMSKeyRef)
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MasterUsername, b.ko.Spec.MasterUsername) {
		delta.Add("Spec.MasterUsername", a.ko.Spec.MasterUsername, b.ko.Spec.MasterUsername)
	} else if a.ko.Spec.MasterUsername != nil && b.ko.Spec.MasterUsername != nil {
		if *a.ko.Spec.MasterUsername != *b.ko.Spec.MasterUsername {
			delta.Add("Spec.MasterUsername", a.ko.Spec.MasterUsername, b.ko.Spec.MasterUsername)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MaxAllocatedStorage, b.ko.Spec.MaxAllocatedStorage) {
		delta.Add("Spec.MaxAllocatedStorage", a.ko.Spec.MaxAllocatedStorage, b.ko.Spec.MaxAllocatedStorage)
	} else if a.ko.Spec.MaxAllocatedStorage != nil && b.ko.Spec.MaxAllocatedStorage != nil {
		if *a.ko.Spec.MaxAllocatedStorage != *b.ko.Spec.MaxAllocatedStorage {
			delta.Add("Spec.MaxAllocatedStorage", a.ko.Spec.MaxAllocatedStorage, b.ko.Spec.MaxAllocatedStorage)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MonitoringInterval, b.ko.Spec.MonitoringInterval) {
		delta.Add("Spec.MonitoringInterval", a.ko.Spec.MonitoringInterval, b.ko.Spec.MonitoringInterval)
	} else if a.ko.Spec.MonitoringInterval != nil && b.ko.Spec.MonitoringInterval != nil {
		if *a.ko.Spec.MonitoringInterval != *b.ko.Spec.MonitoringInterval {
			delta.Add("Spec.MonitoringInterval", a.ko.Spec.MonitoringInterval, b.ko.Spec.MonitoringInterval)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MonitoringRoleARN, b.ko.Spec.MonitoringRoleARN) {
		delta.Add("Spec.MonitoringRoleARN", a.ko.Spec.MonitoringRoleARN, b.ko.Spec.MonitoringRoleARN)
	} else if a.ko.Spec.MonitoringRoleARN != nil && b.ko.Spec.MonitoringRoleARN != nil {
		if *a.ko.Spec.MonitoringRoleARN != *b.ko.Spec.MonitoringRoleARN {
			delta.Add("Spec.MonitoringRoleARN", a.ko.Spec.MonitoringRoleARN, b.ko.Spec.MonitoringRoleARN)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.MultiAZ, b.ko.Spec.MultiAZ) {
		delta.Add("Spec.MultiAZ", a.ko.Spec.MultiAZ, b.ko.Spec.MultiAZ)
	} else if a.ko.Spec.MultiAZ != nil && b.ko.Spec.MultiAZ != nil {
		if *a.ko.Spec.MultiAZ != *b.ko.Spec.MultiAZ {
			delta.Add("Spec.MultiAZ", a.ko.Spec.MultiAZ, b.ko.Spec.MultiAZ)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.NcharCharacterSetName, b.ko.Spec.NcharCharacterSetName) {
		delta.Add("Spec.NcharCharacterSetName", a.ko.Spec.NcharCharacterSetName, b.ko.Spec.NcharCharacterSetName)
	} else if a.ko.Spec.NcharCharacterSetName != nil && b.ko.Spec.NcharCharacterSetName != nil {
		if *a.ko.Spec.NcharCharacterSetName != *b.ko.Spec.NcharCharacterSetName {
			delta.Add("Spec.NcharCharacterSetName", a.ko.Spec.NcharCharacterSetName, b.ko.Spec.NcharCharacterSetName)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.NetworkType, b.ko.Spec.NetworkType) {
		delta.Add("Spec.NetworkType", a.ko.Spec.NetworkType, b.ko.Spec.NetworkType)
	} else if a.ko.Spec.NetworkType != nil && b.ko.Spec.NetworkType != nil {
		if *a.ko.Spec.NetworkType != *b.ko.Spec.NetworkType {
			delta.Add("Spec.NetworkType", a.ko.Spec.NetworkType, b.ko.Spec.NetworkType)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.OptionGroupName, b.ko.Spec.OptionGroupName) {
		delta.Add("Spec.OptionGroupName", a.ko.Spec.OptionGroupName, b.ko.Spec.OptionGroupName)
	} else if a.ko.Spec.OptionGroupName != nil && b.ko.Spec.OptionGroupName != nil {
		if *a.ko.Spec.OptionGroupName != *b.ko.Spec.OptionGroupName {
			delta.Add("Spec.OptionGroupName", a.ko.Spec.OptionGroupName, b.ko.Spec.OptionGroupName)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PerformanceInsightsEnabled, b.ko.Spec.PerformanceInsightsEnabled) {
		delta.Add("Spec.PerformanceInsightsEnabled", a.ko.Spec.PerformanceInsightsEnabled, b.ko.Spec.PerformanceInsightsEnabled)
	} else if a.ko.Spec.PerformanceInsightsEnabled != nil && b.ko.Spec.PerformanceInsightsEnabled != nil {
		if *a.ko.Spec.PerformanceInsightsEnabled != *b.ko.Spec.PerformanceInsightsEnabled {
			delta.Add("Spec.PerformanceInsightsEnabled", a.ko.Spec.PerformanceInsightsEnabled, b.ko.Spec.PerformanceInsightsEnabled)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PerformanceInsightsKMSKeyID, b.ko.Spec.PerformanceInsightsKMSKeyID) {
		delta.Add("Spec.PerformanceInsightsKMSKeyID", a.ko.Spec.PerformanceInsightsKMSKeyID, b.ko.Spec.PerformanceInsightsKMSKeyID)
	} else if a.ko.Spec.PerformanceInsightsKMSKeyID != nil && b.ko.Spec.PerformanceInsightsKMSKeyID != nil {
		if *a.ko.Spec.PerformanceInsightsKMSKeyID != *b.ko.Spec.PerformanceInsightsKMSKeyID {
			delta.Add("Spec.PerformanceInsightsKMSKeyID", a.ko.Spec.PerformanceInsightsKMSKeyID, b.ko.Spec.PerformanceInsightsKMSKeyID)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PerformanceInsightsRetentionPeriod, b.ko.Spec.PerformanceInsightsRetentionPeriod) {
		delta.Add("Spec.PerformanceInsightsRetentionPeriod", a.ko.Spec.PerformanceInsightsRetentionPeriod, b.ko.Spec.PerformanceInsightsRetentionPeriod)
	} else if a.ko.Spec.PerformanceInsightsRetentionPeriod != nil && b.ko.Spec.PerformanceInsightsRetentionPeriod != nil {
		if *a.ko.Spec.PerformanceInsightsRetentionPeriod != *b.ko.Spec.PerformanceInsightsRetentionPeriod {
			delta.Add("Spec.PerformanceInsightsRetentionPeriod", a.ko.Spec.PerformanceInsightsRetentionPeriod, b.ko.Spec.PerformanceInsightsRetentionPeriod)
		}
	}
	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.HasNilDifference(a.ko.Spec.PreSignedURL, b.ko.Spec.PreSignedURL) {
		delta.Add("Spec.PreSignedURL", a.ko.Spec.PreSignedURL, b.ko.Spec.PreSignedURL)
	} else if a.ko.Spec.PreSignedURL != nil && b.ko.Spec.PreSignedURL != nil {
		if *a.ko.Spec.PreSignedURL != *b.ko.Spec.PreSignedURL {
			delta.Add("Spec.PreSignedURL", a.ko.Spec.PreSignedURL, b.ko.Spec.PreSignedURL)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PreferredBackupWindow, b.ko.Spec.PreferredBackupWindow) {
		delta.Add("Spec.PreferredBackupWindow", a.ko.Spec.PreferredBackupWindow, b.ko.Spec.PreferredBackupWindow)
	} else if a.ko.Spec.PreferredBackupWindow != nil && b.ko.Spec.PreferredBackupWindow != nil {
		if *a.ko.Spec.PreferredBackupWindow != *b.ko.Spec.PreferredBackupWindow {
			delta.Add("Spec.PreferredBackupWindow", a.ko.Spec.PreferredBackupWindow, b.ko.Spec.PreferredBackupWindow)
		}
	}
	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 len(a.ko.Spec.ProcessorFeatures) != len(b.ko.Spec.ProcessorFeatures) {
		delta.Add("Spec.ProcessorFeatures", a.ko.Spec.ProcessorFeatures, b.ko.Spec.ProcessorFeatures)
	} else if len(a.ko.Spec.ProcessorFeatures) > 0 {
		if !reflect.DeepEqual(a.ko.Spec.ProcessorFeatures, b.ko.Spec.ProcessorFeatures) {
			delta.Add("Spec.ProcessorFeatures", a.ko.Spec.ProcessorFeatures, b.ko.Spec.ProcessorFeatures)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PromotionTier, b.ko.Spec.PromotionTier) {
		delta.Add("Spec.PromotionTier", a.ko.Spec.PromotionTier, b.ko.Spec.PromotionTier)
	} else if a.ko.Spec.PromotionTier != nil && b.ko.Spec.PromotionTier != nil {
		if *a.ko.Spec.PromotionTier != *b.ko.Spec.PromotionTier {
			delta.Add("Spec.PromotionTier", a.ko.Spec.PromotionTier, b.ko.Spec.PromotionTier)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.PubliclyAccessible, b.ko.Spec.PubliclyAccessible) {
		delta.Add("Spec.PubliclyAccessible", a.ko.Spec.PubliclyAccessible, b.ko.Spec.PubliclyAccessible)
	} else if a.ko.Spec.PubliclyAccessible != nil && b.ko.Spec.PubliclyAccessible != nil {
		if *a.ko.Spec.PubliclyAccessible != *b.ko.Spec.PubliclyAccessible {
			delta.Add("Spec.PubliclyAccessible", a.ko.Spec.PubliclyAccessible, b.ko.Spec.PubliclyAccessible)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.ReplicaMode, b.ko.Spec.ReplicaMode) {
		delta.Add("Spec.ReplicaMode", a.ko.Spec.ReplicaMode, b.ko.Spec.ReplicaMode)
	} else if a.ko.Spec.ReplicaMode != nil && b.ko.Spec.ReplicaMode != nil {
		if *a.ko.Spec.ReplicaMode != *b.ko.Spec.ReplicaMode {
			delta.Add("Spec.ReplicaMode", a.ko.Spec.ReplicaMode, b.ko.Spec.ReplicaMode)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.SourceDBInstanceIdentifier, b.ko.Spec.SourceDBInstanceIdentifier) {
		delta.Add("Spec.SourceDBInstanceIdentifier", a.ko.Spec.SourceDBInstanceIdentifier, b.ko.Spec.SourceDBInstanceIdentifier)
	} else if a.ko.Spec.SourceDBInstanceIdentifier != nil && b.ko.Spec.SourceDBInstanceIdentifier != nil {
		if *a.ko.Spec.SourceDBInstanceIdentifier != *b.ko.Spec.SourceDBInstanceIdentifier {
			delta.Add("Spec.SourceDBInstanceIdentifier", a.ko.Spec.SourceDBInstanceIdentifier, b.ko.Spec.SourceDBInstanceIdentifier)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.SourceRegion, b.ko.Spec.SourceRegion) {
		delta.Add("Spec.SourceRegion", a.ko.Spec.SourceRegion, b.ko.Spec.SourceRegion)
	} else if a.ko.Spec.SourceRegion != nil && b.ko.Spec.SourceRegion != nil {
		if *a.ko.Spec.SourceRegion != *b.ko.Spec.SourceRegion {
			delta.Add("Spec.SourceRegion", a.ko.Spec.SourceRegion, b.ko.Spec.SourceRegion)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.StorageEncrypted, b.ko.Spec.StorageEncrypted) {
		delta.Add("Spec.StorageEncrypted", a.ko.Spec.StorageEncrypted, b.ko.Spec.StorageEncrypted)
	} else if a.ko.Spec.StorageEncrypted != nil && b.ko.Spec.StorageEncrypted != nil {
		if *a.ko.Spec.StorageEncrypted != *b.ko.Spec.StorageEncrypted {
			delta.Add("Spec.StorageEncrypted", a.ko.Spec.StorageEncrypted, b.ko.Spec.StorageEncrypted)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.StorageThroughput, b.ko.Spec.StorageThroughput) {
		delta.Add("Spec.StorageThroughput", a.ko.Spec.StorageThroughput, b.ko.Spec.StorageThroughput)
	} else if a.ko.Spec.StorageThroughput != nil && b.ko.Spec.StorageThroughput != nil {
		if *a.ko.Spec.StorageThroughput != *b.ko.Spec.StorageThroughput {
			delta.Add("Spec.StorageThroughput", a.ko.Spec.StorageThroughput, b.ko.Spec.StorageThroughput)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.StorageType, b.ko.Spec.StorageType) {
		delta.Add("Spec.StorageType", a.ko.Spec.StorageType, b.ko.Spec.StorageType)
	} else if a.ko.Spec.StorageType != nil && b.ko.Spec.StorageType != nil {
		if *a.ko.Spec.StorageType != *b.ko.Spec.StorageType {
			delta.Add("Spec.StorageType", a.ko.Spec.StorageType, b.ko.Spec.StorageType)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.TDECredentialARN, b.ko.Spec.TDECredentialARN) {
		delta.Add("Spec.TDECredentialARN", a.ko.Spec.TDECredentialARN, b.ko.Spec.TDECredentialARN)
	} else if a.ko.Spec.TDECredentialARN != nil && b.ko.Spec.TDECredentialARN != nil {
		if *a.ko.Spec.TDECredentialARN != *b.ko.Spec.TDECredentialARN {
			delta.Add("Spec.TDECredentialARN", a.ko.Spec.TDECredentialARN, b.ko.Spec.TDECredentialARN)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.TDECredentialPassword, b.ko.Spec.TDECredentialPassword) {
		delta.Add("Spec.TDECredentialPassword", a.ko.Spec.TDECredentialPassword, b.ko.Spec.TDECredentialPassword)
	} else if a.ko.Spec.TDECredentialPassword != nil && b.ko.Spec.TDECredentialPassword != nil {
		if *a.ko.Spec.TDECredentialPassword != *b.ko.Spec.TDECredentialPassword {
			delta.Add("Spec.TDECredentialPassword", a.ko.Spec.TDECredentialPassword, b.ko.Spec.TDECredentialPassword)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.Timezone, b.ko.Spec.Timezone) {
		delta.Add("Spec.Timezone", a.ko.Spec.Timezone, b.ko.Spec.Timezone)
	} else if a.ko.Spec.Timezone != nil && b.ko.Spec.Timezone != nil {
		if *a.ko.Spec.Timezone != *b.ko.Spec.Timezone {
			delta.Add("Spec.Timezone", a.ko.Spec.Timezone, b.ko.Spec.Timezone)
		}
	}
	if ackcompare.HasNilDifference(a.ko.Spec.UseDefaultProcessorFeatures, b.ko.Spec.UseDefaultProcessorFeatures) {
		delta.Add("Spec.UseDefaultProcessorFeatures", a.ko.Spec.UseDefaultProcessorFeatures, b.ko.Spec.UseDefaultProcessorFeatures)
	} else if a.ko.Spec.UseDefaultProcessorFeatures != nil && b.ko.Spec.UseDefaultProcessorFeatures != nil {
		if *a.ko.Spec.UseDefaultProcessorFeatures != *b.ko.Spec.UseDefaultProcessorFeatures {
			delta.Add("Spec.UseDefaultProcessorFeatures", a.ko.Spec.UseDefaultProcessorFeatures, b.ko.Spec.UseDefaultProcessorFeatures)
		}
	}
	if len(a.ko.Spec.VPCSecurityGroupIDs) != len(b.ko.Spec.VPCSecurityGroupIDs) {
		delta.Add("Spec.VPCSecurityGroupIDs", a.ko.Spec.VPCSecurityGroupIDs, b.ko.Spec.VPCSecurityGroupIDs)
	} else if len(a.ko.Spec.VPCSecurityGroupIDs) > 0 {
		if !ackcompare.SliceStringPEqual(a.ko.Spec.VPCSecurityGroupIDs, b.ko.Spec.VPCSecurityGroupIDs) {
			delta.Add("Spec.VPCSecurityGroupIDs", a.ko.Spec.VPCSecurityGroupIDs, b.ko.Spec.VPCSecurityGroupIDs)
		}
	}
	if !reflect.DeepEqual(a.ko.Spec.VPCSecurityGroupRefs, b.ko.Spec.VPCSecurityGroupRefs) {
		delta.Add("Spec.VPCSecurityGroupRefs", a.ko.Spec.VPCSecurityGroupRefs, b.ko.Spec.VPCSecurityGroupRefs)
	}

	return delta
}
