Skip to content

Commit

Permalink
add client.getXliff
Browse files Browse the repository at this point in the history
wip For: IBM-Cloud#118
  • Loading branch information
srl295 committed Mar 12, 2018
1 parent 19733ea commit a9099ac
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,32 @@ class Client {
});
}

/**
* Get XLIFF for this instance
* @param {Object} opts
* @param {String} opts.sourceLanguageId - source ID
* @param {String} [opts.targetLanguageId] - defaults to opts.sourceLanguageId
*
* @param {Function} [cb] - callback (or else will return Promise)
*/
getXliff(opts, cb) {
opts = utils.fixArgs(arguments);
if((cb = arguments[1])) {
return utils.depromise(this.getXliff(opts), cb);
}

opts.serviceInstanceId = opts.serviceInstanceId || this.serviceInstance;
// opts.sourceLanguageId = opts.sourceLanguageId;
opts.targetLanguageId = opts.targetLanguageId || opts.sourceLanguageId;

// this is an odd one because it's not JSON data in return.
// so, we cannot use restCall() (yet!)
// this.restCall("partner.getXliffFromBundles", opts, cb);

return this.gp.swaggerClient
.then(client =>
client.apis.partner.getXliffFromBundles(opts));
}
}
// const debugURL = false;
// const debugREST = false;
Expand Down

0 comments on commit a9099ac

Please sign in to comment.