Updated swagger file to mark dataset name as required within the import api definition
This commit is contained in:
Родитель
a48f86ee34
Коммит
c28616007f
|
@ -154,6 +154,8 @@ Imports.prototype.getImports = function (collectionName, workspaceId, options, c
|
|||
*
|
||||
* @param {string} workspaceId The workspace id
|
||||
*
|
||||
* @param {string} datasetDisplayName The display name of the dataset
|
||||
*
|
||||
* @param {object} importInfo The import to post
|
||||
*
|
||||
* @param {string} [importInfo.filePath] The file path to import
|
||||
|
@ -162,8 +164,6 @@ Imports.prototype.getImports = function (collectionName, workspaceId, options, c
|
|||
*
|
||||
* @param {object} [options] Optional Parameters.
|
||||
*
|
||||
* @param {string} [options.datasetDisplayName] The display name of the dataset
|
||||
*
|
||||
* @param {string} [options.nameConflict] Determines what to do if a dataset
|
||||
* with the same name already exists
|
||||
*
|
||||
|
@ -183,7 +183,7 @@ Imports.prototype.getImports = function (collectionName, workspaceId, options, c
|
|||
*
|
||||
* {stream} [response] - The HTTP Response stream if an error did not occur.
|
||||
*/
|
||||
Imports.prototype.postImport = function (collectionName, workspaceId, importInfo, options, callback) {
|
||||
Imports.prototype.postImport = function (collectionName, workspaceId, datasetDisplayName, importInfo, options, callback) {
|
||||
var client = this.client;
|
||||
if(!callback && typeof options === 'function') {
|
||||
callback = options;
|
||||
|
@ -192,7 +192,6 @@ Imports.prototype.postImport = function (collectionName, workspaceId, importInfo
|
|||
if (!callback) {
|
||||
throw new Error('callback cannot be null.');
|
||||
}
|
||||
var datasetDisplayName = (options && options.datasetDisplayName !== undefined) ? options.datasetDisplayName : undefined;
|
||||
var nameConflict = (options && options.nameConflict !== undefined) ? options.nameConflict : undefined;
|
||||
// Validate
|
||||
try {
|
||||
|
@ -202,8 +201,8 @@ Imports.prototype.postImport = function (collectionName, workspaceId, importInfo
|
|||
if (workspaceId === null || workspaceId === undefined || typeof workspaceId.valueOf() !== 'string') {
|
||||
throw new Error('workspaceId cannot be null or undefined and it must be of type string.');
|
||||
}
|
||||
if (datasetDisplayName !== null && datasetDisplayName !== undefined && typeof datasetDisplayName.valueOf() !== 'string') {
|
||||
throw new Error('datasetDisplayName must be of type string.');
|
||||
if (datasetDisplayName === null || datasetDisplayName === undefined || typeof datasetDisplayName.valueOf() !== 'string') {
|
||||
throw new Error('datasetDisplayName cannot be null or undefined and it must be of type string.');
|
||||
}
|
||||
if (nameConflict !== null && nameConflict !== undefined && typeof nameConflict.valueOf() !== 'string') {
|
||||
throw new Error('nameConflict must be of type string.');
|
||||
|
@ -221,9 +220,7 @@ Imports.prototype.postImport = function (collectionName, workspaceId, importInfo
|
|||
requestUrl = requestUrl.replace('{collectionName}', encodeURIComponent(collectionName));
|
||||
requestUrl = requestUrl.replace('{workspaceId}', encodeURIComponent(workspaceId));
|
||||
var queryParameters = [];
|
||||
if (datasetDisplayName !== null && datasetDisplayName !== undefined) {
|
||||
queryParameters.push('datasetDisplayName=' + encodeURIComponent(datasetDisplayName));
|
||||
}
|
||||
queryParameters.push('datasetDisplayName=' + encodeURIComponent(datasetDisplayName));
|
||||
if (nameConflict !== null && nameConflict !== undefined) {
|
||||
queryParameters.push('nameConflict=' + encodeURIComponent(nameConflict));
|
||||
}
|
||||
|
|
|
@ -327,6 +327,8 @@ export interface Imports {
|
|||
*
|
||||
* @param {string} workspaceId The workspace id
|
||||
*
|
||||
* @param {string} datasetDisplayName The display name of the dataset
|
||||
*
|
||||
* @param {object} importInfo The import to post
|
||||
*
|
||||
* @param {string} [importInfo.filePath] The file path to import
|
||||
|
@ -335,8 +337,6 @@ export interface Imports {
|
|||
*
|
||||
* @param {object} [options] Optional Parameters.
|
||||
*
|
||||
* @param {string} [options.datasetDisplayName] The display name of the dataset
|
||||
*
|
||||
* @param {string} [options.nameConflict] Determines what to do if a dataset
|
||||
* with the same name already exists
|
||||
*
|
||||
|
@ -346,8 +346,8 @@ export interface Imports {
|
|||
* @param {ServiceCallback} [callback] callback function; see ServiceCallback
|
||||
* doc in ms-rest index.d.ts for details
|
||||
*/
|
||||
postImport(collectionName: string, workspaceId: string, importInfo: models.ImportInfo, options: { datasetDisplayName? : string, nameConflict? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.ImportModel>): void;
|
||||
postImport(collectionName: string, workspaceId: string, importInfo: models.ImportInfo, callback: ServiceCallback<models.ImportModel>): void;
|
||||
postImport(collectionName: string, workspaceId: string, datasetDisplayName: string, importInfo: models.ImportInfo, options: { nameConflict? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.ImportModel>): void;
|
||||
postImport(collectionName: string, workspaceId: string, datasetDisplayName: string, importInfo: models.ImportInfo, callback: ServiceCallback<models.ImportModel>): void;
|
||||
|
||||
/**
|
||||
* @summary Gets the import metadata for the specifed import id
|
||||
|
|
|
@ -665,7 +665,7 @@
|
|||
{
|
||||
"name": "datasetDisplayName",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"required": true,
|
||||
"description": "The display name of the dataset",
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"ambientDependencies": {
|
||||
"node": "registry:dt/node#4.0.0+20160412142033"
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче