ropenscilabs / deposits

R Client for access to multiple data repository services
https://docs.ropensci.org/deposits/
Other
38 stars 3 forks source link

Expose Zenodo "prereserve_doi" parameter #72

Closed mpadge closed 1 year ago

mpadge commented 1 year ago

This is necessary for #71, and currently not exposed so unable to be used. Options are:

  1. Expose an additional parameter on client construction;
  2. Expose an additional client method.
  3. Include it as an additional, non-DCMI-compliant "metadata" item which is only translated for Zenodo;
  4. Expose an additional "service_parameters" parameter which accepts a metadata-like list of parameters which can be used to control aspects of service interfaces like this.

The fourth option seems the best. It would likely best be implemented like "metadata", through allowing values to be passed on client construction, and also exposing an additional method, deposit_fill_service_parameters().

mpadge commented 1 year ago

All functionality documented in test-service-params.R file. Note that the only parameter currently implemented, "prereserve_doi" for Zenodo, isn't even actually necessary as it is TRUE by default it seems. Nevertheless, this general functionality is likely to be useful in future developments, and even in current form ensures that deposits will remain robust to any changes which may be implemented on the Zenodo side. With that, good to close here.

mpadge commented 1 year ago

Re-opening to connect this to the Figshare private_article_reserve_doi method. Passing this parameter should then also trigger that method, so that a DOI is returned which can then be inserted in the metadata "identifer" field #75.

mpadge commented 1 year ago

Actaully, this method should be deleted because the interfaces are so different for Zenodo and Figshare. An easier solution will be to have a single "prereserve_doi" parameter in the deposit_new() method which is simply set to TRUE for Zenodo, and for Figshare calls the additional prereseve API method after construction.

This generic interface can then later be restored for other "service_parameters" if desired.

mpadge commented 1 year ago

Actually, should also implement a method to allow figshare clients to call prereserve any time after initial client construction.

mpadge commented 1 year ago

Closing this now, but maybe have to revisit later to active a method for Zenodo in case deposit is iniated with prereserve_doi = FALSE.