BingAds / BingAds-Java-SDK

Other
42 stars 48 forks source link

BulkAccount.processMappingsToRowValues(RowValues values) throws java.lang.UnsupportedOperationException #4

Closed Pearl2Jam closed 9 years ago

Pearl2Jam commented 9 years ago

writing BulkEntities with BulkFileWriter works fine for many entities, but not for BulkAccount

Exception in thread "main" java.lang.UnsupportedOperationException at com.microsoft.bingads.bulk.entities.BulkAccount.processMappingsToRowValues(BulkAccount.java:123) at com.microsoft.bingads.internal.bulk.entities.SingleRecordBulkEntity.writeToRowValues(SingleRecordBulkEntity.java:117) at com.microsoft.bingads.internal.bulk.SimpleBulkObjectWriter.writeObjectRow(SimpleBulkObjectWriter.java:88) at com.microsoft.bingads.internal.bulk.entities.SingleRecordBulkEntity.writeToStream(SingleRecordBulkEntity.java:170) at com.microsoft.bingads.bulk.BulkFileWriter.writeEntity(BulkFileWriter.java:58)

dennis-yemelyanov commented 9 years ago

BulkAccount entity is not meant to be uploaded (it just provides read only information about the account), so in current implementation writing it to a file causes an exception. Are you working on a scenario that requires writing it to a file?

Pearl2Jam commented 9 years ago

Hi,

I have tested BulkServiceManager.downloadEntitiesAsync and wanted to do something with the entitys and then write it in a Bulkfile. Now I know, that I could use BulkServiceManager.downloadFileAsync an then use BulkFileReader to do something with the entities. But now I have a similar problem. For manual further processing I want to write only those entities in a bulkfile, which have errors, an want to write also the errors, but unfortunately the BulkFileWriter cannot write Errors. (In this case it also would be fine to write the corresponding Account, including Sync Time)

dennis-yemelyanov commented 9 years ago

Thanks for describing the scenario! We are currently evaluating the possibility of providing an option to write any entity including errors. In the meantime, have you tried setResponseMode(ResponseMode.ERRORS_ONLY) on FileUploadParameters/EntityUploadParameters? That will produce a file that only contains entities with errors, so might help with some of your tasks.

Pearl2Jam commented 9 years ago

Thanks for the hint. But what about errors of already existing items, for example disapproved Ads and Keywords. I think it would be very cool to be able to write down all items I want to. And its in users responsibility not to upload read-only-information.

dennis-yemelyanov commented 9 years ago

You are right, having this flexibility enables many different scenarios. We'll work on supporting this in the upcoming weeks.

dennis-yemelyanov commented 9 years ago

Thanks for the great feedback. Starting from version 9.3.2 all entities can be written to a file, including Account and error rows.