@cotofe/service-of-system
Version:
OpenAPI client for @cotofe/service-of-system
247 lines (246 loc) • 11 kB
JavaScript
"use strict";
/**
* Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StorageControllerApi = void 0;
const runtime = require("../runtime");
/**
*
*/
class StorageControllerApi extends runtime.BaseAPI {
/**
* Create a storage data, datasetName is unique
* create storage data
*/
createUsingPOST2Raw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/storage/create`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters.storageCreateRequest,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* Create a storage data, datasetName is unique
* create storage data
*/
createUsingPOST2() {
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
const response = yield this.createUsingPOST2Raw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Delete a storage data using data id
* delete storage data
*/
deleteUsingPOSTRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/storage/delete`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters.deleteStorageDataRequest,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* Delete a storage data using data id
* delete storage data
*/
deleteUsingPOST() {
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
const response = yield this.deleteUsingPOSTRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Retrieve storage data details using data id
* get details of storage data
*/
getDatasetByIdUsingGETRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.id == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getDatasetByIdUsingGET().');
}
const queryParameters = {};
if (requestParameters.id != null) {
queryParameters.id = requestParameters.id;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/storage/getDatasetById`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* Retrieve storage data details using data id
* get details of storage data
*/
getDatasetByIdUsingGET(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.getDatasetByIdUsingGETRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Retrieve all storage data for the current user, and only return the latest version for data with the same name
* list storage data
*/
listUsingGET2Raw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.pageNum == null) {
throw new runtime.RequiredError('pageNum', 'Required parameter "pageNum" was null or undefined when calling listUsingGET2().');
}
if (requestParameters.pageSize == null) {
throw new runtime.RequiredError('pageSize', 'Required parameter "pageSize" was null or undefined when calling listUsingGET2().');
}
const queryParameters = {};
if (requestParameters.datasetName != null) {
queryParameters.datasetName = requestParameters.datasetName;
}
if (requestParameters.pageNum != null) {
queryParameters.pageNum = requestParameters.pageNum;
}
if (requestParameters.pageSize != null) {
queryParameters.pageSize = requestParameters.pageSize;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/storage/list`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* Retrieve all storage data for the current user, and only return the latest version for data with the same name
* list storage data
*/
listUsingGET2(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.listUsingGET2Raw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Update a storage data: 1. when tags or description or fileName are updating, the data version remains the same 2. when fileSize or or fileUrl are updating, the data version number automatically increases
* update storage data
*/
updateUsingPOSTRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/storage/update`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters.storageUpdateRequest,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* Update a storage data: 1. when tags or description or fileName are updating, the data version remains the same 2. when fileSize or or fileUrl are updating, the data version number automatically increases
* update storage data
*/
updateUsingPOST() {
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
const response = yield this.updateUsingPOSTRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Obtain all version information corresponding to a certain data name
* get storage version list
*/
versionListUsingGET1Raw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
if (requestParameters.datasetName != null) {
queryParameters.datasetName = requestParameters.datasetName;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/storage/version-list`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* Obtain all version information corresponding to a certain data name
* get storage version list
*/
versionListUsingGET1() {
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
const response = yield this.versionListUsingGET1Raw(requestParameters, initOverrides);
return yield response.value();
});
}
}
exports.StorageControllerApi = StorageControllerApi;