func()

in v2/api/sql/v1api20211101/servers_database_types_gen.go [1850:2300]


func (database *ServersDatabase_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.ServersDatabase_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.ServersDatabase_STATUS, got %T", armInput)
	}

	// Set property "AutoPauseDelay":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AutoPauseDelay != nil {
			autoPauseDelay := *typedInput.Properties.AutoPauseDelay
			database.AutoPauseDelay = &autoPauseDelay
		}
	}

	// Set property "CatalogCollation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CatalogCollation != nil {
			var temp string
			temp = string(*typedInput.Properties.CatalogCollation)
			catalogCollation := DatabaseProperties_CatalogCollation_STATUS(temp)
			database.CatalogCollation = &catalogCollation
		}
	}

	// Set property "Collation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Collation != nil {
			collation := *typedInput.Properties.Collation
			database.Collation = &collation
		}
	}

	// no assignment for property "Conditions"

	// Set property "CreateMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreateMode != nil {
			var temp string
			temp = string(*typedInput.Properties.CreateMode)
			createMode := DatabaseProperties_CreateMode_STATUS(temp)
			database.CreateMode = &createMode
		}
	}

	// Set property "CreationDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreationDate != nil {
			creationDate := *typedInput.Properties.CreationDate
			database.CreationDate = &creationDate
		}
	}

	// Set property "CurrentBackupStorageRedundancy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CurrentBackupStorageRedundancy != nil {
			var temp string
			temp = string(*typedInput.Properties.CurrentBackupStorageRedundancy)
			currentBackupStorageRedundancy := DatabaseProperties_CurrentBackupStorageRedundancy_STATUS(temp)
			database.CurrentBackupStorageRedundancy = &currentBackupStorageRedundancy
		}
	}

	// Set property "CurrentServiceObjectiveName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CurrentServiceObjectiveName != nil {
			currentServiceObjectiveName := *typedInput.Properties.CurrentServiceObjectiveName
			database.CurrentServiceObjectiveName = &currentServiceObjectiveName
		}
	}

	// Set property "CurrentSku":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CurrentSku != nil {
			var currentSku1 Sku_STATUS
			err := currentSku1.PopulateFromARM(owner, *typedInput.Properties.CurrentSku)
			if err != nil {
				return err
			}
			currentSku := currentSku1
			database.CurrentSku = &currentSku
		}
	}

	// Set property "DatabaseId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DatabaseId != nil {
			databaseId := *typedInput.Properties.DatabaseId
			database.DatabaseId = &databaseId
		}
	}

	// Set property "DefaultSecondaryLocation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultSecondaryLocation != nil {
			defaultSecondaryLocation := *typedInput.Properties.DefaultSecondaryLocation
			database.DefaultSecondaryLocation = &defaultSecondaryLocation
		}
	}

	// Set property "EarliestRestoreDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EarliestRestoreDate != nil {
			earliestRestoreDate := *typedInput.Properties.EarliestRestoreDate
			database.EarliestRestoreDate = &earliestRestoreDate
		}
	}

	// Set property "ElasticPoolId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ElasticPoolId != nil {
			elasticPoolId := *typedInput.Properties.ElasticPoolId
			database.ElasticPoolId = &elasticPoolId
		}
	}

	// Set property "FailoverGroupId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.FailoverGroupId != nil {
			failoverGroupId := *typedInput.Properties.FailoverGroupId
			database.FailoverGroupId = &failoverGroupId
		}
	}

	// Set property "FederatedClientId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.FederatedClientId != nil {
			federatedClientId := *typedInput.Properties.FederatedClientId
			database.FederatedClientId = &federatedClientId
		}
	}

	// Set property "HighAvailabilityReplicaCount":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HighAvailabilityReplicaCount != nil {
			highAvailabilityReplicaCount := *typedInput.Properties.HighAvailabilityReplicaCount
			database.HighAvailabilityReplicaCount = &highAvailabilityReplicaCount
		}
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		database.Id = &id
	}

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 DatabaseIdentity_STATUS
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		database.Identity = &identity
	}

	// Set property "IsInfraEncryptionEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsInfraEncryptionEnabled != nil {
			isInfraEncryptionEnabled := *typedInput.Properties.IsInfraEncryptionEnabled
			database.IsInfraEncryptionEnabled = &isInfraEncryptionEnabled
		}
	}

	// Set property "IsLedgerOn":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsLedgerOn != nil {
			isLedgerOn := *typedInput.Properties.IsLedgerOn
			database.IsLedgerOn = &isLedgerOn
		}
	}

	// Set property "Kind":
	if typedInput.Kind != nil {
		kind := *typedInput.Kind
		database.Kind = &kind
	}

	// Set property "LicenseType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LicenseType != nil {
			var temp string
			temp = string(*typedInput.Properties.LicenseType)
			licenseType := DatabaseProperties_LicenseType_STATUS(temp)
			database.LicenseType = &licenseType
		}
	}

	// Set property "Location":
	if typedInput.Location != nil {
		location := *typedInput.Location
		database.Location = &location
	}

	// Set property "LongTermRetentionBackupResourceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LongTermRetentionBackupResourceId != nil {
			longTermRetentionBackupResourceId := *typedInput.Properties.LongTermRetentionBackupResourceId
			database.LongTermRetentionBackupResourceId = &longTermRetentionBackupResourceId
		}
	}

	// Set property "MaintenanceConfigurationId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaintenanceConfigurationId != nil {
			maintenanceConfigurationId := *typedInput.Properties.MaintenanceConfigurationId
			database.MaintenanceConfigurationId = &maintenanceConfigurationId
		}
	}

	// Set property "ManagedBy":
	if typedInput.ManagedBy != nil {
		managedBy := *typedInput.ManagedBy
		database.ManagedBy = &managedBy
	}

	// Set property "MaxLogSizeBytes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaxLogSizeBytes != nil {
			maxLogSizeBytes := *typedInput.Properties.MaxLogSizeBytes
			database.MaxLogSizeBytes = &maxLogSizeBytes
		}
	}

	// Set property "MaxSizeBytes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaxSizeBytes != nil {
			maxSizeBytes := *typedInput.Properties.MaxSizeBytes
			database.MaxSizeBytes = &maxSizeBytes
		}
	}

	// Set property "MinCapacity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MinCapacity != nil {
			minCapacity := *typedInput.Properties.MinCapacity
			database.MinCapacity = &minCapacity
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		database.Name = &name
	}

	// Set property "PausedDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PausedDate != nil {
			pausedDate := *typedInput.Properties.PausedDate
			database.PausedDate = &pausedDate
		}
	}

	// Set property "ReadScale":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReadScale != nil {
			var temp string
			temp = string(*typedInput.Properties.ReadScale)
			readScale := DatabaseProperties_ReadScale_STATUS(temp)
			database.ReadScale = &readScale
		}
	}

	// Set property "RecoverableDatabaseId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RecoverableDatabaseId != nil {
			recoverableDatabaseId := *typedInput.Properties.RecoverableDatabaseId
			database.RecoverableDatabaseId = &recoverableDatabaseId
		}
	}

	// Set property "RecoveryServicesRecoveryPointId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RecoveryServicesRecoveryPointId != nil {
			recoveryServicesRecoveryPointId := *typedInput.Properties.RecoveryServicesRecoveryPointId
			database.RecoveryServicesRecoveryPointId = &recoveryServicesRecoveryPointId
		}
	}

	// Set property "RequestedBackupStorageRedundancy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RequestedBackupStorageRedundancy != nil {
			var temp string
			temp = string(*typedInput.Properties.RequestedBackupStorageRedundancy)
			requestedBackupStorageRedundancy := DatabaseProperties_RequestedBackupStorageRedundancy_STATUS(temp)
			database.RequestedBackupStorageRedundancy = &requestedBackupStorageRedundancy
		}
	}

	// Set property "RequestedServiceObjectiveName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RequestedServiceObjectiveName != nil {
			requestedServiceObjectiveName := *typedInput.Properties.RequestedServiceObjectiveName
			database.RequestedServiceObjectiveName = &requestedServiceObjectiveName
		}
	}

	// Set property "RestorableDroppedDatabaseId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestorableDroppedDatabaseId != nil {
			restorableDroppedDatabaseId := *typedInput.Properties.RestorableDroppedDatabaseId
			database.RestorableDroppedDatabaseId = &restorableDroppedDatabaseId
		}
	}

	// Set property "RestorePointInTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestorePointInTime != nil {
			restorePointInTime := *typedInput.Properties.RestorePointInTime
			database.RestorePointInTime = &restorePointInTime
		}
	}

	// Set property "ResumedDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResumedDate != nil {
			resumedDate := *typedInput.Properties.ResumedDate
			database.ResumedDate = &resumedDate
		}
	}

	// Set property "SampleName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SampleName != nil {
			var temp string
			temp = string(*typedInput.Properties.SampleName)
			sampleName := DatabaseProperties_SampleName_STATUS(temp)
			database.SampleName = &sampleName
		}
	}

	// Set property "SecondaryType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SecondaryType != nil {
			var temp string
			temp = string(*typedInput.Properties.SecondaryType)
			secondaryType := DatabaseProperties_SecondaryType_STATUS(temp)
			database.SecondaryType = &secondaryType
		}
	}

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 Sku_STATUS
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		database.Sku = &sku
	}

	// Set property "SourceDatabaseDeletionDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SourceDatabaseDeletionDate != nil {
			sourceDatabaseDeletionDate := *typedInput.Properties.SourceDatabaseDeletionDate
			database.SourceDatabaseDeletionDate = &sourceDatabaseDeletionDate
		}
	}

	// Set property "SourceDatabaseId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SourceDatabaseId != nil {
			sourceDatabaseId := *typedInput.Properties.SourceDatabaseId
			database.SourceDatabaseId = &sourceDatabaseId
		}
	}

	// Set property "SourceResourceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SourceResourceId != nil {
			sourceResourceId := *typedInput.Properties.SourceResourceId
			database.SourceResourceId = &sourceResourceId
		}
	}

	// Set property "Status":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Status != nil {
			var temp string
			temp = string(*typedInput.Properties.Status)
			status := DatabaseProperties_Status_STATUS(temp)
			database.Status = &status
		}
	}

	// Set property "Tags":
	if typedInput.Tags != nil {
		database.Tags = make(map[string]string, len(typedInput.Tags))
		for key, value := range typedInput.Tags {
			database.Tags[key] = value
		}
	}

	// Set property "Type":
	if typedInput.Type != nil {
		typeVar := *typedInput.Type
		database.Type = &typeVar
	}

	// Set property "ZoneRedundant":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ZoneRedundant != nil {
			zoneRedundant := *typedInput.Properties.ZoneRedundant
			database.ZoneRedundant = &zoneRedundant
		}
	}

	// No error
	return nil
}