OAPI: tweak the JS generator to do more what we want

This commit is contained in:
Sybren A. Stüvel 2022-04-04 19:32:23 +02:00
parent 2b1e6c54a8
commit 5e5fa57fa4
24 changed files with 7382 additions and 196 deletions

View File

@ -67,25 +67,32 @@ generate-js:
# See https://openapi-generator.tech/docs/generators/javascript for the options.
# Version '0.0.0' is used as NPM doesn't like Git hashes as versions.
#
# -p modelPropertyNaming=original is needed because otherwise the generator will
# use original naming internally, but generate docs with camelCase, and then
# things don't work properly.
java -jar addon/openapi-generator-cli.jar \
generate \
-i pkg/api/flamenco-manager.yaml \
-g javascript \
-o web/manager-api \
--http-user-agent "Flamenco/${VERSION} / webbrowser" \
-p generateSourceCodeOnly=true \
-p projectName=flamenco-manager \
-p projectVersion="0.0.0" \
-p apiPackage="${JS_API_PKG_NAME}" \
-p disallowAdditionalPropertiesIfNotPresent=false \
-p usePromises=true \
-p moduleName=flamencoManager
-p moduleName=flamencoManager \
-p modelPropertyNaming=original
# The generator outputs files so that we can write our own tests. We don't,
# though, so it's better to just remove those placeholders.
rm -rf web/manager-api/test
# Ensure that the API package can actually be imported by the webapp (if
# symlinks are in place).
cd web/manager-api && npm install && npm run build
version:
@echo "OS : ${OS}"
@echo "Package: ${PKG}"

View File

