-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
Currently the sdk integrates with Jobs API v2. Could you update to v3?
DoD:
- Migrate\implement following endpoints:
- Create Job
- Update Job
- List Jobs
- Get Job
- Authorize A Job
- Add Locale To Job
- Add File To Job
- Check Asynchronous Processing Status For Job
- Some endpoints may handle request async. As result you can receive status code 200 or 202. It's not easy to write multithreaded apps in PHP so i would like to make SDK simple for usage and do all operations synchronously for end-developer. Let me explain by pseudo code
Of course we block execution of entire application but in general you cannot do anything with job until all async operations are completed.
public function addFileToJobSync($jobId, AddFileToJobParameters $parameters) { $result = sendRequest('/jobs-api/v3/projects/{projectId}/jobs/{translationJobUid}/file/add', $parameters); if ($result == 202) { $start_time = time(); do { if ((time() - $start_time) > $tomeout) then throw new SmartlingException(); sleep(5); $result = sendRequest('/jobs-api/v3/projects/{projectId}/jobs/{translationJobUid}/processes/{processUid}'); } while $result; } }
Update implementation of following methods and addSyncsuffix to method names- Add Locale To Job
- Add File To Job