hydroshare / hs_restclient

Python client for the https://www.hydroshare.org REST API
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

updates for 1.20 of hydroshare #102

Closed sblack-usu closed 5 years ago

sblack-usu commented 5 years ago

@zhiyuli - let me know if this meets all your needs. I've let this stretch longer than i should've so I may have missed something.

zhiyuli commented 5 years ago

@sblack-usu Thanks! I will be testing it out today and let me know how it goes.

zhiyuli commented 5 years ago

@sblack-usu I am testing this PR. Here is a running list of potential issues I found

1) hs.createReferencedFile(hs_id, "", "MyRefFile1", "https://www.google.com/")

Returned: {'status': 'success', 'file_id': 18}

The second augument, "path", is required even it is a empty string The function still returns file_id, which is inconsitent with hs.addResourceFile()'s behavior

2) hs.resource(hs_id).files.metadata(file_id, metadata) works for RefFileType only when file_id is provided.

sblack-usu commented 5 years ago

@zhiyuli createReferencedFile is overloaded so you can omit path. https://github.com/hydroshare/hs_restclient/pull/102/files#diff-e1b6c912d4f1fef2100e525f6a870d26R1091