@ -22,12 +22,16 @@ console.log("Flamenco API:", flamencoAPIURL);
console.log("Websocket :", websocketURL);
let flamencoManager = require('flamenco-manager');
let apiClient = new flamencoManager.ApiClient(flamencoAPIURL);
var api = new flamencoManager.JobsApi(apiClient);
var jobId = "07d134bc-0614-4477-9b1f-e238f0f0391a";
api.fetchJob(jobId).then(function(data) {
console.log('API called successfully. Returned data: ', data);
let query = new flamencoManager.JobsQuery();
// query.status_in = ["active"];
query.metadata = {project: "Heist"};
let JobsApi = new flamencoManager.JobsApi(apiClient);
JobsApi.queryJobs(query).then(function(data) {
console.log('API called successfully.');
console.log(data);
}, function(error) {
console.error(error);
});

View File

@ -103,8 +103,8 @@ var flamencoManager = require('flamenco-manager');
var api = new flamencoManager.JobsApi()
var jobId = "jobId_example"; // {String}
api.fetchJob(jobId).then(function(data) {
var job_id = "job_id_example"; // {String}
api.fetchJob(job_id).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);

View File

@ -9,9 +9,9 @@ Name | Type | Description | Notes
**name** | **String** | |
**status** | [**TaskStatus**](TaskStatus.md) | |
**priority** | **Number** | |
**jobPriority** | **Number** | |
**jobType** | **String** | |
**taskType** | **String** | |
**job_priority** | **Number** | |
**job_type** | **String** | |
**task_type** | **String** | |
**commands** | [**[Command]**](Command.md) | |

View File

@ -4,6 +4,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**jobTypes** | [**[AvailableJobType]**](AvailableJobType.md) | |
**job_types** | [**[AvailableJobType]**](AvailableJobType.md) | |

View File

@ -13,7 +13,7 @@ Method | HTTP request | Description
## fetchJob
> Job fetchJob(jobId)
> Job fetchJob(job_id)
Fetch info about the job.
@ -23,8 +23,8 @@ Fetch info about the job.
import flamencoManager from 'flamenco-manager';
let apiInstance = new flamencoManager.JobsApi();
let jobId = "jobId_example"; // String |
apiInstance.fetchJob(jobId).then((data) => {
let job_id = "job_id_example"; // String |
apiInstance.fetchJob(job_id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -37,7 +37,7 @@ apiInstance.fetchJob(jobId).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**jobId** | **String**| |
**job_id** | **String**| |
### Return type
@ -93,7 +93,7 @@ No authorization required
## queryJobs
> JobsQueryResult queryJobs(jobsQuery)
> JobsQueryResult queryJobs(JobsQuery)
Fetch list of jobs.
@ -103,8 +103,8 @@ Fetch list of jobs.
import flamencoManager from 'flamenco-manager';
let apiInstance = new flamencoManager.JobsApi();
let jobsQuery = new flamencoManager.JobsQuery(); // JobsQuery | Specification of which jobs to get.
apiInstance.queryJobs(jobsQuery).then((data) => {
let JobsQuery = new flamencoManager.JobsQuery(); // JobsQuery | Specification of which jobs to get.
apiInstance.queryJobs(JobsQuery).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -117,7 +117,7 @@ apiInstance.queryJobs(jobsQuery).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**jobsQuery** | [**JobsQuery**](JobsQuery.md)| Specification of which jobs to get. |
**JobsQuery** | [**JobsQuery**](JobsQuery.md)| Specification of which jobs to get. |
### Return type
@ -135,7 +135,7 @@ No authorization required
## submitJob
> Job submitJob(submittedJob)
> Job submitJob(SubmittedJob)
Submit a new job for Flamenco Manager to execute.
@ -145,8 +145,8 @@ Submit a new job for Flamenco Manager to execute.
import flamencoManager from 'flamenco-manager';
let apiInstance = new flamencoManager.JobsApi();
let submittedJob = new flamencoManager.SubmittedJob(); // SubmittedJob | Job to submit
apiInstance.submitJob(submittedJob).then((data) => {
let SubmittedJob = new flamencoManager.SubmittedJob(); // SubmittedJob | Job to submit
apiInstance.submitJob(SubmittedJob).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -159,7 +159,7 @@ apiInstance.submitJob(submittedJob).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**submittedJob** | [**SubmittedJob**](SubmittedJob.md)| Job to submit |
**SubmittedJob** | [**SubmittedJob**](SubmittedJob.md)| Job to submit |
### Return type

View File

@ -6,8 +6,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**offset** | **Number** | | [optional]
**limit** | **Number** | | [optional]
**orderBy** | **[String]** | | [optional]
**statusIn** | [**[JobStatus]**](JobStatus.md) | Return only jobs with a status in this array. | [optional]
**order_by** | **[String]** | | [optional]
**status_in** | [**[JobStatus]**](JobStatus.md) | Return only jobs with a status in this array. | [optional]
**metadata** | **{String: String}** | Filter by metadata, using `LIKE` notation. | [optional]
**settings** | **{String: Object}** | Filter by job settings, using `LIKE` notation. | [optional]

View File

@ -9,8 +9,8 @@ Name | Type | Description | Notes
**address** | **String** | |
**status** | [**WorkerStatus**](WorkerStatus.md) | |
**platform** | **String** | |
**lastActivity** | **String** | |
**last_activity** | **String** | |
**software** | **String** | |
**supportedTaskTypes** | **[String]** | |
**supported_task_types** | **[String]** | |

View File

@ -13,7 +13,7 @@ Method | HTTP request | Description
## shamanCheckout
> ShamanCheckoutResult shamanCheckout(shamanCheckout)
> ShamanCheckoutResult shamanCheckout(ShamanCheckout)
Create a directory, and symlink the required files into it. The files must all have been uploaded to Shaman before calling this endpoint.
@ -23,8 +23,8 @@ Create a directory, and symlink the required files into it. The files must all h
import flamencoManager from 'flamenco-manager';
let apiInstance = new flamencoManager.ShamanApi();
let shamanCheckout = new flamencoManager.ShamanCheckout(); // ShamanCheckout | Set of files to check out.
apiInstance.shamanCheckout(shamanCheckout).then((data) => {
let ShamanCheckout = new flamencoManager.ShamanCheckout(); // ShamanCheckout | Set of files to check out.
apiInstance.shamanCheckout(ShamanCheckout).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -37,7 +37,7 @@ apiInstance.shamanCheckout(shamanCheckout).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**shamanCheckout** | [**ShamanCheckout**](ShamanCheckout.md)| Set of files to check out. |
**ShamanCheckout** | [**ShamanCheckout**](ShamanCheckout.md)| Set of files to check out. |
### Return type
@ -55,7 +55,7 @@ No authorization required
## shamanCheckoutRequirements
> ShamanRequirementsResponse shamanCheckoutRequirements(shamanRequirementsRequest)
> ShamanRequirementsResponse shamanCheckoutRequirements(ShamanRequirementsRequest)
Checks a Shaman Requirements file, and reports which files are unknown.
@ -65,8 +65,8 @@ Checks a Shaman Requirements file, and reports which files are unknown.
import flamencoManager from 'flamenco-manager';
let apiInstance = new flamencoManager.ShamanApi();
let shamanRequirementsRequest = new flamencoManager.ShamanRequirementsRequest(); // ShamanRequirementsRequest | Set of files to check
apiInstance.shamanCheckoutRequirements(shamanRequirementsRequest).then((data) => {
let ShamanRequirementsRequest = new flamencoManager.ShamanRequirementsRequest(); // ShamanRequirementsRequest | Set of files to check
apiInstance.shamanCheckoutRequirements(ShamanRequirementsRequest).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -79,7 +79,7 @@ apiInstance.shamanCheckoutRequirements(shamanRequirementsRequest).then((data) =>
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**shamanRequirementsRequest** | [**ShamanRequirementsRequest**](ShamanRequirementsRequest.md)| Set of files to check |
**ShamanRequirementsRequest** | [**ShamanRequirementsRequest**](ShamanRequirementsRequest.md)| Set of files to check |
### Return type
@ -111,8 +111,8 @@ let checksum = "checksum_example"; // String | SHA256 checksum of the file.
let filesize = 56; // Number | Size of the file in bytes.
let body = "/path/to/file"; // File | Contents of the file
let opts = {
'xShamanCanDeferUpload': true, // Boolean | The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file.
'xShamanOriginalFilename': "xShamanOriginalFilename_example" // String | The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging.
'X_Shaman_Can_Defer_Upload': true, // Boolean | The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file.
'X_Shaman_Original_Filename': "X_Shaman_Original_Filename_example" // String | The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging.
};
apiInstance.shamanFileStore(checksum, filesize, body, opts).then(() => {
console.log('API called successfully.');
@ -130,8 +130,8 @@ Name | Type | Description | Notes
**checksum** | **String**| SHA256 checksum of the file. |
**filesize** | **Number**| Size of the file in bytes. |
**body** | **File**| Contents of the file |
**xShamanCanDeferUpload** | **Boolean**| The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file. | [optional]
**xShamanOriginalFilename** | **String**| The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging. | [optional]
**X_Shaman_Can_Defer_Upload** | **Boolean**| The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file. | [optional]
**X_Shaman_Original_Filename** | **String**| The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging. | [optional]
### Return type

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
## registerWorker
> RegisteredWorker registerWorker(workerRegistration)
> RegisteredWorker registerWorker(WorkerRegistration)
Register a new worker
@ -26,8 +26,8 @@ Register a new worker
import flamencoManager from 'flamenco-manager';
let apiInstance = new flamencoManager.WorkerApi();
let workerRegistration = new flamencoManager.WorkerRegistration(); // WorkerRegistration | Worker to register
apiInstance.registerWorker(workerRegistration).then((data) => {
let WorkerRegistration = new flamencoManager.WorkerRegistration(); // WorkerRegistration | Worker to register
apiInstance.registerWorker(WorkerRegistration).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -40,7 +40,7 @@ apiInstance.registerWorker(workerRegistration).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**workerRegistration** | [**WorkerRegistration**](WorkerRegistration.md)| Worker to register |
**WorkerRegistration** | [**WorkerRegistration**](WorkerRegistration.md)| Worker to register |
### Return type
@ -144,7 +144,7 @@ null (empty response body)
## signOn
> WorkerStateChange signOn(workerSignOn)
> WorkerStateChange signOn(WorkerSignOn)
Authenticate & sign in the worker.
@ -159,8 +159,8 @@ worker_auth.username = 'YOUR USERNAME';
worker_auth.password = 'YOUR PASSWORD';
let apiInstance = new flamencoManager.WorkerApi();
let workerSignOn = new flamencoManager.WorkerSignOn(); // WorkerSignOn | Worker metadata
apiInstance.signOn(workerSignOn).then((data) => {
let WorkerSignOn = new flamencoManager.WorkerSignOn(); // WorkerSignOn | Worker metadata
apiInstance.signOn(WorkerSignOn).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -173,7 +173,7 @@ apiInstance.signOn(workerSignOn).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**workerSignOn** | [**WorkerSignOn**](WorkerSignOn.md)| Worker metadata |
**WorkerSignOn** | [**WorkerSignOn**](WorkerSignOn.md)| Worker metadata |
### Return type
@ -191,7 +191,7 @@ Name | Type | Description | Notes
## taskUpdate
> taskUpdate(taskId, taskUpdate)
> taskUpdate(task_id, TaskUpdate)
Update the task, typically to indicate progress, completion, or failure.
@ -206,9 +206,9 @@ worker_auth.username = 'YOUR USERNAME';
worker_auth.password = 'YOUR PASSWORD';
let apiInstance = new flamencoManager.WorkerApi();
let taskId = "taskId_example"; // String |
let taskUpdate = new flamencoManager.TaskUpdate(); // TaskUpdate | Task update information
apiInstance.taskUpdate(taskId, taskUpdate).then(() => {
let task_id = "task_id_example"; // String |
let TaskUpdate = new flamencoManager.TaskUpdate(); // TaskUpdate | Task update information
apiInstance.taskUpdate(task_id, TaskUpdate).then(() => {
console.log('API called successfully.');
}, (error) => {
console.error(error);
@ -221,8 +221,8 @@ apiInstance.taskUpdate(taskId, taskUpdate).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**taskId** | **String**| |
**taskUpdate** | [**TaskUpdate**](TaskUpdate.md)| Task update information |
**task_id** | **String**| |
**TaskUpdate** | [**TaskUpdate**](TaskUpdate.md)| Task update information |
### Return type
@ -283,7 +283,7 @@ This endpoint does not need any parameter.
## workerStateChanged
> workerStateChanged(workerStateChanged)
> workerStateChanged(WorkerStateChanged)
Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
@ -298,8 +298,8 @@ worker_auth.username = 'YOUR USERNAME';
worker_auth.password = 'YOUR PASSWORD';
let apiInstance = new flamencoManager.WorkerApi();
let workerStateChanged = new flamencoManager.WorkerStateChanged(); // WorkerStateChanged | New worker state
apiInstance.workerStateChanged(workerStateChanged).then(() => {
let WorkerStateChanged = new flamencoManager.WorkerStateChanged(); // WorkerStateChanged | New worker state
apiInstance.workerStateChanged(WorkerStateChanged).then(() => {
console.log('API called successfully.');
}, (error) => {
console.error(error);
@ -312,7 +312,7 @@ apiInstance.workerStateChanged(workerStateChanged).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**workerStateChanged** | [**WorkerStateChanged**](WorkerStateChanged.md)| New worker state |
**WorkerStateChanged** | [**WorkerStateChanged**](WorkerStateChanged.md)| New worker state |
### Return type

View File

@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**secret** | **String** | |
**platform** | **String** | |
**supportedTaskTypes** | **[String]** | |
**supported_task_types** | **[String]** | |
**nickname** | **String** | |

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**nickname** | **String** | |
**supportedTaskTypes** | **[String]** | |
**softwareVersion** | **String** | |
**supported_task_types** | **[String]** | |
**software_version** | **String** | |

View File

@ -4,6 +4,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**statusRequested** | [**WorkerStatus**](WorkerStatus.md) | |
**status_requested** | [**WorkerStatus**](WorkerStatus.md) | |

7175
web/manager-api/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -55,7 +55,7 @@ class ApiClient {
* @default {}
*/
this.defaultHeaders = {
'User-Agent': 'Flamenco/781f1d93-dirty / webbrowser'
'User-Agent': 'Flamenco/c00cf8b0-dirty / webbrowser'
};
/**

View File

@ -42,18 +42,18 @@ export default class JobsApi {
/**
* Fetch info about the job.
* @param {String} jobId
* @param {String} job_id
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Job} and HTTP response
*/
fetchJobWithHttpInfo(jobId) {
fetchJobWithHttpInfo(job_id) {
let postBody = null;
// verify the required parameter 'jobId' is set
if (jobId === undefined || jobId === null) {
throw new Error("Missing the required parameter 'jobId' when calling fetchJob");
// verify the required parameter 'job_id' is set
if (job_id === undefined || job_id === null) {
throw new Error("Missing the required parameter 'job_id' when calling fetchJob");
}
let pathParams = {
'job_id': jobId
'job_id': job_id
};
let queryParams = {
};
@ -75,11 +75,11 @@ export default class JobsApi {
/**
* Fetch info about the job.
* @param {String} jobId
* @param {String} job_id
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Job}
*/
fetchJob(jobId) {
return this.fetchJobWithHttpInfo(jobId)
fetchJob(job_id) {
return this.fetchJobWithHttpInfo(job_id)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -127,14 +127,14 @@ export default class JobsApi {
/**
* Fetch list of jobs.
* @param {module:model/JobsQuery} jobsQuery Specification of which jobs to get.
* @param {module:model/JobsQuery} JobsQuery Specification of which jobs to get.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/JobsQueryResult} and HTTP response
*/
queryJobsWithHttpInfo(jobsQuery) {
let postBody = jobsQuery;
// verify the required parameter 'jobsQuery' is set
if (jobsQuery === undefined || jobsQuery === null) {
throw new Error("Missing the required parameter 'jobsQuery' when calling queryJobs");
queryJobsWithHttpInfo(JobsQuery) {
let postBody = JobsQuery;
// verify the required parameter 'JobsQuery' is set
if (JobsQuery === undefined || JobsQuery === null) {
throw new Error("Missing the required parameter 'JobsQuery' when calling queryJobs");
}
let pathParams = {
@ -159,11 +159,11 @@ export default class JobsApi {
/**
* Fetch list of jobs.
* @param {module:model/JobsQuery} jobsQuery Specification of which jobs to get.
* @param {module:model/JobsQuery} JobsQuery Specification of which jobs to get.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/JobsQueryResult}
*/
queryJobs(jobsQuery) {
return this.queryJobsWithHttpInfo(jobsQuery)
queryJobs(JobsQuery) {
return this.queryJobsWithHttpInfo(JobsQuery)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -172,14 +172,14 @@ export default class JobsApi {
/**
* Submit a new job for Flamenco Manager to execute.
* @param {module:model/SubmittedJob} submittedJob Job to submit
* @param {module:model/SubmittedJob} SubmittedJob Job to submit
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Job} and HTTP response
*/
submitJobWithHttpInfo(submittedJob) {
let postBody = submittedJob;
// verify the required parameter 'submittedJob' is set
if (submittedJob === undefined || submittedJob === null) {
throw new Error("Missing the required parameter 'submittedJob' when calling submitJob");
submitJobWithHttpInfo(SubmittedJob) {
let postBody = SubmittedJob;
// verify the required parameter 'SubmittedJob' is set
if (SubmittedJob === undefined || SubmittedJob === null) {
throw new Error("Missing the required parameter 'SubmittedJob' when calling submitJob");
}
let pathParams = {
@ -204,11 +204,11 @@ export default class JobsApi {
/**
* Submit a new job for Flamenco Manager to execute.
* @param {module:model/SubmittedJob} submittedJob Job to submit
* @param {module:model/SubmittedJob} SubmittedJob Job to submit
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Job}
*/
submitJob(submittedJob) {
return this.submitJobWithHttpInfo(submittedJob)
submitJob(SubmittedJob) {
return this.submitJobWithHttpInfo(SubmittedJob)
.then(function(response_and_data) {
return response_and_data.data;
});

View File

@ -42,14 +42,14 @@ export default class ShamanApi {
/**
* Create a directory, and symlink the required files into it. The files must all have been uploaded to Shaman before calling this endpoint.
* @param {module:model/ShamanCheckout} shamanCheckout Set of files to check out.
* @param {module:model/ShamanCheckout} ShamanCheckout Set of files to check out.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ShamanCheckoutResult} and HTTP response
*/
shamanCheckoutWithHttpInfo(shamanCheckout) {
let postBody = shamanCheckout;
// verify the required parameter 'shamanCheckout' is set
if (shamanCheckout === undefined || shamanCheckout === null) {
throw new Error("Missing the required parameter 'shamanCheckout' when calling shamanCheckout");
shamanCheckoutWithHttpInfo(ShamanCheckout) {
let postBody = ShamanCheckout;
// verify the required parameter 'ShamanCheckout' is set
if (ShamanCheckout === undefined || ShamanCheckout === null) {
throw new Error("Missing the required parameter 'ShamanCheckout' when calling shamanCheckout");
}
let pathParams = {
@ -74,11 +74,11 @@ export default class ShamanApi {
/**
* Create a directory, and symlink the required files into it. The files must all have been uploaded to Shaman before calling this endpoint.
* @param {module:model/ShamanCheckout} shamanCheckout Set of files to check out.
* @param {module:model/ShamanCheckout} ShamanCheckout Set of files to check out.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ShamanCheckoutResult}
*/
shamanCheckout(shamanCheckout) {
return this.shamanCheckoutWithHttpInfo(shamanCheckout)
shamanCheckout(ShamanCheckout) {
return this.shamanCheckoutWithHttpInfo(ShamanCheckout)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -87,14 +87,14 @@ export default class ShamanApi {
/**
* Checks a Shaman Requirements file, and reports which files are unknown.
* @param {module:model/ShamanRequirementsRequest} shamanRequirementsRequest Set of files to check
* @param {module:model/ShamanRequirementsRequest} ShamanRequirementsRequest Set of files to check
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ShamanRequirementsResponse} and HTTP response
*/
shamanCheckoutRequirementsWithHttpInfo(shamanRequirementsRequest) {
let postBody = shamanRequirementsRequest;
// verify the required parameter 'shamanRequirementsRequest' is set
if (shamanRequirementsRequest === undefined || shamanRequirementsRequest === null) {
throw new Error("Missing the required parameter 'shamanRequirementsRequest' when calling shamanCheckoutRequirements");
shamanCheckoutRequirementsWithHttpInfo(ShamanRequirementsRequest) {
let postBody = ShamanRequirementsRequest;
// verify the required parameter 'ShamanRequirementsRequest' is set
if (ShamanRequirementsRequest === undefined || ShamanRequirementsRequest === null) {
throw new Error("Missing the required parameter 'ShamanRequirementsRequest' when calling shamanCheckoutRequirements");
}
let pathParams = {
@ -119,11 +119,11 @@ export default class ShamanApi {
/**
* Checks a Shaman Requirements file, and reports which files are unknown.
* @param {module:model/ShamanRequirementsRequest} shamanRequirementsRequest Set of files to check
* @param {module:model/ShamanRequirementsRequest} ShamanRequirementsRequest Set of files to check
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ShamanRequirementsResponse}
*/
shamanCheckoutRequirements(shamanRequirementsRequest) {
return this.shamanCheckoutRequirementsWithHttpInfo(shamanRequirementsRequest)
shamanCheckoutRequirements(ShamanRequirementsRequest) {
return this.shamanCheckoutRequirementsWithHttpInfo(ShamanRequirementsRequest)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -136,8 +136,8 @@ export default class ShamanApi {
* @param {Number} filesize Size of the file in bytes.
* @param {File} body Contents of the file
* @param {Object} opts Optional parameters
* @param {Boolean} opts.xShamanCanDeferUpload The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file.
* @param {String} opts.xShamanOriginalFilename The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging.
* @param {Boolean} opts.X_Shaman_Can_Defer_Upload The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file.
* @param {String} opts.X_Shaman_Original_Filename The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
shamanFileStoreWithHttpInfo(checksum, filesize, body, opts) {
@ -163,8 +163,8 @@ export default class ShamanApi {
let queryParams = {
};
let headerParams = {
'X-Shaman-Can-Defer-Upload': opts['xShamanCanDeferUpload'],
'X-Shaman-Original-Filename': opts['xShamanOriginalFilename']
'X-Shaman-Can-Defer-Upload': opts['X_Shaman_Can_Defer_Upload'],
'X-Shaman-Original-Filename': opts['X_Shaman_Original_Filename']
};
let formParams = {
};
@ -186,8 +186,8 @@ export default class ShamanApi {
* @param {Number} filesize Size of the file in bytes.
* @param {File} body Contents of the file
* @param {Object} opts Optional parameters
* @param {Boolean} opts.xShamanCanDeferUpload The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file.
* @param {String} opts.xShamanOriginalFilename The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging.
* @param {Boolean} opts.X_Shaman_Can_Defer_Upload The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file.
* @param {String} opts.X_Shaman_Original_Filename The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
shamanFileStore(checksum, filesize, body, opts) {

View File

@ -45,14 +45,14 @@ export default class WorkerApi {
/**
* Register a new worker
* @param {module:model/WorkerRegistration} workerRegistration Worker to register
* @param {module:model/WorkerRegistration} WorkerRegistration Worker to register
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RegisteredWorker} and HTTP response
*/
registerWorkerWithHttpInfo(workerRegistration) {
let postBody = workerRegistration;
// verify the required parameter 'workerRegistration' is set
if (workerRegistration === undefined || workerRegistration === null) {
throw new Error("Missing the required parameter 'workerRegistration' when calling registerWorker");
registerWorkerWithHttpInfo(WorkerRegistration) {
let postBody = WorkerRegistration;
// verify the required parameter 'WorkerRegistration' is set
if (WorkerRegistration === undefined || WorkerRegistration === null) {
throw new Error("Missing the required parameter 'WorkerRegistration' when calling registerWorker");
}
let pathParams = {
@ -77,11 +77,11 @@ export default class WorkerApi {
/**
* Register a new worker
* @param {module:model/WorkerRegistration} workerRegistration Worker to register
* @param {module:model/WorkerRegistration} WorkerRegistration Worker to register
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RegisteredWorker}
*/
registerWorker(workerRegistration) {
return this.registerWorkerWithHttpInfo(workerRegistration)
registerWorker(WorkerRegistration) {
return this.registerWorkerWithHttpInfo(WorkerRegistration)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -168,14 +168,14 @@ export default class WorkerApi {
/**
* Authenticate & sign in the worker.
* @param {module:model/WorkerSignOn} workerSignOn Worker metadata
* @param {module:model/WorkerSignOn} WorkerSignOn Worker metadata
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WorkerStateChange} and HTTP response
*/
signOnWithHttpInfo(workerSignOn) {
let postBody = workerSignOn;
// verify the required parameter 'workerSignOn' is set
if (workerSignOn === undefined || workerSignOn === null) {
throw new Error("Missing the required parameter 'workerSignOn' when calling signOn");
signOnWithHttpInfo(WorkerSignOn) {
let postBody = WorkerSignOn;
// verify the required parameter 'WorkerSignOn' is set
if (WorkerSignOn === undefined || WorkerSignOn === null) {
throw new Error("Missing the required parameter 'WorkerSignOn' when calling signOn");
}
let pathParams = {
@ -200,11 +200,11 @@ export default class WorkerApi {
/**
* Authenticate & sign in the worker.
* @param {module:model/WorkerSignOn} workerSignOn Worker metadata
* @param {module:model/WorkerSignOn} WorkerSignOn Worker metadata
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WorkerStateChange}
*/
signOn(workerSignOn) {
return this.signOnWithHttpInfo(workerSignOn)
signOn(WorkerSignOn) {
return this.signOnWithHttpInfo(WorkerSignOn)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -213,23 +213,23 @@ export default class WorkerApi {
/**
* Update the task, typically to indicate progress, completion, or failure.
* @param {String} taskId
* @param {module:model/TaskUpdate} taskUpdate Task update information
* @param {String} task_id
* @param {module:model/TaskUpdate} TaskUpdate Task update information
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
taskUpdateWithHttpInfo(taskId, taskUpdate) {
let postBody = taskUpdate;
// verify the required parameter 'taskId' is set
if (taskId === undefined || taskId === null) {
throw new Error("Missing the required parameter 'taskId' when calling taskUpdate");
taskUpdateWithHttpInfo(task_id, TaskUpdate) {
let postBody = TaskUpdate;
// verify the required parameter 'task_id' is set
if (task_id === undefined || task_id === null) {
throw new Error("Missing the required parameter 'task_id' when calling taskUpdate");
}
// verify the required parameter 'taskUpdate' is set
if (taskUpdate === undefined || taskUpdate === null) {
throw new Error("Missing the required parameter 'taskUpdate' when calling taskUpdate");
// verify the required parameter 'TaskUpdate' is set
if (TaskUpdate === undefined || TaskUpdate === null) {
throw new Error("Missing the required parameter 'TaskUpdate' when calling taskUpdate");
}
let pathParams = {
'task_id': taskId
'task_id': task_id
};
let queryParams = {
};
@ -251,12 +251,12 @@ export default class WorkerApi {
/**
* Update the task, typically to indicate progress, completion, or failure.
* @param {String} taskId
* @param {module:model/TaskUpdate} taskUpdate Task update information
* @param {String} task_id
* @param {module:model/TaskUpdate} TaskUpdate Task update information
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
taskUpdate(taskId, taskUpdate) {
return this.taskUpdateWithHttpInfo(taskId, taskUpdate)
taskUpdate(task_id, TaskUpdate) {
return this.taskUpdateWithHttpInfo(task_id, TaskUpdate)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -302,14 +302,14 @@ export default class WorkerApi {
/**
* Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
* @param {module:model/WorkerStateChanged} workerStateChanged New worker state
* @param {module:model/WorkerStateChanged} WorkerStateChanged New worker state
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
workerStateChangedWithHttpInfo(workerStateChanged) {
let postBody = workerStateChanged;
// verify the required parameter 'workerStateChanged' is set
if (workerStateChanged === undefined || workerStateChanged === null) {
throw new Error("Missing the required parameter 'workerStateChanged' when calling workerStateChanged");
workerStateChangedWithHttpInfo(WorkerStateChanged) {
let postBody = WorkerStateChanged;
// verify the required parameter 'WorkerStateChanged' is set
if (WorkerStateChanged === undefined || WorkerStateChanged === null) {
throw new Error("Missing the required parameter 'WorkerStateChanged' when calling workerStateChanged");
}
let pathParams = {
@ -334,11 +334,11 @@ export default class WorkerApi {
/**
* Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
* @param {module:model/WorkerStateChanged} workerStateChanged New worker state
* @param {module:model/WorkerStateChanged} WorkerStateChanged New worker state
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
workerStateChanged(workerStateChanged) {
return this.workerStateChangedWithHttpInfo(workerStateChanged)
workerStateChanged(WorkerStateChanged) {
return this.workerStateChangedWithHttpInfo(WorkerStateChanged)
.then(function(response_and_data) {
return response_and_data.data;
});

View File

@ -30,14 +30,14 @@ class AssignedTask {
* @param name {String}
* @param status {module:model/TaskStatus}
* @param priority {Number}
* @param jobPriority {Number}
* @param jobType {String}
* @param taskType {String}
* @param job_priority {Number}
* @param job_type {String}
* @param task_type {String}
* @param commands {Array.<module:model/Command>}
*/
constructor(uuid, job, name, status, priority, jobPriority, jobType, taskType, commands) {
constructor(uuid, job, name, status, priority, job_priority, job_type, task_type, commands) {
AssignedTask.initialize(this, uuid, job, name, status, priority, jobPriority, jobType, taskType, commands);
AssignedTask.initialize(this, uuid, job, name, status, priority, job_priority, job_type, task_type, commands);
}
/**
@ -45,15 +45,15 @@ class AssignedTask {
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, uuid, job, name, status, priority, jobPriority, jobType, taskType, commands) {
static initialize(obj, uuid, job, name, status, priority, job_priority, job_type, task_type, commands) {
obj['uuid'] = uuid;
obj['job'] = job;
obj['name'] = name;
obj['status'] = status;
obj['priority'] = priority;
obj['job_priority'] = jobPriority;
obj['job_type'] = jobType;
obj['task_type'] = taskType;
obj['job_priority'] = job_priority;
obj['job_type'] = job_type;
obj['task_type'] = task_type;
obj['commands'] = commands;
}

View File

@ -24,11 +24,11 @@ class AvailableJobTypes {
* Constructs a new <code>AvailableJobTypes</code>.
* List of job types supported by this Manager.
* @alias module:model/AvailableJobTypes
* @param jobTypes {Array.<module:model/AvailableJobType>}
* @param job_types {Array.<module:model/AvailableJobType>}
*/
constructor(jobTypes) {
constructor(job_types) {
AvailableJobTypes.initialize(this, jobTypes);
AvailableJobTypes.initialize(this, job_types);
}
/**
@ -36,8 +36,8 @@ class AvailableJobTypes {
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, jobTypes) {
obj['job_types'] = jobTypes;
static initialize(obj, job_types) {
obj['job_types'] = job_types;
}
/**

View File

@ -28,13 +28,13 @@ class RegisteredWorker {
* @param address {String}
* @param status {module:model/WorkerStatus}
* @param platform {String}
* @param lastActivity {String}
* @param last_activity {String}
* @param software {String}
* @param supportedTaskTypes {Array.<String>}
* @param supported_task_types {Array.<String>}
*/
constructor(uuid, nickname, address, status, platform, lastActivity, software, supportedTaskTypes) {
constructor(uuid, nickname, address, status, platform, last_activity, software, supported_task_types) {
RegisteredWorker.initialize(this, uuid, nickname, address, status, platform, lastActivity, software, supportedTaskTypes);
RegisteredWorker.initialize(this, uuid, nickname, address, status, platform, last_activity, software, supported_task_types);
}
/**
@ -42,15 +42,15 @@ class RegisteredWorker {
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, uuid, nickname, address, status, platform, lastActivity, software, supportedTaskTypes) {
static initialize(obj, uuid, nickname, address, status, platform, last_activity, software, supported_task_types) {
obj['uuid'] = uuid;
obj['nickname'] = nickname;
obj['address'] = address;
obj['status'] = status;
obj['platform'] = platform;
obj['last_activity'] = lastActivity;
obj['last_activity'] = last_activity;
obj['software'] = software;
obj['supported_task_types'] = supportedTaskTypes;
obj['supported_task_types'] = supported_task_types;
}
/**

View File

@ -24,12 +24,12 @@ class WorkerRegistration {
* @alias module:model/WorkerRegistration
* @param secret {String}
* @param platform {String}
* @param supportedTaskTypes {Array.<String>}
* @param supported_task_types {Array.<String>}
* @param nickname {String}
*/
constructor(secret, platform, supportedTaskTypes, nickname) {
constructor(secret, platform, supported_task_types, nickname) {
WorkerRegistration.initialize(this, secret, platform, supportedTaskTypes, nickname);
WorkerRegistration.initialize(this, secret, platform, supported_task_types, nickname);
}
/**
@ -37,10 +37,10 @@ class WorkerRegistration {
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, secret, platform, supportedTaskTypes, nickname) {
static initialize(obj, secret, platform, supported_task_types, nickname) {
obj['secret'] = secret;
obj['platform'] = platform;
obj['supported_task_types'] = supportedTaskTypes;
obj['supported_task_types'] = supported_task_types;
obj['nickname'] = nickname;
}

View File

@ -23,12 +23,12 @@ class WorkerSignOn {
* Constructs a new <code>WorkerSignOn</code>.
* @alias module:model/WorkerSignOn
* @param nickname {String}
* @param supportedTaskTypes {Array.<String>}
* @param softwareVersion {String}
* @param supported_task_types {Array.<String>}
* @param software_version {String}
*/
constructor(nickname, supportedTaskTypes, softwareVersion) {
constructor(nickname, supported_task_types, software_version) {
WorkerSignOn.initialize(this, nickname, supportedTaskTypes, softwareVersion);
WorkerSignOn.initialize(this, nickname, supported_task_types, software_version);
}
/**
@ -36,10 +36,10 @@ class WorkerSignOn {
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, nickname, supportedTaskTypes, softwareVersion) {
static initialize(obj, nickname, supported_task_types, software_version) {
obj['nickname'] = nickname;
obj['supported_task_types'] = supportedTaskTypes;
obj['software_version'] = softwareVersion;
obj['supported_task_types'] = supported_task_types;
obj['software_version'] = software_version;
}
/**

View File

@ -23,11 +23,11 @@ class WorkerStateChange {
/**
* Constructs a new <code>WorkerStateChange</code>.
* @alias module:model/WorkerStateChange
* @param statusRequested {module:model/WorkerStatus}
* @param status_requested {module:model/WorkerStatus}
*/
constructor(statusRequested) {
constructor(status_requested) {
WorkerStateChange.initialize(this, statusRequested);
WorkerStateChange.initialize(this, status_requested);
}
/**
@ -35,8 +35,8 @@ class WorkerStateChange {
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, statusRequested) {
obj['status_requested'] = statusRequested;
static initialize(obj, status_requested) {
obj['status_requested'] = status_requested;
}
/**