From afb9519a6c68d1938d362725de045e54ca920c10 Mon Sep 17 00:00:00 2001 From: winniehell Date: Tue, 3 Jun 2025 15:54:57 +0200 Subject: [PATCH 1/4] Add openapi-generator-cli dependency --- requirements-dev.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 88cac687..b31d01b7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,4 +2,5 @@ pydantic==2.11.5 pylint==3.3.7 pytest-randomly==3.16.0 -pytest-playwright==0.7.0 \ No newline at end of file +pytest-playwright==0.7.0 +openapi-generator-cli==7.13.0.post0 From 0f54c24e9d2f33506cdb8c71b449be2d839f0bc2 Mon Sep 17 00:00:00 2001 From: winniehell Date: Tue, 3 Jun 2025 15:55:21 +0200 Subject: [PATCH 2/4] Generate OpenAPI client for frontend --- frontend/js/api/.babelrc | 33 + frontend/js/api/.gitignore | 130 ++ frontend/js/api/.openapi-generator-ignore | 23 + frontend/js/api/.openapi-generator/FILES | 40 + frontend/js/api/.openapi-generator/VERSION | 1 + frontend/js/api/.travis.yml | 5 + frontend/js/api/README.md | 211 ++ frontend/js/api/git_push.sh | 57 + frontend/js/api/mocha.opts | 1 + frontend/js/api/package.json | 46 + frontend/js/api/src/ApiClient.js | 695 +++++++ frontend/js/api/src/api/DefaultApi.js | 1810 +++++++++++++++++ frontend/js/api/src/index.js | 265 +++ frontend/js/api/src/model/CIMeasurement.js | 382 ++++ frontend/js/api/src/model/CIMeasurementOld.js | 370 ++++ frontend/js/api/src/model/CarbonIntensityG.js | 15 + frontend/js/api/src/model/CarbonUg.js | 15 + frontend/js/api/src/model/CbCompanyUuid.js | 15 + frontend/js/api/src/model/CbMachineUuid.js | 15 + frontend/js/api/src/model/CbProjectUuid.js | 15 + frontend/js/api/src/model/City.js | 15 + frontend/js/api/src/model/Co2Eq.js | 15 + frontend/js/api/src/model/Co2I.js | 15 + frontend/js/api/src/model/Email.js | 15 + frontend/js/api/src/model/FilterMachine.js | 15 + frontend/js/api/src/model/FilterProject.js | 15 + frontend/js/api/src/model/FilterTags.js | 15 + frontend/js/api/src/model/FilterType.js | 15 + .../js/api/src/model/HTTPValidationError.js | 94 + frontend/js/api/src/model/ImageUrl.js | 15 + frontend/js/api/src/model/Ip.js | 15 + frontend/js/api/src/model/JobChange.js | 109 + frontend/js/api/src/model/Lat.js | 15 + frontend/js/api/src/model/Lon.js | 15 + frontend/js/api/src/model/Note.js | 15 + frontend/js/api/src/model/ProjectId.js | 15 + frontend/js/api/src/model/Software.js | 204 ++ .../api/src/model/UsageScenarioVariables.js | 15 + frontend/js/api/src/model/UserSetting.js | 114 ++ frontend/js/api/src/model/ValidationError.js | 130 ++ .../api/src/model/ValidationErrorLocInner.js | 15 + frontend/js/api/src/model/Value.js | 15 + generate-api-client.sh | 18 + 43 files changed, 5068 insertions(+) create mode 100644 frontend/js/api/.babelrc create mode 100644 frontend/js/api/.gitignore create mode 100644 frontend/js/api/.openapi-generator-ignore create mode 100644 frontend/js/api/.openapi-generator/FILES create mode 100644 frontend/js/api/.openapi-generator/VERSION create mode 100644 frontend/js/api/.travis.yml create mode 100644 frontend/js/api/README.md create mode 100644 frontend/js/api/git_push.sh create mode 100644 frontend/js/api/mocha.opts create mode 100644 frontend/js/api/package.json create mode 100644 frontend/js/api/src/ApiClient.js create mode 100644 frontend/js/api/src/api/DefaultApi.js create mode 100644 frontend/js/api/src/index.js create mode 100644 frontend/js/api/src/model/CIMeasurement.js create mode 100644 frontend/js/api/src/model/CIMeasurementOld.js create mode 100644 frontend/js/api/src/model/CarbonIntensityG.js create mode 100644 frontend/js/api/src/model/CarbonUg.js create mode 100644 frontend/js/api/src/model/CbCompanyUuid.js create mode 100644 frontend/js/api/src/model/CbMachineUuid.js create mode 100644 frontend/js/api/src/model/CbProjectUuid.js create mode 100644 frontend/js/api/src/model/City.js create mode 100644 frontend/js/api/src/model/Co2Eq.js create mode 100644 frontend/js/api/src/model/Co2I.js create mode 100644 frontend/js/api/src/model/Email.js create mode 100644 frontend/js/api/src/model/FilterMachine.js create mode 100644 frontend/js/api/src/model/FilterProject.js create mode 100644 frontend/js/api/src/model/FilterTags.js create mode 100644 frontend/js/api/src/model/FilterType.js create mode 100644 frontend/js/api/src/model/HTTPValidationError.js create mode 100644 frontend/js/api/src/model/ImageUrl.js create mode 100644 frontend/js/api/src/model/Ip.js create mode 100644 frontend/js/api/src/model/JobChange.js create mode 100644 frontend/js/api/src/model/Lat.js create mode 100644 frontend/js/api/src/model/Lon.js create mode 100644 frontend/js/api/src/model/Note.js create mode 100644 frontend/js/api/src/model/ProjectId.js create mode 100644 frontend/js/api/src/model/Software.js create mode 100644 frontend/js/api/src/model/UsageScenarioVariables.js create mode 100644 frontend/js/api/src/model/UserSetting.js create mode 100644 frontend/js/api/src/model/ValidationError.js create mode 100644 frontend/js/api/src/model/ValidationErrorLocInner.js create mode 100644 frontend/js/api/src/model/Value.js create mode 100755 generate-api-client.sh diff --git a/frontend/js/api/.babelrc b/frontend/js/api/.babelrc new file mode 100644 index 00000000..c73df9d5 --- /dev/null +++ b/frontend/js/api/.babelrc @@ -0,0 +1,33 @@ +{ + "presets": [ + "@babel/preset-env" + ], + "plugins": [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" + } + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" + ] +} diff --git a/frontend/js/api/.gitignore b/frontend/js/api/.gitignore new file mode 100644 index 00000000..6a7d6d8e --- /dev/null +++ b/frontend/js/api/.gitignore @@ -0,0 +1,130 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* \ No newline at end of file diff --git a/frontend/js/api/.openapi-generator-ignore b/frontend/js/api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/frontend/js/api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/frontend/js/api/.openapi-generator/FILES b/frontend/js/api/.openapi-generator/FILES new file mode 100644 index 00000000..dacc488b --- /dev/null +++ b/frontend/js/api/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.babelrc +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +git_push.sh +mocha.opts +package.json +src/ApiClient.js +src/api/DefaultApi.js +src/index.js +src/model/CIMeasurement.js +src/model/CIMeasurementOld.js +src/model/CarbonIntensityG.js +src/model/CarbonUg.js +src/model/CbCompanyUuid.js +src/model/CbMachineUuid.js +src/model/CbProjectUuid.js +src/model/City.js +src/model/Co2Eq.js +src/model/Co2I.js +src/model/Email.js +src/model/FilterMachine.js +src/model/FilterProject.js +src/model/FilterTags.js +src/model/FilterType.js +src/model/HTTPValidationError.js +src/model/ImageUrl.js +src/model/Ip.js +src/model/JobChange.js +src/model/Lat.js +src/model/Lon.js +src/model/Note.js +src/model/ProjectId.js +src/model/Software.js +src/model/UsageScenarioVariables.js +src/model/UserSetting.js +src/model/ValidationError.js +src/model/ValidationErrorLocInner.js +src/model/Value.js diff --git a/frontend/js/api/.openapi-generator/VERSION b/frontend/js/api/.openapi-generator/VERSION new file mode 100644 index 00000000..eb1dc6a5 --- /dev/null +++ b/frontend/js/api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.13.0 diff --git a/frontend/js/api/.travis.yml b/frontend/js/api/.travis.yml new file mode 100644 index 00000000..0968f7a4 --- /dev/null +++ b/frontend/js/api/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +cache: npm +node_js: + - "6" + - "6.1" diff --git a/frontend/js/api/README.md b/frontend/js/api/README.md new file mode 100644 index 00000000..e3415448 --- /dev/null +++ b/frontend/js/api/README.md @@ -0,0 +1,211 @@ +# fast_api + +FastApi - JavaScript client for fast_api +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.1.0 +- Package version: 0.1.0 +- Generator version: 7.13.0 +- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen + +## Installation + +### For [Node.js](https://nodejs.org/) + +#### npm + +To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). + +Then install it via: + +```shell +npm install fast_api --save +``` + +Finally, you need to build the module: + +```shell +npm run build +``` + +##### Local development + +To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run: + +```shell +npm install +``` + +Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: + +```shell +npm link +``` + +To use the link you just defined in your project, switch to the directory you want to use your fast_api from, and run: + +```shell +npm link /path/to/ +``` + +Finally, you need to build the module: + +```shell +npm run build +``` + +#### git + +If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID +then install it via: + +```shell + npm install GIT_USER_ID/GIT_REPO_ID --save +``` + +### For browser + +The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following +the above steps with Node.js and installing browserify with `npm install -g browserify`, +perform the following (assuming *main.js* is your entry file): + +```shell +browserify main.js > bundle.js +``` + +Then include *bundle.js* in the HTML pages. + +### Webpack Configuration + +Using Webpack you may encounter the following error: "Module not found: Error: +Cannot resolve module", most certainly you should disable AMD loader. Add/merge +the following section to your webpack config: + +```javascript +module: { + rules: [ + { + parser: { + amd: false + } + } + ] +} +``` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following JS code: + +```javascript +var FastApi = require('fast_api'); + +var defaultClient = FastApi.ApiClient.instance; +// Configure API key authorization: Header +var Header = defaultClient.authentications['Header']; +Header.apiKey = "YOUR API KEY" +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//Header.apiKeyPrefix['X-Authentication'] = "Token" + +var api = new FastApi.DefaultApi() +var ids = "ids_example"; // {String} +var opts = { + 'forceMode': "forceMode_example" // {String} +}; +api.compareInRepoV1CompareGet(ids, opts).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*FastApi.DefaultApi* | [**compareInRepoV1CompareGet**](docs/DefaultApi.md#compareInRepoV1CompareGet) | **GET** /v1/compare | Compare In Repo +*FastApi.DefaultApi* | [**diffV1DiffGet**](docs/DefaultApi.md#diffV1DiffGet) | **GET** /v1/diff | Diff +*FastApi.DefaultApi* | [**getBadgeSingleV1BadgeSingleRunIdGet**](docs/DefaultApi.md#getBadgeSingleV1BadgeSingleRunIdGet) | **GET** /v1/badge/single/{run_id} | Get Badge Single +*FastApi.DefaultApi* | [**getCiBadgeGetV1CiBadgeGetGet**](docs/DefaultApi.md#getCiBadgeGetV1CiBadgeGetGet) | **GET** /v1/ci/badge/get | Get Ci Badge Get +*FastApi.DefaultApi* | [**getCiBadgeGetV1CiBadgeGetHead**](docs/DefaultApi.md#getCiBadgeGetV1CiBadgeGetHead) | **HEAD** /v1/ci/badge/get | Get Ci Badge Get +*FastApi.DefaultApi* | [**getCiMeasurementsV1CiMeasurementsGet**](docs/DefaultApi.md#getCiMeasurementsV1CiMeasurementsGet) | **GET** /v1/ci/measurements | Get Ci Measurements +*FastApi.DefaultApi* | [**getCiRepositoriesV1CiRepositoriesGet**](docs/DefaultApi.md#getCiRepositoriesV1CiRepositoriesGet) | **GET** /v1/ci/repositories | Get Ci Repositories +*FastApi.DefaultApi* | [**getCiRunsV1CiRunsGet**](docs/DefaultApi.md#getCiRunsV1CiRunsGet) | **GET** /v1/ci/runs | Get Ci Runs +*FastApi.DefaultApi* | [**getCiStatsV1CiStatsGet**](docs/DefaultApi.md#getCiStatsV1CiStatsGet) | **GET** /v1/ci/stats | Get Ci Stats +*FastApi.DefaultApi* | [**getInsightsV1CiInsightsGet**](docs/DefaultApi.md#getInsightsV1CiInsightsGet) | **GET** /v1/ci/insights | Get Insights +*FastApi.DefaultApi* | [**getInsightsV1InsightsGet**](docs/DefaultApi.md#getInsightsV1InsightsGet) | **GET** /v1/insights | Get Insights +*FastApi.DefaultApi* | [**getJobsV2JobsGet**](docs/DefaultApi.md#getJobsV2JobsGet) | **GET** /v2/jobs | Get Jobs +*FastApi.DefaultApi* | [**getMachinesV1MachinesGet**](docs/DefaultApi.md#getMachinesV1MachinesGet) | **GET** /v1/machines | Get Machines +*FastApi.DefaultApi* | [**getMeasurementsSingleV1MeasurementsSingleRunIdGet**](docs/DefaultApi.md#getMeasurementsSingleV1MeasurementsSingleRunIdGet) | **GET** /v1/measurements/single/{run_id} | Get Measurements Single +*FastApi.DefaultApi* | [**getNetworkV1NetworkRunIdGet**](docs/DefaultApi.md#getNetworkV1NetworkRunIdGet) | **GET** /v1/network/{run_id} | Get Network +*FastApi.DefaultApi* | [**getNotesV1NotesRunIdGet**](docs/DefaultApi.md#getNotesV1NotesRunIdGet) | **GET** /v1/notes/{run_id} | Get Notes +*FastApi.DefaultApi* | [**getOptimizationsV1OptimizationsRunIdGet**](docs/DefaultApi.md#getOptimizationsV1OptimizationsRunIdGet) | **GET** /v1/optimizations/{run_id} | Get Optimizations +*FastApi.DefaultApi* | [**getPhaseStatsSingleV1PhaseStatsSingleRunIdGet**](docs/DefaultApi.md#getPhaseStatsSingleV1PhaseStatsSingleRunIdGet) | **GET** /v1/phase_stats/single/{run_id} | Get Phase Stats Single +*FastApi.DefaultApi* | [**getRepositoriesV1RepositoriesGet**](docs/DefaultApi.md#getRepositoriesV1RepositoriesGet) | **GET** /v1/repositories | Get Repositories +*FastApi.DefaultApi* | [**getRunV2RunRunIdGet**](docs/DefaultApi.md#getRunV2RunRunIdGet) | **GET** /v2/run/{run_id} | Get Run +*FastApi.DefaultApi* | [**getRunsV2RunsGet**](docs/DefaultApi.md#getRunsV2RunsGet) | **GET** /v2/runs | Get Runs +*FastApi.DefaultApi* | [**getTimelineBadgeV1BadgeTimelineGet**](docs/DefaultApi.md#getTimelineBadgeV1BadgeTimelineGet) | **GET** /v1/badge/timeline | Get Timeline Badge +*FastApi.DefaultApi* | [**getTimelineStatsV1TimelineGet**](docs/DefaultApi.md#getTimelineStatsV1TimelineGet) | **GET** /v1/timeline | Get Timeline Stats +*FastApi.DefaultApi* | [**getUserSettingsV1UserSettingsGet**](docs/DefaultApi.md#getUserSettingsV1UserSettingsGet) | **GET** /v1/user/settings | Get User Settings +*FastApi.DefaultApi* | [**getWatchlistV1WatchlistGet**](docs/DefaultApi.md#getWatchlistV1WatchlistGet) | **GET** /v1/watchlist | Get Watchlist +*FastApi.DefaultApi* | [**homeGet**](docs/DefaultApi.md#homeGet) | **GET** / | Home +*FastApi.DefaultApi* | [**oldV1JobsEndpointV1JobsGet**](docs/DefaultApi.md#oldV1JobsEndpointV1JobsGet) | **GET** /v1/jobs | Old V1 Jobs Endpoint +*FastApi.DefaultApi* | [**oldV1RunEndpointV1RunRunIdGet**](docs/DefaultApi.md#oldV1RunEndpointV1RunRunIdGet) | **GET** /v1/run/{run_id} | Old V1 Run Endpoint +*FastApi.DefaultApi* | [**oldV1RunsEndpointV1RunsGet**](docs/DefaultApi.md#oldV1RunsEndpointV1RunsGet) | **GET** /v1/runs | Old V1 Runs Endpoint +*FastApi.DefaultApi* | [**postCiMeasurementAddDeprecatedV1CiMeasurementAddPost**](docs/DefaultApi.md#postCiMeasurementAddDeprecatedV1CiMeasurementAddPost) | **POST** /v1/ci/measurement/add | Post Ci Measurement Add Deprecated +*FastApi.DefaultApi* | [**postCiMeasurementAddV2CiMeasurementAddPost**](docs/DefaultApi.md#postCiMeasurementAddV2CiMeasurementAddPost) | **POST** /v2/ci/measurement/add | Post Ci Measurement Add +*FastApi.DefaultApi* | [**robotsTxtRobotsTxtGet**](docs/DefaultApi.md#robotsTxtRobotsTxtGet) | **GET** /robots.txt | Robots Txt +*FastApi.DefaultApi* | [**softwareAddV1SoftwareAddPost**](docs/DefaultApi.md#softwareAddV1SoftwareAddPost) | **POST** /v1/software/add | Software Add +*FastApi.DefaultApi* | [**updateJobV1JobPut**](docs/DefaultApi.md#updateJobV1JobPut) | **PUT** /v1/job | Update Job +*FastApi.DefaultApi* | [**updateUserSettingV1UserSettingPut**](docs/DefaultApi.md#updateUserSettingV1UserSettingPut) | **PUT** /v1/user/setting | Update User Setting + + +## Documentation for Models + + - [FastApi.CIMeasurement](docs/CIMeasurement.md) + - [FastApi.CIMeasurementOld](docs/CIMeasurementOld.md) + - [FastApi.CarbonIntensityG](docs/CarbonIntensityG.md) + - [FastApi.CarbonUg](docs/CarbonUg.md) + - [FastApi.CbCompanyUuid](docs/CbCompanyUuid.md) + - [FastApi.CbMachineUuid](docs/CbMachineUuid.md) + - [FastApi.CbProjectUuid](docs/CbProjectUuid.md) + - [FastApi.City](docs/City.md) + - [FastApi.Co2Eq](docs/Co2Eq.md) + - [FastApi.Co2I](docs/Co2I.md) + - [FastApi.Email](docs/Email.md) + - [FastApi.FilterMachine](docs/FilterMachine.md) + - [FastApi.FilterProject](docs/FilterProject.md) + - [FastApi.FilterTags](docs/FilterTags.md) + - [FastApi.FilterType](docs/FilterType.md) + - [FastApi.HTTPValidationError](docs/HTTPValidationError.md) + - [FastApi.ImageUrl](docs/ImageUrl.md) + - [FastApi.Ip](docs/Ip.md) + - [FastApi.JobChange](docs/JobChange.md) + - [FastApi.Lat](docs/Lat.md) + - [FastApi.Lon](docs/Lon.md) + - [FastApi.Note](docs/Note.md) + - [FastApi.ProjectId](docs/ProjectId.md) + - [FastApi.Software](docs/Software.md) + - [FastApi.UsageScenarioVariables](docs/UsageScenarioVariables.md) + - [FastApi.UserSetting](docs/UserSetting.md) + - [FastApi.ValidationError](docs/ValidationError.md) + - [FastApi.ValidationErrorLocInner](docs/ValidationErrorLocInner.md) + - [FastApi.Value](docs/Value.md) + + +## Documentation for Authorization + + +Authentication schemes defined for the API: +### Header + + +- **Type**: API key +- **API key parameter name**: X-Authentication +- **Location**: HTTP header + diff --git a/frontend/js/api/git_push.sh b/frontend/js/api/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/frontend/js/api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend/js/api/mocha.opts b/frontend/js/api/mocha.opts new file mode 100644 index 00000000..90701180 --- /dev/null +++ b/frontend/js/api/mocha.opts @@ -0,0 +1 @@ +--timeout 10000 diff --git a/frontend/js/api/package.json b/frontend/js/api/package.json new file mode 100644 index 00000000..4ea6497f --- /dev/null +++ b/frontend/js/api/package.json @@ -0,0 +1,46 @@ +{ + "name": "fast_api", + "version": "0.1.0", + "description": "JS API client generated by OpenAPI Generator", + "license": "Unlicense", + "main": "dist/index.js", + "scripts": { + "build": "babel src -d dist", + "prepare": "npm run build", + "test": "mocha --require @babel/register --recursive" + }, + "browser": { + "fs": false + }, + "dependencies": { + "@babel/cli": "^7.0.0", + "superagent": "^5.3.0" + }, + "devDependencies": { + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/register": "^7.0.0", + "expect.js": "^0.3.1", + "mocha": "^8.0.1", + "sinon": "^7.2.0" + }, + "files": [ + "dist" + ] +} diff --git a/frontend/js/api/src/ApiClient.js b/frontend/js/api/src/ApiClient.js new file mode 100644 index 00000000..955ea2c0 --- /dev/null +++ b/frontend/js/api/src/ApiClient.js @@ -0,0 +1,695 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import superagent from "superagent"; + +/** +* @module ApiClient +* @version 0.1.0 +*/ + +/** +* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an +* application to use this class directly - the *Api and model classes provide the public API for the service. The +* contents of this file should be regarded as internal but are documented for completeness. +* @alias module:ApiClient +* @class +*/ +class ApiClient { + /** + * The base URL against which to resolve every API call's (relative) path. + * Overrides the default value set in spec file if present + * @param {String} basePath + */ + constructor(basePath = 'http://localhost') { + /** + * The base URL against which to resolve every API call's (relative) path. + * @type {String} + * @default http://localhost + */ + this.basePath = basePath.replace(/\/+$/, ''); + + /** + * The authentication methods to be included for all API calls. + * @type {Array.} + */ + this.authentications = { + 'Header': {type: 'apiKey', 'in': 'header', name: 'X-Authentication'} + } + + /** + * The default HTTP headers to be included for all API calls. + * @type {Array.} + * @default {} + */ + this.defaultHeaders = { + 'User-Agent': 'OpenAPI-Generator/0.1.0/Javascript' + }; + + /** + * The default HTTP timeout for all API calls. + * @type {Number} + * @default 60000 + */ + this.timeout = 60000; + + /** + * If set to false an additional timestamp parameter is added to all API GET calls to + * prevent browser caching + * @type {Boolean} + * @default true + */ + this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; + + /* + * Allow user to add superagent plugins + */ + this.plugins = null; + + } + + /** + * Returns a string representation for an actual parameter. + * @param param The actual parameter. + * @returns {String} The string representation of param. + */ + paramToString(param) { + if (param == undefined || param == null) { + return ''; + } + if (param instanceof Date) { + return param.toJSON(); + } + if (ApiClient.canBeJsonified(param)) { + return JSON.stringify(param); + } + + return param.toString(); + } + + /** + * Returns a boolean indicating if the parameter could be JSON.stringified + * @param param The actual parameter + * @returns {Boolean} Flag indicating if param can be JSON.stringified + */ + static canBeJsonified(str) { + if (typeof str !== 'string' && typeof str !== 'object') return false; + try { + const type = str.toString(); + return type === '[object Object]' + || type === '[object Array]'; + } catch (err) { + return false; + } + }; + + /** + * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. + * NOTE: query parameters are not handled here. + * @param {String} path The path to append to the base URL. + * @param {Object} pathParams The parameter values to append. + * @param {String} apiBasePath Base path defined in the path, operation level to override the default one + * @returns {String} The encoded path with parameter values substituted. + */ + buildUrl(path, pathParams, apiBasePath) { + if (!path.match(/^\//)) { + path = '/' + path; + } + + var url = this.basePath + path; + + // use API (operation, path) base path if defined + if (apiBasePath !== null && apiBasePath !== undefined) { + url = apiBasePath + path; + } + + url = url.replace(/\{([\w-\.#]+)\}/g, (fullMatch, key) => { + var value; + if (pathParams.hasOwnProperty(key)) { + value = this.paramToString(pathParams[key]); + } else { + value = fullMatch; + } + + return encodeURIComponent(value); + }); + + return url; + } + + /** + * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
    + *
  • application/json
  • + *
  • application/json; charset=UTF8
  • + *
  • APPLICATION/JSON
  • + *
+ * @param {String} contentType The MIME content type to check. + * @returns {Boolean} true if contentType represents JSON, otherwise false. + */ + isJsonMime(contentType) { + return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); + } + + /** + * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. + * @param {Array.} contentTypes + * @returns {String} The chosen content type, preferring JSON. + */ + jsonPreferredMime(contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + if (this.isJsonMime(contentTypes[i])) { + return contentTypes[i]; + } + } + + return contentTypes[0]; + } + + /** + * Checks whether the given parameter value represents file-like content. + * @param param The parameter to check. + * @returns {Boolean} true if param represents a file. + */ + isFileParam(param) { + // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) + if (typeof require === 'function') { + let fs; + try { + fs = require('fs'); + } catch (err) {} + if (fs && fs.ReadStream && param instanceof fs.ReadStream) { + return true; + } + } + + // Buffer in Node.js + if (typeof Buffer === 'function' && param instanceof Buffer) { + return true; + } + + // Blob in browser + if (typeof Blob === 'function' && param instanceof Blob) { + return true; + } + + // File in browser (it seems File object is also instance of Blob, but keep this for safe) + if (typeof File === 'function' && param instanceof File) { + return true; + } + + return false; + } + + /** + * Normalizes parameter values: + *
    + *
  • remove nils
  • + *
  • keep files and arrays
  • + *
  • format to string with `paramToString` for other cases
  • + *
+ * @param {Object.} params The parameters as object properties. + * @returns {Object.} normalized parameters. + */ + normalizeParams(params) { + var newParams = {}; + for (var key in params) { + if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { + var value = params[key]; + if (this.isFileParam(value) || Array.isArray(value)) { + newParams[key] = value; + } else { + newParams[key] = this.paramToString(value); + } + } + } + + return newParams; + } + + /** + * Builds a string representation of an array-type actual parameter, according to the given collection format. + * @param {Array} param An array parameter. + * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns + * param as is if collectionFormat is multi. + */ + buildCollectionParam(param, collectionFormat) { + if (param == null) { + return null; + } + switch (collectionFormat) { + case 'csv': + return param.map(this.paramToString, this).join(','); + case 'ssv': + return param.map(this.paramToString, this).join(' '); + case 'tsv': + return param.map(this.paramToString, this).join('\t'); + case 'pipes': + return param.map(this.paramToString, this).join('|'); + case 'multi': + //return the array directly as SuperAgent will handle it as expected + return param.map(this.paramToString, this); + case 'passthrough': + return param; + default: + throw new Error('Unknown collection format: ' + collectionFormat); + } + } + + /** + * Applies authentication headers to the request. + * @param {Object} request The request object created by a superagent() call. + * @param {Array.} authNames An array of authentication method names. + */ + applyAuthToRequest(request, authNames) { + authNames.forEach((authName) => { + var auth = this.authentications[authName]; + switch (auth.type) { + case 'basic': + if (auth.username || auth.password) { + request.auth(auth.username || '', auth.password || ''); + } + + break; + case 'bearer': + if (auth.accessToken) { + var localVarBearerToken = typeof auth.accessToken === 'function' + ? auth.accessToken() + : auth.accessToken + request.set({'Authorization': 'Bearer ' + localVarBearerToken}); + } + + break; + case 'apiKey': + if (auth.apiKey) { + var data = {}; + if (auth.apiKeyPrefix) { + data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; + } else { + data[auth.name] = auth.apiKey; + } + + if (auth['in'] === 'header') { + request.set(data); + } else { + request.query(data); + } + } + + break; + case 'oauth2': + if (auth.accessToken) { + request.set({'Authorization': 'Bearer ' + auth.accessToken}); + } + + break; + default: + throw new Error('Unknown authentication type: ' + auth.type); + } + }); + } + + /** + * Deserializes an HTTP response body into a value of the specified type. + * @param {Object} response A SuperAgent response object. + * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns A value of the specified type. + */ + deserialize(response, returnType) { + if (response == null || returnType == null || response.status == 204) { + return null; + } + + // Rely on SuperAgent for parsing response body. + // See http://visionmedia.github.io/superagent/#parsing-response-bodies + var data = response.body; + if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { + // SuperAgent does not always produce a body; use the unparsed response as a fallback + data = response.text; + } + + return ApiClient.convertToType(data, returnType); + } + + + /** + * Invokes the REST service using the supplied settings and parameters. + * @param {String} path The base URL to invoke. + * @param {String} httpMethod The HTTP method to use. + * @param {Object.} pathParams A map of path parameters and their values. + * @param {Object.} queryParams A map of query parameters and their values. + * @param {Object.} headerParams A map of header parameters and their values. + * @param {Object.} formParams A map of form parameters and their values. + * @param {Object} bodyParam The value to pass as the request body. + * @param {Array.} authNames An array of authentication type names. + * @param {Array.} contentTypes An array of request MIME types. + * @param {Array.} accepts An array of acceptable response MIME types. + * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the + * constructor for a complex type. + * @param {String} apiBasePath base path defined in the operation/path level to override the default one + * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object. + */ + callApi(path, httpMethod, pathParams, + queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + returnType, apiBasePath) { + + var url = this.buildUrl(path, pathParams, apiBasePath); + var request = superagent(httpMethod, url); + + if (this.plugins !== null) { + for (var index in this.plugins) { + if (this.plugins.hasOwnProperty(index)) { + request.use(this.plugins[index]) + } + } + } + + // apply authentications + this.applyAuthToRequest(request, authNames); + + // set query parameters + if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { + queryParams['_'] = new Date().getTime(); + } + + request.query(this.normalizeParams(queryParams)); + + // set header parameters + request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + + // set request timeout + request.timeout(this.timeout); + + var contentType = this.jsonPreferredMime(contentTypes); + if (contentType) { + // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) + if(contentType != 'multipart/form-data') { + request.type(contentType); + } + } + + if (contentType === 'application/x-www-form-urlencoded') { + let normalizedParams = this.normalizeParams(formParams) + let urlSearchParams = new URLSearchParams(normalizedParams); + let queryString = urlSearchParams.toString(); + request.send(queryString); + } else if (contentType == 'multipart/form-data') { + var _formParams = this.normalizeParams(formParams); + for (var key in _formParams) { + if (_formParams.hasOwnProperty(key)) { + let _formParamsValue = _formParams[key]; + if (this.isFileParam(_formParamsValue)) { + // file field + request.attach(key, _formParamsValue); + } else if (Array.isArray(_formParamsValue) && _formParamsValue.length + && this.isFileParam(_formParamsValue[0])) { + // multiple files + _formParamsValue.forEach(file => request.attach(key, file)); + } else { + request.field(key, _formParamsValue); + } + } + } + } else if (bodyParam !== null && bodyParam !== undefined) { + if (!request.header['Content-Type']) { + request.type('application/json'); + } + request.send(bodyParam); + } + + var accept = this.jsonPreferredMime(accepts); + if (accept) { + request.accept(accept); + } + + if (returnType === 'Blob') { + request.responseType('blob'); + } else if (returnType === 'String') { + request.responseType('text'); + } + + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent._attachCookies(request); + } + else { + request.withCredentials(); + } + } + + return new Promise((resolve, reject) => { + request.end((error, response) => { + if (error) { + var err = {}; + if (response) { + err.status = response.status; + err.statusText = response.statusText; + err.body = response.body; + err.response = response; + } + err.error = error; + + reject(err); + } else { + try { + var data = this.deserialize(response, returnType); + if (this.enableCookies && typeof window === 'undefined'){ + this.agent._saveCookies(response); + } + + resolve({data, response}); + } catch (err) { + reject(err); + } + } + }); + }); + + } + + /** + * Parses an ISO-8601 string representation or epoch representation of a date value. + * @param {String} str The date value as a string. + * @returns {Date} The parsed date object. + */ + static parseDate(str) { + if (isNaN(str)) { + return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3')); + } + return new Date(+str); + } + + /** + * Converts a value to the specified type. + * @param {(String|Object)} data The data to convert, as a string or object. + * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. + */ + static convertToType(data, type) { + if (data === null || data === undefined) + return data + + switch (type) { + case 'Boolean': + return Boolean(data); + case 'Integer': + return parseInt(data, 10); + case 'Number': + return parseFloat(data); + case 'String': + return String(data); + case 'Date': + return ApiClient.parseDate(String(data)); + case 'Blob': + return data; + default: + if (type === Object) { + // generic object, return directly + return data; + } else if (typeof type.constructFromObject === 'function') { + // for model type like User and enum class + return type.constructFromObject(data); + } else if (Array.isArray(type)) { + // for array type like: ['String'] + var itemType = type[0]; + + return data.map((item) => { + return ApiClient.convertToType(item, itemType); + }); + } else if (typeof type === 'object') { + // for plain object type like: {'String': 'Integer'} + var keyType, valueType; + for (var k in type) { + if (type.hasOwnProperty(k)) { + keyType = k; + valueType = type[k]; + break; + } + } + + var result = {}; + for (var k in data) { + if (data.hasOwnProperty(k)) { + var key = ApiClient.convertToType(k, keyType); + var value = ApiClient.convertToType(data[k], valueType); + result[key] = value; + } + } + + return result; + } else { + // for unknown type, return the data directly + return data; + } + } + } + + /** + * Gets an array of host settings + * @returns An array of host settings + */ + hostSettings() { + return [ + { + 'url': "", + 'description': "No description provided", + } + ]; + } + + getBasePathFromSettings(index, variables={}) { + var servers = this.hostSettings(); + + // check array index out of bound + if (index < 0 || index >= servers.length) { + throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length); + } + + var server = servers[index]; + var url = server['url']; + + // go through variable and assign a value + for (var variable_name in server['variables']) { + if (variable_name in variables) { + let variable = server['variables'][variable_name]; + if ( !('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name]) ) { + url = url.replace("{" + variable_name + "}", variables[variable_name]); + } else { + throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + "."); + } + } else { + // use default value + url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']) + } + } + return url; + } + + /** + * Constructs a new map or array model from REST data. + * @param data {Object|Array} The REST data. + * @param obj {Object|Array} The target object or array. + */ + static constructFromObject(data, obj, itemType) { + if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + if (data.hasOwnProperty(i)) + obj[i] = ApiClient.convertToType(data[i], itemType); + } + } else { + for (var k in data) { + if (data.hasOwnProperty(k)) + obj[k] = ApiClient.convertToType(data[k], itemType); + } + } + }; +} + +/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ +ApiClient.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' +}; + +/** +* The default API client implementation. +* @type {module:ApiClient} +*/ +ApiClient.instance = new ApiClient(); +export default ApiClient; diff --git a/frontend/js/api/src/api/DefaultApi.js b/frontend/js/api/src/api/DefaultApi.js new file mode 100644 index 00000000..f20c4f6c --- /dev/null +++ b/frontend/js/api/src/api/DefaultApi.js @@ -0,0 +1,1810 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import CIMeasurement from '../model/CIMeasurement'; +import CIMeasurementOld from '../model/CIMeasurementOld'; +import HTTPValidationError from '../model/HTTPValidationError'; +import JobChange from '../model/JobChange'; +import Software from '../model/Software'; +import UserSetting from '../model/UserSetting'; + +/** +* Default service. +* @module api/DefaultApi +* @version 0.1.0 +*/ +export default class DefaultApi { + + /** + * Constructs a new DefaultApi. + * @alias module:api/DefaultApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * Compare In Repo + * @param {String} ids + * @param {Object} opts Optional parameters + * @param {String} [forceMode] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + compareInRepoV1CompareGetWithHttpInfo(ids, opts) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'ids' is set + if (ids === undefined || ids === null) { + throw new Error("Missing the required parameter 'ids' when calling compareInRepoV1CompareGet"); + } + + let pathParams = { + }; + let queryParams = { + 'ids': ids, + 'force_mode': opts['forceMode'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/compare', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Compare In Repo + * @param {String} ids + * @param {Object} opts Optional parameters + * @param {String} opts.forceMode + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + compareInRepoV1CompareGet(ids, opts) { + return this.compareInRepoV1CompareGetWithHttpInfo(ids, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Diff + * @param {String} ids + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + diffV1DiffGetWithHttpInfo(ids) { + let postBody = null; + // verify the required parameter 'ids' is set + if (ids === undefined || ids === null) { + throw new Error("Missing the required parameter 'ids' when calling diffV1DiffGet"); + } + + let pathParams = { + }; + let queryParams = { + 'ids': ids + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/diff', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Diff + * @param {String} ids + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + diffV1DiffGet(ids) { + return this.diffV1DiffGetWithHttpInfo(ids) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Badge Single + * @param {String} runId + * @param {Object} opts Optional parameters + * @param {String} [metric = 'cpu_energy_rapl_msr_component')] + * @param {String} [unit = 'watt-hours')] + * @param {String} [phase] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getBadgeSingleV1BadgeSingleRunIdGetWithHttpInfo(runId, opts) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'runId' is set + if (runId === undefined || runId === null) { + throw new Error("Missing the required parameter 'runId' when calling getBadgeSingleV1BadgeSingleRunIdGet"); + } + + let pathParams = { + 'run_id': runId + }; + let queryParams = { + 'metric': opts['metric'], + 'unit': opts['unit'], + 'phase': opts['phase'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/badge/single/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Badge Single + * @param {String} runId + * @param {Object} opts Optional parameters + * @param {String} opts.metric (default to 'cpu_energy_rapl_msr_component') + * @param {String} opts.unit (default to 'watt-hours') + * @param {String} opts.phase + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getBadgeSingleV1BadgeSingleRunIdGet(runId, opts) { + return this.getBadgeSingleV1BadgeSingleRunIdGetWithHttpInfo(runId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Ci Badge Get + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Object} opts Optional parameters + * @param {String} [mode = 'last')] + * @param {String} [metric = 'energy')] + * @param {Number} [durationDays] + * @param {String} [unit = 'watt-hours')] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getCiBadgeGetV1CiBadgeGetGetWithHttpInfo(repo, branch, workflow, opts) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'repo' is set + if (repo === undefined || repo === null) { + throw new Error("Missing the required parameter 'repo' when calling getCiBadgeGetV1CiBadgeGetGet"); + } + // verify the required parameter 'branch' is set + if (branch === undefined || branch === null) { + throw new Error("Missing the required parameter 'branch' when calling getCiBadgeGetV1CiBadgeGetGet"); + } + // verify the required parameter 'workflow' is set + if (workflow === undefined || workflow === null) { + throw new Error("Missing the required parameter 'workflow' when calling getCiBadgeGetV1CiBadgeGetGet"); + } + + let pathParams = { + }; + let queryParams = { + 'repo': repo, + 'branch': branch, + 'workflow': workflow, + 'mode': opts['mode'], + 'metric': opts['metric'], + 'duration_days': opts['durationDays'], + 'unit': opts['unit'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/badge/get', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Ci Badge Get + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Object} opts Optional parameters + * @param {String} opts.mode (default to 'last') + * @param {String} opts.metric (default to 'energy') + * @param {Number} opts.durationDays + * @param {String} opts.unit (default to 'watt-hours') + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getCiBadgeGetV1CiBadgeGetGet(repo, branch, workflow, opts) { + return this.getCiBadgeGetV1CiBadgeGetGetWithHttpInfo(repo, branch, workflow, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Ci Badge Get + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Object} opts Optional parameters + * @param {String} [mode = 'last')] + * @param {String} [metric = 'energy')] + * @param {Number} [durationDays] + * @param {String} [unit = 'watt-hours')] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getCiBadgeGetV1CiBadgeGetHeadWithHttpInfo(repo, branch, workflow, opts) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'repo' is set + if (repo === undefined || repo === null) { + throw new Error("Missing the required parameter 'repo' when calling getCiBadgeGetV1CiBadgeGetHead"); + } + // verify the required parameter 'branch' is set + if (branch === undefined || branch === null) { + throw new Error("Missing the required parameter 'branch' when calling getCiBadgeGetV1CiBadgeGetHead"); + } + // verify the required parameter 'workflow' is set + if (workflow === undefined || workflow === null) { + throw new Error("Missing the required parameter 'workflow' when calling getCiBadgeGetV1CiBadgeGetHead"); + } + + let pathParams = { + }; + let queryParams = { + 'repo': repo, + 'branch': branch, + 'workflow': workflow, + 'mode': opts['mode'], + 'metric': opts['metric'], + 'duration_days': opts['durationDays'], + 'unit': opts['unit'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/badge/get', 'HEAD', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Ci Badge Get + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Object} opts Optional parameters + * @param {String} opts.mode (default to 'last') + * @param {String} opts.metric (default to 'energy') + * @param {Number} opts.durationDays + * @param {String} opts.unit (default to 'watt-hours') + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getCiBadgeGetV1CiBadgeGetHead(repo, branch, workflow, opts) { + return this.getCiBadgeGetV1CiBadgeGetHeadWithHttpInfo(repo, branch, workflow, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Ci Measurements + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Date} startDate + * @param {Date} endDate + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getCiMeasurementsV1CiMeasurementsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) { + let postBody = null; + // verify the required parameter 'repo' is set + if (repo === undefined || repo === null) { + throw new Error("Missing the required parameter 'repo' when calling getCiMeasurementsV1CiMeasurementsGet"); + } + // verify the required parameter 'branch' is set + if (branch === undefined || branch === null) { + throw new Error("Missing the required parameter 'branch' when calling getCiMeasurementsV1CiMeasurementsGet"); + } + // verify the required parameter 'workflow' is set + if (workflow === undefined || workflow === null) { + throw new Error("Missing the required parameter 'workflow' when calling getCiMeasurementsV1CiMeasurementsGet"); + } + // verify the required parameter 'startDate' is set + if (startDate === undefined || startDate === null) { + throw new Error("Missing the required parameter 'startDate' when calling getCiMeasurementsV1CiMeasurementsGet"); + } + // verify the required parameter 'endDate' is set + if (endDate === undefined || endDate === null) { + throw new Error("Missing the required parameter 'endDate' when calling getCiMeasurementsV1CiMeasurementsGet"); + } + + let pathParams = { + }; + let queryParams = { + 'repo': repo, + 'branch': branch, + 'workflow': workflow, + 'start_date': startDate, + 'end_date': endDate + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/measurements', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Ci Measurements + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Date} startDate + * @param {Date} endDate + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getCiMeasurementsV1CiMeasurementsGet(repo, branch, workflow, startDate, endDate) { + return this.getCiMeasurementsV1CiMeasurementsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Ci Repositories + * @param {Object} opts Optional parameters + * @param {String} [repo] + * @param {String} [sortBy = 'name')] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getCiRepositoriesV1CiRepositoriesGetWithHttpInfo(opts) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + }; + let queryParams = { + 'repo': opts['repo'], + 'sort_by': opts['sortBy'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/repositories', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Ci Repositories + * @param {Object} opts Optional parameters + * @param {String} opts.repo + * @param {String} opts.sortBy (default to 'name') + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getCiRepositoriesV1CiRepositoriesGet(opts) { + return this.getCiRepositoriesV1CiRepositoriesGetWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Ci Runs + * @param {String} repo + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getCiRunsV1CiRunsGetWithHttpInfo(repo) { + let postBody = null; + // verify the required parameter 'repo' is set + if (repo === undefined || repo === null) { + throw new Error("Missing the required parameter 'repo' when calling getCiRunsV1CiRunsGet"); + } + + let pathParams = { + }; + let queryParams = { + 'repo': repo + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/runs', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Ci Runs + * @param {String} repo + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getCiRunsV1CiRunsGet(repo) { + return this.getCiRunsV1CiRunsGetWithHttpInfo(repo) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Ci Stats + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Date} startDate + * @param {Date} endDate + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getCiStatsV1CiStatsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) { + let postBody = null; + // verify the required parameter 'repo' is set + if (repo === undefined || repo === null) { + throw new Error("Missing the required parameter 'repo' when calling getCiStatsV1CiStatsGet"); + } + // verify the required parameter 'branch' is set + if (branch === undefined || branch === null) { + throw new Error("Missing the required parameter 'branch' when calling getCiStatsV1CiStatsGet"); + } + // verify the required parameter 'workflow' is set + if (workflow === undefined || workflow === null) { + throw new Error("Missing the required parameter 'workflow' when calling getCiStatsV1CiStatsGet"); + } + // verify the required parameter 'startDate' is set + if (startDate === undefined || startDate === null) { + throw new Error("Missing the required parameter 'startDate' when calling getCiStatsV1CiStatsGet"); + } + // verify the required parameter 'endDate' is set + if (endDate === undefined || endDate === null) { + throw new Error("Missing the required parameter 'endDate' when calling getCiStatsV1CiStatsGet"); + } + + let pathParams = { + }; + let queryParams = { + 'repo': repo, + 'branch': branch, + 'workflow': workflow, + 'start_date': startDate, + 'end_date': endDate + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/stats', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Ci Stats + * @param {String} repo + * @param {String} branch + * @param {String} workflow + * @param {Date} startDate + * @param {Date} endDate + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getCiStatsV1CiStatsGet(repo, branch, workflow, startDate, endDate) { + return this.getCiStatsV1CiStatsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Insights + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getInsightsV1CiInsightsGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/insights', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Insights + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getInsightsV1CiInsightsGet() { + return this.getInsightsV1CiInsightsGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Insights + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getInsightsV1InsightsGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/insights', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Insights + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getInsightsV1InsightsGet() { + return this.getInsightsV1InsightsGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Jobs + * @param {Object} opts Optional parameters + * @param {Number} [machineId] + * @param {String} [state] + * @param {Number} [jobId] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getJobsV2JobsGetWithHttpInfo(opts) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + }; + let queryParams = { + 'machine_id': opts['machineId'], + 'state': opts['state'], + 'job_id': opts['jobId'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v2/jobs', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Jobs + * @param {Object} opts Optional parameters + * @param {Number} opts.machineId + * @param {String} opts.state + * @param {Number} opts.jobId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getJobsV2JobsGet(opts) { + return this.getJobsV2JobsGetWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Machines + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getMachinesV1MachinesGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/machines', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Machines + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getMachinesV1MachinesGet() { + return this.getMachinesV1MachinesGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Measurements Single + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getMeasurementsSingleV1MeasurementsSingleRunIdGetWithHttpInfo(runId) { + let postBody = null; + // verify the required parameter 'runId' is set + if (runId === undefined || runId === null) { + throw new Error("Missing the required parameter 'runId' when calling getMeasurementsSingleV1MeasurementsSingleRunIdGet"); + } + + let pathParams = { + 'run_id': runId + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/measurements/single/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Measurements Single + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getMeasurementsSingleV1MeasurementsSingleRunIdGet(runId) { + return this.getMeasurementsSingleV1MeasurementsSingleRunIdGetWithHttpInfo(runId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Network + * @param {Object} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getNetworkV1NetworkRunIdGetWithHttpInfo(runId) { + let postBody = null; + // verify the required parameter 'runId' is set + if (runId === undefined || runId === null) { + throw new Error("Missing the required parameter 'runId' when calling getNetworkV1NetworkRunIdGet"); + } + + let pathParams = { + 'run_id': runId + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/network/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Network + * @param {Object} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getNetworkV1NetworkRunIdGet(runId) { + return this.getNetworkV1NetworkRunIdGetWithHttpInfo(runId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Notes + * @param {Object} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getNotesV1NotesRunIdGetWithHttpInfo(runId) { + let postBody = null; + // verify the required parameter 'runId' is set + if (runId === undefined || runId === null) { + throw new Error("Missing the required parameter 'runId' when calling getNotesV1NotesRunIdGet"); + } + + let pathParams = { + 'run_id': runId + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/notes/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Notes + * @param {Object} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getNotesV1NotesRunIdGet(runId) { + return this.getNotesV1NotesRunIdGetWithHttpInfo(runId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Optimizations + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getOptimizationsV1OptimizationsRunIdGetWithHttpInfo(runId) { + let postBody = null; + // verify the required parameter 'runId' is set + if (runId === undefined || runId === null) { + throw new Error("Missing the required parameter 'runId' when calling getOptimizationsV1OptimizationsRunIdGet"); + } + + let pathParams = { + 'run_id': runId + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/optimizations/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Optimizations + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getOptimizationsV1OptimizationsRunIdGet(runId) { + return this.getOptimizationsV1OptimizationsRunIdGetWithHttpInfo(runId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Phase Stats Single + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getPhaseStatsSingleV1PhaseStatsSingleRunIdGetWithHttpInfo(runId) { + let postBody = null; + // verify the required parameter 'runId' is set + if (runId === undefined || runId === null) { + throw new Error("Missing the required parameter 'runId' when calling getPhaseStatsSingleV1PhaseStatsSingleRunIdGet"); + } + + let pathParams = { + 'run_id': runId + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/phase_stats/single/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Phase Stats Single + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getPhaseStatsSingleV1PhaseStatsSingleRunIdGet(runId) { + return this.getPhaseStatsSingleV1PhaseStatsSingleRunIdGetWithHttpInfo(runId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Repositories + * @param {Object} opts Optional parameters + * @param {String} [uri] + * @param {String} [branch] + * @param {Number} [machineId] + * @param {String} [machine] + * @param {String} [filename] + * @param {String} [sortBy = 'name')] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getRepositoriesV1RepositoriesGetWithHttpInfo(opts) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + }; + let queryParams = { + 'uri': opts['uri'], + 'branch': opts['branch'], + 'machine_id': opts['machineId'], + 'machine': opts['machine'], + 'filename': opts['filename'], + 'sort_by': opts['sortBy'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/repositories', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Repositories + * @param {Object} opts Optional parameters + * @param {String} opts.uri + * @param {String} opts.branch + * @param {Number} opts.machineId + * @param {String} opts.machine + * @param {String} opts.filename + * @param {String} opts.sortBy (default to 'name') + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getRepositoriesV1RepositoriesGet(opts) { + return this.getRepositoriesV1RepositoriesGetWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Run + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getRunV2RunRunIdGetWithHttpInfo(runId) { + let postBody = null; + // verify the required parameter 'runId' is set + if (runId === undefined || runId === null) { + throw new Error("Missing the required parameter 'runId' when calling getRunV2RunRunIdGet"); + } + + let pathParams = { + 'run_id': runId + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v2/run/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Run + * @param {String} runId + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getRunV2RunRunIdGet(runId) { + return this.getRunV2RunRunIdGetWithHttpInfo(runId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Runs + * @param {Object} opts Optional parameters + * @param {String} [uri] + * @param {String} [branch] + * @param {Number} [machineId] + * @param {String} [machine] + * @param {String} [filename] + * @param {Number} [jobId] + * @param {Boolean} [failed] + * @param {Number} [limit] + * @param {Object} [uriMode] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getRunsV2RunsGetWithHttpInfo(opts) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + }; + let queryParams = { + 'uri': opts['uri'], + 'branch': opts['branch'], + 'machine_id': opts['machineId'], + 'machine': opts['machine'], + 'filename': opts['filename'], + 'job_id': opts['jobId'], + 'failed': opts['failed'], + 'limit': opts['limit'], + 'uri_mode': opts['uriMode'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v2/runs', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Runs + * @param {Object} opts Optional parameters + * @param {String} opts.uri + * @param {String} opts.branch + * @param {Number} opts.machineId + * @param {String} opts.machine + * @param {String} opts.filename + * @param {Number} opts.jobId + * @param {Boolean} opts.failed + * @param {Number} opts.limit + * @param {Object} opts.uriMode + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getRunsV2RunsGet(opts) { + return this.getRunsV2RunsGetWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Timeline Badge + * @param {String} metric + * @param {String} uri + * @param {Object} opts Optional parameters + * @param {String} [detailName] + * @param {Number} [machineId] + * @param {String} [branch] + * @param {String} [filename] + * @param {String} [unit = 'watt-hours')] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getTimelineBadgeV1BadgeTimelineGetWithHttpInfo(metric, uri, opts) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'metric' is set + if (metric === undefined || metric === null) { + throw new Error("Missing the required parameter 'metric' when calling getTimelineBadgeV1BadgeTimelineGet"); + } + // verify the required parameter 'uri' is set + if (uri === undefined || uri === null) { + throw new Error("Missing the required parameter 'uri' when calling getTimelineBadgeV1BadgeTimelineGet"); + } + + let pathParams = { + }; + let queryParams = { + 'metric': metric, + 'uri': uri, + 'detail_name': opts['detailName'], + 'machine_id': opts['machineId'], + 'branch': opts['branch'], + 'filename': opts['filename'], + 'unit': opts['unit'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/badge/timeline', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Timeline Badge + * @param {String} metric + * @param {String} uri + * @param {Object} opts Optional parameters + * @param {String} opts.detailName + * @param {Number} opts.machineId + * @param {String} opts.branch + * @param {String} opts.filename + * @param {String} opts.unit (default to 'watt-hours') + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getTimelineBadgeV1BadgeTimelineGet(metric, uri, opts) { + return this.getTimelineBadgeV1BadgeTimelineGetWithHttpInfo(metric, uri, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Timeline Stats + * @param {String} uri + * @param {Number} machineId + * @param {Object} opts Optional parameters + * @param {String} [branch] + * @param {String} [filename] + * @param {Date} [startDate] + * @param {Date} [endDate] + * @param {String} [metric] + * @param {String} [phase] + * @param {String} [sorting] + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getTimelineStatsV1TimelineGetWithHttpInfo(uri, machineId, opts) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'uri' is set + if (uri === undefined || uri === null) { + throw new Error("Missing the required parameter 'uri' when calling getTimelineStatsV1TimelineGet"); + } + // verify the required parameter 'machineId' is set + if (machineId === undefined || machineId === null) { + throw new Error("Missing the required parameter 'machineId' when calling getTimelineStatsV1TimelineGet"); + } + + let pathParams = { + }; + let queryParams = { + 'uri': uri, + 'machine_id': machineId, + 'branch': opts['branch'], + 'filename': opts['filename'], + 'start_date': opts['startDate'], + 'end_date': opts['endDate'], + 'metric': opts['metric'], + 'phase': opts['phase'], + 'sorting': opts['sorting'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/timeline', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Timeline Stats + * @param {String} uri + * @param {Number} machineId + * @param {Object} opts Optional parameters + * @param {String} opts.branch + * @param {String} opts.filename + * @param {Date} opts.startDate + * @param {Date} opts.endDate + * @param {String} opts.metric + * @param {String} opts.phase + * @param {String} opts.sorting + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getTimelineStatsV1TimelineGet(uri, machineId, opts) { + return this.getTimelineStatsV1TimelineGetWithHttpInfo(uri, machineId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get User Settings + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getUserSettingsV1UserSettingsGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/user/settings', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get User Settings + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getUserSettingsV1UserSettingsGet() { + return this.getUserSettingsV1UserSettingsGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Get Watchlist + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + getWatchlistV1WatchlistGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/watchlist', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get Watchlist + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + getWatchlistV1WatchlistGet() { + return this.getWatchlistV1WatchlistGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Home + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + homeGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Home + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + homeGet() { + return this.homeGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Old V1 Jobs Endpoint + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + oldV1JobsEndpointV1JobsGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/jobs', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Old V1 Jobs Endpoint + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + oldV1JobsEndpointV1JobsGet() { + return this.oldV1JobsEndpointV1JobsGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Old V1 Run Endpoint + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + oldV1RunEndpointV1RunRunIdGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/run/{run_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Old V1 Run Endpoint + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + oldV1RunEndpointV1RunRunIdGet() { + return this.oldV1RunEndpointV1RunRunIdGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Old V1 Runs Endpoint + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + oldV1RunsEndpointV1RunsGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/runs', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Old V1 Runs Endpoint + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + oldV1RunsEndpointV1RunsGet() { + return this.oldV1RunsEndpointV1RunsGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Post Ci Measurement Add Deprecated + * @param {module:model/CIMeasurementOld} cIMeasurementOld + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + postCiMeasurementAddDeprecatedV1CiMeasurementAddPostWithHttpInfo(cIMeasurementOld) { + let postBody = cIMeasurementOld; + // verify the required parameter 'cIMeasurementOld' is set + if (cIMeasurementOld === undefined || cIMeasurementOld === null) { + throw new Error("Missing the required parameter 'cIMeasurementOld' when calling postCiMeasurementAddDeprecatedV1CiMeasurementAddPost"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/ci/measurement/add', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Post Ci Measurement Add Deprecated + * @param {module:model/CIMeasurementOld} cIMeasurementOld + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + postCiMeasurementAddDeprecatedV1CiMeasurementAddPost(cIMeasurementOld) { + return this.postCiMeasurementAddDeprecatedV1CiMeasurementAddPostWithHttpInfo(cIMeasurementOld) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Post Ci Measurement Add + * @param {module:model/CIMeasurement} cIMeasurement + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + postCiMeasurementAddV2CiMeasurementAddPostWithHttpInfo(cIMeasurement) { + let postBody = cIMeasurement; + // verify the required parameter 'cIMeasurement' is set + if (cIMeasurement === undefined || cIMeasurement === null) { + throw new Error("Missing the required parameter 'cIMeasurement' when calling postCiMeasurementAddV2CiMeasurementAddPost"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v2/ci/measurement/add', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Post Ci Measurement Add + * @param {module:model/CIMeasurement} cIMeasurement + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + postCiMeasurementAddV2CiMeasurementAddPost(cIMeasurement) { + return this.postCiMeasurementAddV2CiMeasurementAddPostWithHttpInfo(cIMeasurement) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Robots Txt + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + robotsTxtRobotsTxtGetWithHttpInfo() { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/robots.txt', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Robots Txt + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + robotsTxtRobotsTxtGet() { + return this.robotsTxtRobotsTxtGetWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Software Add + * @param {module:model/Software} software + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + softwareAddV1SoftwareAddPostWithHttpInfo(software) { + let postBody = software; + // verify the required parameter 'software' is set + if (software === undefined || software === null) { + throw new Error("Missing the required parameter 'software' when calling softwareAddV1SoftwareAddPost"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/software/add', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Software Add + * @param {module:model/Software} software + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + softwareAddV1SoftwareAddPost(software) { + return this.softwareAddV1SoftwareAddPostWithHttpInfo(software) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Update Job + * @param {module:model/JobChange} jobChange + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + updateJobV1JobPutWithHttpInfo(jobChange) { + let postBody = jobChange; + // verify the required parameter 'jobChange' is set + if (jobChange === undefined || jobChange === null) { + throw new Error("Missing the required parameter 'jobChange' when calling updateJobV1JobPut"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/job', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Update Job + * @param {module:model/JobChange} jobChange + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + updateJobV1JobPut(jobChange) { + return this.updateJobV1JobPutWithHttpInfo(jobChange) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Update User Setting + * @param {module:model/UserSetting} userSetting + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response + */ + updateUserSettingV1UserSettingPutWithHttpInfo(userSetting) { + let postBody = userSetting; + // verify the required parameter 'userSetting' is set + if (userSetting === undefined || userSetting === null) { + throw new Error("Missing the required parameter 'userSetting' when calling updateUserSettingV1UserSettingPut"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['Header']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/v1/user/setting', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Update User Setting + * @param {module:model/UserSetting} userSetting + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} + */ + updateUserSettingV1UserSettingPut(userSetting) { + return this.updateUserSettingV1UserSettingPutWithHttpInfo(userSetting) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/frontend/js/api/src/index.js b/frontend/js/api/src/index.js new file mode 100644 index 00000000..77fac69e --- /dev/null +++ b/frontend/js/api/src/index.js @@ -0,0 +1,265 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import ApiClient from './ApiClient'; +import CIMeasurement from './model/CIMeasurement'; +import CIMeasurementOld from './model/CIMeasurementOld'; +import CarbonIntensityG from './model/CarbonIntensityG'; +import CarbonUg from './model/CarbonUg'; +import CbCompanyUuid from './model/CbCompanyUuid'; +import CbMachineUuid from './model/CbMachineUuid'; +import CbProjectUuid from './model/CbProjectUuid'; +import City from './model/City'; +import Co2Eq from './model/Co2Eq'; +import Co2I from './model/Co2I'; +import Email from './model/Email'; +import FilterMachine from './model/FilterMachine'; +import FilterProject from './model/FilterProject'; +import FilterTags from './model/FilterTags'; +import FilterType from './model/FilterType'; +import HTTPValidationError from './model/HTTPValidationError'; +import ImageUrl from './model/ImageUrl'; +import Ip from './model/Ip'; +import JobChange from './model/JobChange'; +import Lat from './model/Lat'; +import Lon from './model/Lon'; +import Note from './model/Note'; +import ProjectId from './model/ProjectId'; +import Software from './model/Software'; +import UsageScenarioVariables from './model/UsageScenarioVariables'; +import UserSetting from './model/UserSetting'; +import ValidationError from './model/ValidationError'; +import ValidationErrorLocInner from './model/ValidationErrorLocInner'; +import Value from './model/Value'; +import DefaultApi from './api/DefaultApi'; + + +/** +* JS API client generated by OpenAPI Generator.
+* The index module provides access to constructors for all the classes which comprise the public API. +*

+* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: +*

+* var FastApi = require('index'); // See note below*.
+* var xxxSvc = new FastApi.XxxApi(); // Allocate the API class we're going to use.
+* var yyyModel = new FastApi.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+* *NOTE: For a top-level AMD script, use require(['index'], function(){...}) +* and put the application logic within the callback function. +*

+*

+* A non-AMD browser application (discouraged) might do something like this: +*

+* var xxxSvc = new FastApi.XxxApi(); // Allocate the API class we're going to use.
+* var yyy = new FastApi.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+*

+* @module index +* @version 0.1.0 +*/ +export { + /** + * The ApiClient constructor. + * @property {module:ApiClient} + */ + ApiClient, + + /** + * The CIMeasurement model constructor. + * @property {module:model/CIMeasurement} + */ + CIMeasurement, + + /** + * The CIMeasurementOld model constructor. + * @property {module:model/CIMeasurementOld} + */ + CIMeasurementOld, + + /** + * The CarbonIntensityG model constructor. + * @property {module:model/CarbonIntensityG} + */ + CarbonIntensityG, + + /** + * The CarbonUg model constructor. + * @property {module:model/CarbonUg} + */ + CarbonUg, + + /** + * The CbCompanyUuid model constructor. + * @property {module:model/CbCompanyUuid} + */ + CbCompanyUuid, + + /** + * The CbMachineUuid model constructor. + * @property {module:model/CbMachineUuid} + */ + CbMachineUuid, + + /** + * The CbProjectUuid model constructor. + * @property {module:model/CbProjectUuid} + */ + CbProjectUuid, + + /** + * The City model constructor. + * @property {module:model/City} + */ + City, + + /** + * The Co2Eq model constructor. + * @property {module:model/Co2Eq} + */ + Co2Eq, + + /** + * The Co2I model constructor. + * @property {module:model/Co2I} + */ + Co2I, + + /** + * The Email model constructor. + * @property {module:model/Email} + */ + Email, + + /** + * The FilterMachine model constructor. + * @property {module:model/FilterMachine} + */ + FilterMachine, + + /** + * The FilterProject model constructor. + * @property {module:model/FilterProject} + */ + FilterProject, + + /** + * The FilterTags model constructor. + * @property {module:model/FilterTags} + */ + FilterTags, + + /** + * The FilterType model constructor. + * @property {module:model/FilterType} + */ + FilterType, + + /** + * The HTTPValidationError model constructor. + * @property {module:model/HTTPValidationError} + */ + HTTPValidationError, + + /** + * The ImageUrl model constructor. + * @property {module:model/ImageUrl} + */ + ImageUrl, + + /** + * The Ip model constructor. + * @property {module:model/Ip} + */ + Ip, + + /** + * The JobChange model constructor. + * @property {module:model/JobChange} + */ + JobChange, + + /** + * The Lat model constructor. + * @property {module:model/Lat} + */ + Lat, + + /** + * The Lon model constructor. + * @property {module:model/Lon} + */ + Lon, + + /** + * The Note model constructor. + * @property {module:model/Note} + */ + Note, + + /** + * The ProjectId model constructor. + * @property {module:model/ProjectId} + */ + ProjectId, + + /** + * The Software model constructor. + * @property {module:model/Software} + */ + Software, + + /** + * The UsageScenarioVariables model constructor. + * @property {module:model/UsageScenarioVariables} + */ + UsageScenarioVariables, + + /** + * The UserSetting model constructor. + * @property {module:model/UserSetting} + */ + UserSetting, + + /** + * The ValidationError model constructor. + * @property {module:model/ValidationError} + */ + ValidationError, + + /** + * The ValidationErrorLocInner model constructor. + * @property {module:model/ValidationErrorLocInner} + */ + ValidationErrorLocInner, + + /** + * The Value model constructor. + * @property {module:model/Value} + */ + Value, + + /** + * The DefaultApi service constructor. + * @property {module:api/DefaultApi} + */ + DefaultApi +}; diff --git a/frontend/js/api/src/model/CIMeasurement.js b/frontend/js/api/src/model/CIMeasurement.js new file mode 100644 index 00000000..b6fd0a29 --- /dev/null +++ b/frontend/js/api/src/model/CIMeasurement.js @@ -0,0 +1,382 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import CarbonIntensityG from './CarbonIntensityG'; +import CarbonUg from './CarbonUg'; +import City from './City'; +import FilterMachine from './FilterMachine'; +import FilterProject from './FilterProject'; +import FilterTags from './FilterTags'; +import FilterType from './FilterType'; +import Ip from './Ip'; +import Lat from './Lat'; +import Lon from './Lon'; +import Note from './Note'; + +/** + * The CIMeasurement model module. + * @module model/CIMeasurement + * @version 0.1.0 + */ +class CIMeasurement { + /** + * Constructs a new CIMeasurement. + * @alias module:model/CIMeasurement + * @extends Object + * @param energyUj {Number} + * @param repo {String} + * @param branch {String} + * @param cpu {String} + * @param cpuUtilAvg {Number} + * @param commitHash {String} + * @param workflow {String} + * @param runId {String} + * @param source {String} + * @param label {String} + * @param durationUs {Number} + */ + constructor(energyUj, repo, branch, cpu, cpuUtilAvg, commitHash, workflow, runId, source, label, durationUs) { + + CIMeasurement.initialize(this, energyUj, repo, branch, cpu, cpuUtilAvg, commitHash, workflow, runId, source, label, durationUs); + } + + /** + * Initializes the fields of this object. + * 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, energyUj, repo, branch, cpu, cpuUtilAvg, commitHash, workflow, runId, source, label, durationUs) { + obj['energy_uj'] = energyUj; + obj['repo'] = repo; + obj['branch'] = branch; + obj['cpu'] = cpu; + obj['cpu_util_avg'] = cpuUtilAvg; + obj['commit_hash'] = commitHash; + obj['workflow'] = workflow; + obj['run_id'] = runId; + obj['source'] = source; + obj['label'] = label; + obj['duration_us'] = durationUs; + } + + /** + * Constructs a CIMeasurement from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/CIMeasurement} obj Optional instance to populate. + * @return {module:model/CIMeasurement} The populated CIMeasurement instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new CIMeasurement(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('energy_uj')) { + obj['energy_uj'] = ApiClient.convertToType(data['energy_uj'], 'Number'); + } + if (data.hasOwnProperty('repo')) { + obj['repo'] = ApiClient.convertToType(data['repo'], 'String'); + } + if (data.hasOwnProperty('branch')) { + obj['branch'] = ApiClient.convertToType(data['branch'], 'String'); + } + if (data.hasOwnProperty('cpu')) { + obj['cpu'] = ApiClient.convertToType(data['cpu'], 'String'); + } + if (data.hasOwnProperty('cpu_util_avg')) { + obj['cpu_util_avg'] = ApiClient.convertToType(data['cpu_util_avg'], 'Number'); + } + if (data.hasOwnProperty('commit_hash')) { + obj['commit_hash'] = ApiClient.convertToType(data['commit_hash'], 'String'); + } + if (data.hasOwnProperty('workflow')) { + obj['workflow'] = ApiClient.convertToType(data['workflow'], 'String'); + } + if (data.hasOwnProperty('run_id')) { + obj['run_id'] = ApiClient.convertToType(data['run_id'], 'String'); + } + if (data.hasOwnProperty('source')) { + obj['source'] = ApiClient.convertToType(data['source'], 'String'); + } + if (data.hasOwnProperty('label')) { + obj['label'] = ApiClient.convertToType(data['label'], 'String'); + } + if (data.hasOwnProperty('duration_us')) { + obj['duration_us'] = ApiClient.convertToType(data['duration_us'], 'Number'); + } + if (data.hasOwnProperty('workflow_name')) { + obj['workflow_name'] = ApiClient.convertToType(data['workflow_name'], 'String'); + } + if (data.hasOwnProperty('filter_type')) { + obj['filter_type'] = FilterType.constructFromObject(data['filter_type']); + } + if (data.hasOwnProperty('filter_project')) { + obj['filter_project'] = FilterProject.constructFromObject(data['filter_project']); + } + if (data.hasOwnProperty('filter_machine')) { + obj['filter_machine'] = FilterMachine.constructFromObject(data['filter_machine']); + } + if (data.hasOwnProperty('filter_tags')) { + obj['filter_tags'] = FilterTags.constructFromObject(data['filter_tags']); + } + if (data.hasOwnProperty('lat')) { + obj['lat'] = Lat.constructFromObject(data['lat']); + } + if (data.hasOwnProperty('lon')) { + obj['lon'] = Lon.constructFromObject(data['lon']); + } + if (data.hasOwnProperty('city')) { + obj['city'] = City.constructFromObject(data['city']); + } + if (data.hasOwnProperty('carbon_intensity_g')) { + obj['carbon_intensity_g'] = CarbonIntensityG.constructFromObject(data['carbon_intensity_g']); + } + if (data.hasOwnProperty('carbon_ug')) { + obj['carbon_ug'] = CarbonUg.constructFromObject(data['carbon_ug']); + } + if (data.hasOwnProperty('ip')) { + obj['ip'] = Ip.constructFromObject(data['ip']); + } + if (data.hasOwnProperty('note')) { + obj['note'] = Note.constructFromObject(data['note']); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to CIMeasurement. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to CIMeasurement. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of CIMeasurement.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['repo'] && !(typeof data['repo'] === 'string' || data['repo'] instanceof String)) { + throw new Error("Expected the field `repo` to be a primitive type in the JSON string but got " + data['repo']); + } + // ensure the json data is a string + if (data['branch'] && !(typeof data['branch'] === 'string' || data['branch'] instanceof String)) { + throw new Error("Expected the field `branch` to be a primitive type in the JSON string but got " + data['branch']); + } + // ensure the json data is a string + if (data['cpu'] && !(typeof data['cpu'] === 'string' || data['cpu'] instanceof String)) { + throw new Error("Expected the field `cpu` to be a primitive type in the JSON string but got " + data['cpu']); + } + // ensure the json data is a string + if (data['commit_hash'] && !(typeof data['commit_hash'] === 'string' || data['commit_hash'] instanceof String)) { + throw new Error("Expected the field `commit_hash` to be a primitive type in the JSON string but got " + data['commit_hash']); + } + // ensure the json data is a string + if (data['workflow'] && !(typeof data['workflow'] === 'string' || data['workflow'] instanceof String)) { + throw new Error("Expected the field `workflow` to be a primitive type in the JSON string but got " + data['workflow']); + } + // ensure the json data is a string + if (data['run_id'] && !(typeof data['run_id'] === 'string' || data['run_id'] instanceof String)) { + throw new Error("Expected the field `run_id` to be a primitive type in the JSON string but got " + data['run_id']); + } + // ensure the json data is a string + if (data['source'] && !(typeof data['source'] === 'string' || data['source'] instanceof String)) { + throw new Error("Expected the field `source` to be a primitive type in the JSON string but got " + data['source']); + } + // ensure the json data is a string + if (data['label'] && !(typeof data['label'] === 'string' || data['label'] instanceof String)) { + throw new Error("Expected the field `label` to be a primitive type in the JSON string but got " + data['label']); + } + // ensure the json data is a string + if (data['workflow_name'] && !(typeof data['workflow_name'] === 'string' || data['workflow_name'] instanceof String)) { + throw new Error("Expected the field `workflow_name` to be a primitive type in the JSON string but got " + data['workflow_name']); + } + // validate the optional field `filter_type` + if (data['filter_type']) { // data not null + FilterType.validateJSON(data['filter_type']); + } + // validate the optional field `filter_project` + if (data['filter_project']) { // data not null + FilterProject.validateJSON(data['filter_project']); + } + // validate the optional field `filter_machine` + if (data['filter_machine']) { // data not null + FilterMachine.validateJSON(data['filter_machine']); + } + // validate the optional field `filter_tags` + if (data['filter_tags']) { // data not null + FilterTags.validateJSON(data['filter_tags']); + } + // validate the optional field `lat` + if (data['lat']) { // data not null + Lat.validateJSON(data['lat']); + } + // validate the optional field `lon` + if (data['lon']) { // data not null + Lon.validateJSON(data['lon']); + } + // validate the optional field `city` + if (data['city']) { // data not null + City.validateJSON(data['city']); + } + // validate the optional field `carbon_intensity_g` + if (data['carbon_intensity_g']) { // data not null + CarbonIntensityG.validateJSON(data['carbon_intensity_g']); + } + // validate the optional field `carbon_ug` + if (data['carbon_ug']) { // data not null + CarbonUg.validateJSON(data['carbon_ug']); + } + // validate the optional field `ip` + if (data['ip']) { // data not null + Ip.validateJSON(data['ip']); + } + // validate the optional field `note` + if (data['note']) { // data not null + Note.validateJSON(data['note']); + } + + return true; + } + + +} + +CIMeasurement.RequiredProperties = ["energy_uj", "repo", "branch", "cpu", "cpu_util_avg", "commit_hash", "workflow", "run_id", "source", "label", "duration_us"]; + +/** + * @member {Number} energy_uj + */ +CIMeasurement.prototype['energy_uj'] = undefined; + +/** + * @member {String} repo + */ +CIMeasurement.prototype['repo'] = undefined; + +/** + * @member {String} branch + */ +CIMeasurement.prototype['branch'] = undefined; + +/** + * @member {String} cpu + */ +CIMeasurement.prototype['cpu'] = undefined; + +/** + * @member {Number} cpu_util_avg + */ +CIMeasurement.prototype['cpu_util_avg'] = undefined; + +/** + * @member {String} commit_hash + */ +CIMeasurement.prototype['commit_hash'] = undefined; + +/** + * @member {String} workflow + */ +CIMeasurement.prototype['workflow'] = undefined; + +/** + * @member {String} run_id + */ +CIMeasurement.prototype['run_id'] = undefined; + +/** + * @member {String} source + */ +CIMeasurement.prototype['source'] = undefined; + +/** + * @member {String} label + */ +CIMeasurement.prototype['label'] = undefined; + +/** + * @member {Number} duration_us + */ +CIMeasurement.prototype['duration_us'] = undefined; + +/** + * @member {String} workflow_name + */ +CIMeasurement.prototype['workflow_name'] = undefined; + +/** + * @member {module:model/FilterType} filter_type + */ +CIMeasurement.prototype['filter_type'] = undefined; + +/** + * @member {module:model/FilterProject} filter_project + */ +CIMeasurement.prototype['filter_project'] = undefined; + +/** + * @member {module:model/FilterMachine} filter_machine + */ +CIMeasurement.prototype['filter_machine'] = undefined; + +/** + * @member {module:model/FilterTags} filter_tags + */ +CIMeasurement.prototype['filter_tags'] = undefined; + +/** + * @member {module:model/Lat} lat + */ +CIMeasurement.prototype['lat'] = undefined; + +/** + * @member {module:model/Lon} lon + */ +CIMeasurement.prototype['lon'] = undefined; + +/** + * @member {module:model/City} city + */ +CIMeasurement.prototype['city'] = undefined; + +/** + * @member {module:model/CarbonIntensityG} carbon_intensity_g + */ +CIMeasurement.prototype['carbon_intensity_g'] = undefined; + +/** + * @member {module:model/CarbonUg} carbon_ug + */ +CIMeasurement.prototype['carbon_ug'] = undefined; + +/** + * @member {module:model/Ip} ip + */ +CIMeasurement.prototype['ip'] = undefined; + +/** + * @member {module:model/Note} note + */ +CIMeasurement.prototype['note'] = undefined; + + + + + + +export default CIMeasurement; + diff --git a/frontend/js/api/src/model/CIMeasurementOld.js b/frontend/js/api/src/model/CIMeasurementOld.js new file mode 100644 index 00000000..54c42667 --- /dev/null +++ b/frontend/js/api/src/model/CIMeasurementOld.js @@ -0,0 +1,370 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import CbCompanyUuid from './CbCompanyUuid'; +import CbMachineUuid from './CbMachineUuid'; +import CbProjectUuid from './CbProjectUuid'; +import City from './City'; +import Co2Eq from './Co2Eq'; +import Co2I from './Co2I'; +import Lat from './Lat'; +import Lon from './Lon'; +import ProjectId from './ProjectId'; + +/** + * The CIMeasurementOld model module. + * @module model/CIMeasurementOld + * @version 0.1.0 + */ +class CIMeasurementOld { + /** + * Constructs a new CIMeasurementOld. + * @alias module:model/CIMeasurementOld + * @extends Object + * @param energyValue {Number} + * @param energyUnit {String} + * @param repo {String} + * @param branch {String} + * @param cpu {String} + * @param cpuUtilAvg {Number} + * @param commitHash {String} + * @param workflow {String} + * @param runId {String} + * @param source {String} + * @param label {String} + * @param duration {Number} + */ + constructor(energyValue, energyUnit, repo, branch, cpu, cpuUtilAvg, commitHash, workflow, runId, source, label, duration) { + + CIMeasurementOld.initialize(this, energyValue, energyUnit, repo, branch, cpu, cpuUtilAvg, commitHash, workflow, runId, source, label, duration); + } + + /** + * Initializes the fields of this object. + * 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, energyValue, energyUnit, repo, branch, cpu, cpuUtilAvg, commitHash, workflow, runId, source, label, duration) { + obj['energy_value'] = energyValue; + obj['energy_unit'] = energyUnit; + obj['repo'] = repo; + obj['branch'] = branch; + obj['cpu'] = cpu; + obj['cpu_util_avg'] = cpuUtilAvg; + obj['commit_hash'] = commitHash; + obj['workflow'] = workflow; + obj['run_id'] = runId; + obj['source'] = source; + obj['label'] = label; + obj['duration'] = duration; + } + + /** + * Constructs a CIMeasurementOld from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/CIMeasurementOld} obj Optional instance to populate. + * @return {module:model/CIMeasurementOld} The populated CIMeasurementOld instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new CIMeasurementOld(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('energy_value')) { + obj['energy_value'] = ApiClient.convertToType(data['energy_value'], 'Number'); + } + if (data.hasOwnProperty('energy_unit')) { + obj['energy_unit'] = ApiClient.convertToType(data['energy_unit'], 'String'); + } + if (data.hasOwnProperty('repo')) { + obj['repo'] = ApiClient.convertToType(data['repo'], 'String'); + } + if (data.hasOwnProperty('branch')) { + obj['branch'] = ApiClient.convertToType(data['branch'], 'String'); + } + if (data.hasOwnProperty('cpu')) { + obj['cpu'] = ApiClient.convertToType(data['cpu'], 'String'); + } + if (data.hasOwnProperty('cpu_util_avg')) { + obj['cpu_util_avg'] = ApiClient.convertToType(data['cpu_util_avg'], 'Number'); + } + if (data.hasOwnProperty('commit_hash')) { + obj['commit_hash'] = ApiClient.convertToType(data['commit_hash'], 'String'); + } + if (data.hasOwnProperty('workflow')) { + obj['workflow'] = ApiClient.convertToType(data['workflow'], 'String'); + } + if (data.hasOwnProperty('run_id')) { + obj['run_id'] = ApiClient.convertToType(data['run_id'], 'String'); + } + if (data.hasOwnProperty('source')) { + obj['source'] = ApiClient.convertToType(data['source'], 'String'); + } + if (data.hasOwnProperty('label')) { + obj['label'] = ApiClient.convertToType(data['label'], 'String'); + } + if (data.hasOwnProperty('duration')) { + obj['duration'] = ApiClient.convertToType(data['duration'], 'Number'); + } + if (data.hasOwnProperty('workflow_name')) { + obj['workflow_name'] = ApiClient.convertToType(data['workflow_name'], 'String'); + } + if (data.hasOwnProperty('cb_company_uuid')) { + obj['cb_company_uuid'] = CbCompanyUuid.constructFromObject(data['cb_company_uuid']); + } + if (data.hasOwnProperty('cb_project_uuid')) { + obj['cb_project_uuid'] = CbProjectUuid.constructFromObject(data['cb_project_uuid']); + } + if (data.hasOwnProperty('cb_machine_uuid')) { + obj['cb_machine_uuid'] = CbMachineUuid.constructFromObject(data['cb_machine_uuid']); + } + if (data.hasOwnProperty('lat')) { + obj['lat'] = Lat.constructFromObject(data['lat']); + } + if (data.hasOwnProperty('lon')) { + obj['lon'] = Lon.constructFromObject(data['lon']); + } + if (data.hasOwnProperty('city')) { + obj['city'] = City.constructFromObject(data['city']); + } + if (data.hasOwnProperty('co2i')) { + obj['co2i'] = Co2I.constructFromObject(data['co2i']); + } + if (data.hasOwnProperty('co2eq')) { + obj['co2eq'] = Co2Eq.constructFromObject(data['co2eq']); + } + if (data.hasOwnProperty('project_id')) { + obj['project_id'] = ProjectId.constructFromObject(data['project_id']); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to CIMeasurementOld. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to CIMeasurementOld. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of CIMeasurementOld.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['energy_unit'] && !(typeof data['energy_unit'] === 'string' || data['energy_unit'] instanceof String)) { + throw new Error("Expected the field `energy_unit` to be a primitive type in the JSON string but got " + data['energy_unit']); + } + // ensure the json data is a string + if (data['repo'] && !(typeof data['repo'] === 'string' || data['repo'] instanceof String)) { + throw new Error("Expected the field `repo` to be a primitive type in the JSON string but got " + data['repo']); + } + // ensure the json data is a string + if (data['branch'] && !(typeof data['branch'] === 'string' || data['branch'] instanceof String)) { + throw new Error("Expected the field `branch` to be a primitive type in the JSON string but got " + data['branch']); + } + // ensure the json data is a string + if (data['cpu'] && !(typeof data['cpu'] === 'string' || data['cpu'] instanceof String)) { + throw new Error("Expected the field `cpu` to be a primitive type in the JSON string but got " + data['cpu']); + } + // ensure the json data is a string + if (data['commit_hash'] && !(typeof data['commit_hash'] === 'string' || data['commit_hash'] instanceof String)) { + throw new Error("Expected the field `commit_hash` to be a primitive type in the JSON string but got " + data['commit_hash']); + } + // ensure the json data is a string + if (data['workflow'] && !(typeof data['workflow'] === 'string' || data['workflow'] instanceof String)) { + throw new Error("Expected the field `workflow` to be a primitive type in the JSON string but got " + data['workflow']); + } + // ensure the json data is a string + if (data['run_id'] && !(typeof data['run_id'] === 'string' || data['run_id'] instanceof String)) { + throw new Error("Expected the field `run_id` to be a primitive type in the JSON string but got " + data['run_id']); + } + // ensure the json data is a string + if (data['source'] && !(typeof data['source'] === 'string' || data['source'] instanceof String)) { + throw new Error("Expected the field `source` to be a primitive type in the JSON string but got " + data['source']); + } + // ensure the json data is a string + if (data['label'] && !(typeof data['label'] === 'string' || data['label'] instanceof String)) { + throw new Error("Expected the field `label` to be a primitive type in the JSON string but got " + data['label']); + } + // ensure the json data is a string + if (data['workflow_name'] && !(typeof data['workflow_name'] === 'string' || data['workflow_name'] instanceof String)) { + throw new Error("Expected the field `workflow_name` to be a primitive type in the JSON string but got " + data['workflow_name']); + } + // validate the optional field `cb_company_uuid` + if (data['cb_company_uuid']) { // data not null + CbCompanyUuid.validateJSON(data['cb_company_uuid']); + } + // validate the optional field `cb_project_uuid` + if (data['cb_project_uuid']) { // data not null + CbProjectUuid.validateJSON(data['cb_project_uuid']); + } + // validate the optional field `cb_machine_uuid` + if (data['cb_machine_uuid']) { // data not null + CbMachineUuid.validateJSON(data['cb_machine_uuid']); + } + // validate the optional field `lat` + if (data['lat']) { // data not null + Lat.validateJSON(data['lat']); + } + // validate the optional field `lon` + if (data['lon']) { // data not null + Lon.validateJSON(data['lon']); + } + // validate the optional field `city` + if (data['city']) { // data not null + City.validateJSON(data['city']); + } + // validate the optional field `co2i` + if (data['co2i']) { // data not null + Co2I.validateJSON(data['co2i']); + } + // validate the optional field `co2eq` + if (data['co2eq']) { // data not null + Co2Eq.validateJSON(data['co2eq']); + } + // validate the optional field `project_id` + if (data['project_id']) { // data not null + ProjectId.validateJSON(data['project_id']); + } + + return true; + } + + +} + +CIMeasurementOld.RequiredProperties = ["energy_value", "energy_unit", "repo", "branch", "cpu", "cpu_util_avg", "commit_hash", "workflow", "run_id", "source", "label", "duration"]; + +/** + * @member {Number} energy_value + */ +CIMeasurementOld.prototype['energy_value'] = undefined; + +/** + * @member {String} energy_unit + */ +CIMeasurementOld.prototype['energy_unit'] = undefined; + +/** + * @member {String} repo + */ +CIMeasurementOld.prototype['repo'] = undefined; + +/** + * @member {String} branch + */ +CIMeasurementOld.prototype['branch'] = undefined; + +/** + * @member {String} cpu + */ +CIMeasurementOld.prototype['cpu'] = undefined; + +/** + * @member {Number} cpu_util_avg + */ +CIMeasurementOld.prototype['cpu_util_avg'] = undefined; + +/** + * @member {String} commit_hash + */ +CIMeasurementOld.prototype['commit_hash'] = undefined; + +/** + * @member {String} workflow + */ +CIMeasurementOld.prototype['workflow'] = undefined; + +/** + * @member {String} run_id + */ +CIMeasurementOld.prototype['run_id'] = undefined; + +/** + * @member {String} source + */ +CIMeasurementOld.prototype['source'] = undefined; + +/** + * @member {String} label + */ +CIMeasurementOld.prototype['label'] = undefined; + +/** + * @member {Number} duration + */ +CIMeasurementOld.prototype['duration'] = undefined; + +/** + * @member {String} workflow_name + */ +CIMeasurementOld.prototype['workflow_name'] = undefined; + +/** + * @member {module:model/CbCompanyUuid} cb_company_uuid + */ +CIMeasurementOld.prototype['cb_company_uuid'] = undefined; + +/** + * @member {module:model/CbProjectUuid} cb_project_uuid + */ +CIMeasurementOld.prototype['cb_project_uuid'] = undefined; + +/** + * @member {module:model/CbMachineUuid} cb_machine_uuid + */ +CIMeasurementOld.prototype['cb_machine_uuid'] = undefined; + +/** + * @member {module:model/Lat} lat + */ +CIMeasurementOld.prototype['lat'] = undefined; + +/** + * @member {module:model/Lon} lon + */ +CIMeasurementOld.prototype['lon'] = undefined; + +/** + * @member {module:model/City} city + */ +CIMeasurementOld.prototype['city'] = undefined; + +/** + * @member {module:model/Co2I} co2i + */ +CIMeasurementOld.prototype['co2i'] = undefined; + +/** + * @member {module:model/Co2Eq} co2eq + */ +CIMeasurementOld.prototype['co2eq'] = undefined; + +/** + * @member {module:model/ProjectId} project_id + */ +CIMeasurementOld.prototype['project_id'] = undefined; + + + + + + +export default CIMeasurementOld; + diff --git a/frontend/js/api/src/model/CarbonIntensityG.js b/frontend/js/api/src/model/CarbonIntensityG.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/CarbonIntensityG.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/CarbonUg.js b/frontend/js/api/src/model/CarbonUg.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/CarbonUg.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/CbCompanyUuid.js b/frontend/js/api/src/model/CbCompanyUuid.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/CbCompanyUuid.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/CbMachineUuid.js b/frontend/js/api/src/model/CbMachineUuid.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/CbMachineUuid.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/CbProjectUuid.js b/frontend/js/api/src/model/CbProjectUuid.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/CbProjectUuid.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/City.js b/frontend/js/api/src/model/City.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/City.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Co2Eq.js b/frontend/js/api/src/model/Co2Eq.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Co2Eq.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Co2I.js b/frontend/js/api/src/model/Co2I.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Co2I.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Email.js b/frontend/js/api/src/model/Email.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Email.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/FilterMachine.js b/frontend/js/api/src/model/FilterMachine.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/FilterMachine.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/FilterProject.js b/frontend/js/api/src/model/FilterProject.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/FilterProject.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/FilterTags.js b/frontend/js/api/src/model/FilterTags.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/FilterTags.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/FilterType.js b/frontend/js/api/src/model/FilterType.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/FilterType.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/HTTPValidationError.js b/frontend/js/api/src/model/HTTPValidationError.js new file mode 100644 index 00000000..a9eeb0f1 --- /dev/null +++ b/frontend/js/api/src/model/HTTPValidationError.js @@ -0,0 +1,94 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import ValidationError from './ValidationError'; + +/** + * The HTTPValidationError model module. + * @module model/HTTPValidationError + * @version 0.1.0 + */ +class HTTPValidationError { + /** + * Constructs a new HTTPValidationError. + * @alias module:model/HTTPValidationError + */ + constructor() { + + HTTPValidationError.initialize(this); + } + + /** + * Initializes the fields of this object. + * 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) { + } + + /** + * Constructs a HTTPValidationError from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HTTPValidationError} obj Optional instance to populate. + * @return {module:model/HTTPValidationError} The populated HTTPValidationError instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new HTTPValidationError(); + + if (data.hasOwnProperty('detail')) { + obj['detail'] = ApiClient.convertToType(data['detail'], [ValidationError]); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to HTTPValidationError. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to HTTPValidationError. + */ + static validateJSON(data) { + if (data['detail']) { // data not null + // ensure the json data is an array + if (!Array.isArray(data['detail'])) { + throw new Error("Expected the field `detail` to be an array in the JSON data but got " + data['detail']); + } + // validate the optional field `detail` (array) + for (const item of data['detail']) { + ValidationError.validateJSON(item); + }; + } + + return true; + } + + +} + + + +/** + * @member {Array.} detail + */ +HTTPValidationError.prototype['detail'] = undefined; + + + + + + +export default HTTPValidationError; + diff --git a/frontend/js/api/src/model/ImageUrl.js b/frontend/js/api/src/model/ImageUrl.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/ImageUrl.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Ip.js b/frontend/js/api/src/model/Ip.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Ip.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/JobChange.js b/frontend/js/api/src/model/JobChange.js new file mode 100644 index 00000000..0600a591 --- /dev/null +++ b/frontend/js/api/src/model/JobChange.js @@ -0,0 +1,109 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The JobChange model module. + * @module model/JobChange + * @version 0.1.0 + */ +class JobChange { + /** + * Constructs a new JobChange. + * @alias module:model/JobChange + * @extends Object + * @param jobId {Number} + * @param action {String} + */ + constructor(jobId, action) { + + JobChange.initialize(this, jobId, action); + } + + /** + * Initializes the fields of this object. + * 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, jobId, action) { + obj['job_id'] = jobId; + obj['action'] = action; + } + + /** + * Constructs a JobChange from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/JobChange} obj Optional instance to populate. + * @return {module:model/JobChange} The populated JobChange instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new JobChange(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('job_id')) { + obj['job_id'] = ApiClient.convertToType(data['job_id'], 'Number'); + } + if (data.hasOwnProperty('action')) { + obj['action'] = ApiClient.convertToType(data['action'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to JobChange. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to JobChange. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of JobChange.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['action'] && !(typeof data['action'] === 'string' || data['action'] instanceof String)) { + throw new Error("Expected the field `action` to be a primitive type in the JSON string but got " + data['action']); + } + + return true; + } + + +} + +JobChange.RequiredProperties = ["job_id", "action"]; + +/** + * @member {Number} job_id + */ +JobChange.prototype['job_id'] = undefined; + +/** + * @member {String} action + */ +JobChange.prototype['action'] = undefined; + + + + + + +export default JobChange; + diff --git a/frontend/js/api/src/model/Lat.js b/frontend/js/api/src/model/Lat.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Lat.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Lon.js b/frontend/js/api/src/model/Lon.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Lon.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Note.js b/frontend/js/api/src/model/Note.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Note.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/ProjectId.js b/frontend/js/api/src/model/ProjectId.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/ProjectId.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Software.js b/frontend/js/api/src/model/Software.js new file mode 100644 index 00000000..33357c51 --- /dev/null +++ b/frontend/js/api/src/model/Software.js @@ -0,0 +1,204 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import Email from './Email'; +import ImageUrl from './ImageUrl'; +import UsageScenarioVariables from './UsageScenarioVariables'; + +/** + * The Software model module. + * @module model/Software + * @version 0.1.0 + */ +class Software { + /** + * Constructs a new Software. + * @alias module:model/Software + * @extends Object + * @param name {String} + * @param repoUrl {String} + * @param filename {String} + * @param branch {String} + * @param machineId {Number} + * @param scheduleMode {String} + */ + constructor(name, repoUrl, filename, branch, machineId, scheduleMode) { + + Software.initialize(this, name, repoUrl, filename, branch, machineId, scheduleMode); + } + + /** + * Initializes the fields of this object. + * 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, name, repoUrl, filename, branch, machineId, scheduleMode) { + obj['name'] = name; + obj['repo_url'] = repoUrl; + obj['filename'] = filename; + obj['branch'] = branch; + obj['machine_id'] = machineId; + obj['schedule_mode'] = scheduleMode; + } + + /** + * Constructs a Software from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Software} obj Optional instance to populate. + * @return {module:model/Software} The populated Software instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Software(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('image_url')) { + obj['image_url'] = ImageUrl.constructFromObject(data['image_url']); + } + if (data.hasOwnProperty('repo_url')) { + obj['repo_url'] = ApiClient.convertToType(data['repo_url'], 'String'); + } + if (data.hasOwnProperty('email')) { + obj['email'] = Email.constructFromObject(data['email']); + } + if (data.hasOwnProperty('filename')) { + obj['filename'] = ApiClient.convertToType(data['filename'], 'String'); + } + if (data.hasOwnProperty('branch')) { + obj['branch'] = ApiClient.convertToType(data['branch'], 'String'); + } + if (data.hasOwnProperty('machine_id')) { + obj['machine_id'] = ApiClient.convertToType(data['machine_id'], 'Number'); + } + if (data.hasOwnProperty('schedule_mode')) { + obj['schedule_mode'] = ApiClient.convertToType(data['schedule_mode'], 'String'); + } + if (data.hasOwnProperty('usage_scenario_variables')) { + obj['usage_scenario_variables'] = UsageScenarioVariables.constructFromObject(data['usage_scenario_variables']); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to Software. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to Software. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of Software.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) { + throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']); + } + // validate the optional field `image_url` + if (data['image_url']) { // data not null + ImageUrl.validateJSON(data['image_url']); + } + // ensure the json data is a string + if (data['repo_url'] && !(typeof data['repo_url'] === 'string' || data['repo_url'] instanceof String)) { + throw new Error("Expected the field `repo_url` to be a primitive type in the JSON string but got " + data['repo_url']); + } + // validate the optional field `email` + if (data['email']) { // data not null + Email.validateJSON(data['email']); + } + // ensure the json data is a string + if (data['filename'] && !(typeof data['filename'] === 'string' || data['filename'] instanceof String)) { + throw new Error("Expected the field `filename` to be a primitive type in the JSON string but got " + data['filename']); + } + // ensure the json data is a string + if (data['branch'] && !(typeof data['branch'] === 'string' || data['branch'] instanceof String)) { + throw new Error("Expected the field `branch` to be a primitive type in the JSON string but got " + data['branch']); + } + // ensure the json data is a string + if (data['schedule_mode'] && !(typeof data['schedule_mode'] === 'string' || data['schedule_mode'] instanceof String)) { + throw new Error("Expected the field `schedule_mode` to be a primitive type in the JSON string but got " + data['schedule_mode']); + } + // validate the optional field `usage_scenario_variables` + if (data['usage_scenario_variables']) { // data not null + UsageScenarioVariables.validateJSON(data['usage_scenario_variables']); + } + + return true; + } + + +} + +Software.RequiredProperties = ["name", "repo_url", "filename", "branch", "machine_id", "schedule_mode"]; + +/** + * @member {String} name + */ +Software.prototype['name'] = undefined; + +/** + * @member {module:model/ImageUrl} image_url + */ +Software.prototype['image_url'] = undefined; + +/** + * @member {String} repo_url + */ +Software.prototype['repo_url'] = undefined; + +/** + * @member {module:model/Email} email + */ +Software.prototype['email'] = undefined; + +/** + * @member {String} filename + */ +Software.prototype['filename'] = undefined; + +/** + * @member {String} branch + */ +Software.prototype['branch'] = undefined; + +/** + * @member {Number} machine_id + */ +Software.prototype['machine_id'] = undefined; + +/** + * @member {String} schedule_mode + */ +Software.prototype['schedule_mode'] = undefined; + +/** + * @member {module:model/UsageScenarioVariables} usage_scenario_variables + */ +Software.prototype['usage_scenario_variables'] = undefined; + + + + + + +export default Software; + diff --git a/frontend/js/api/src/model/UsageScenarioVariables.js b/frontend/js/api/src/model/UsageScenarioVariables.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/UsageScenarioVariables.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/UserSetting.js b/frontend/js/api/src/model/UserSetting.js new file mode 100644 index 00000000..8155edc2 --- /dev/null +++ b/frontend/js/api/src/model/UserSetting.js @@ -0,0 +1,114 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import Value from './Value'; + +/** + * The UserSetting model module. + * @module model/UserSetting + * @version 0.1.0 + */ +class UserSetting { + /** + * Constructs a new UserSetting. + * @alias module:model/UserSetting + * @extends Object + * @param name {String} + * @param value {module:model/Value} + */ + constructor(name, value) { + + UserSetting.initialize(this, name, value); + } + + /** + * Initializes the fields of this object. + * 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, name, value) { + obj['name'] = name; + obj['value'] = value; + } + + /** + * Constructs a UserSetting from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UserSetting} obj Optional instance to populate. + * @return {module:model/UserSetting} The populated UserSetting instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UserSetting(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('value')) { + obj['value'] = Value.constructFromObject(data['value']); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to UserSetting. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to UserSetting. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of UserSetting.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) { + throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']); + } + // validate the optional field `value` + if (data['value']) { // data not null + Value.validateJSON(data['value']); + } + + return true; + } + + +} + +UserSetting.RequiredProperties = ["name", "value"]; + +/** + * @member {String} name + */ +UserSetting.prototype['name'] = undefined; + +/** + * @member {module:model/Value} value + */ +UserSetting.prototype['value'] = undefined; + + + + + + +export default UserSetting; + diff --git a/frontend/js/api/src/model/ValidationError.js b/frontend/js/api/src/model/ValidationError.js new file mode 100644 index 00000000..7c6d42c6 --- /dev/null +++ b/frontend/js/api/src/model/ValidationError.js @@ -0,0 +1,130 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import ValidationErrorLocInner from './ValidationErrorLocInner'; + +/** + * The ValidationError model module. + * @module model/ValidationError + * @version 0.1.0 + */ +class ValidationError { + /** + * Constructs a new ValidationError. + * @alias module:model/ValidationError + * @param loc {Array.} + * @param msg {String} + * @param type {String} + */ + constructor(loc, msg, type) { + + ValidationError.initialize(this, loc, msg, type); + } + + /** + * Initializes the fields of this object. + * 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, loc, msg, type) { + obj['loc'] = loc; + obj['msg'] = msg; + obj['type'] = type; + } + + /** + * Constructs a ValidationError from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ValidationError} obj Optional instance to populate. + * @return {module:model/ValidationError} The populated ValidationError instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ValidationError(); + + if (data.hasOwnProperty('loc')) { + obj['loc'] = ApiClient.convertToType(data['loc'], [ValidationErrorLocInner]); + } + if (data.hasOwnProperty('msg')) { + obj['msg'] = ApiClient.convertToType(data['msg'], 'String'); + } + if (data.hasOwnProperty('type')) { + obj['type'] = ApiClient.convertToType(data['type'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to ValidationError. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to ValidationError. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of ValidationError.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + if (data['loc']) { // data not null + // ensure the json data is an array + if (!Array.isArray(data['loc'])) { + throw new Error("Expected the field `loc` to be an array in the JSON data but got " + data['loc']); + } + // validate the optional field `loc` (array) + for (const item of data['loc']) { + ValidationErrorLocInner.validateJSON(item); + }; + } + // ensure the json data is a string + if (data['msg'] && !(typeof data['msg'] === 'string' || data['msg'] instanceof String)) { + throw new Error("Expected the field `msg` to be a primitive type in the JSON string but got " + data['msg']); + } + // ensure the json data is a string + if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) { + throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']); + } + + return true; + } + + +} + +ValidationError.RequiredProperties = ["loc", "msg", "type"]; + +/** + * @member {Array.} loc + */ +ValidationError.prototype['loc'] = undefined; + +/** + * @member {String} msg + */ +ValidationError.prototype['msg'] = undefined; + +/** + * @member {String} type + */ +ValidationError.prototype['type'] = undefined; + + + + + + +export default ValidationError; + diff --git a/frontend/js/api/src/model/ValidationErrorLocInner.js b/frontend/js/api/src/model/ValidationErrorLocInner.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/ValidationErrorLocInner.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/frontend/js/api/src/model/Value.js b/frontend/js/api/src/model/Value.js new file mode 100644 index 00000000..4bfe3f2a --- /dev/null +++ b/frontend/js/api/src/model/Value.js @@ -0,0 +1,15 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +// TODO: add anyof model support diff --git a/generate-api-client.sh b/generate-api-client.sh new file mode 100755 index 00000000..f7902a6c --- /dev/null +++ b/generate-api-client.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +output_directory="$(dirname $0)/frontend/js/api/" + +rm -rf "${output_directory}" + +openapi-generator-cli generate \ + --generator-name javascript \ + --input-spec http://127.0.0.1:8000/openapi.json \ + --output "${output_directory}" \ + --skip-validate-spec \ + --global-property apiDocs=false \ + --global-property apiTests=false \ + --global-property modelDocs=false \ + --global-property modelTests=false \ + --additional-properties usePromises=true From c9e1aed9c84dadf9780490f638a1550cf8a7a848 Mon Sep 17 00:00:00 2001 From: winniehell Date: Tue, 3 Jun 2025 16:22:06 +0200 Subject: [PATCH 3/4] Improve operation IDs in OpenAPI specification --- api/main.py | 6 + frontend/js/api/README.md | 72 +++--- frontend/js/api/src/api/DefaultApi.js | 316 +++++++++++++------------- 3 files changed, 200 insertions(+), 194 deletions(-) diff --git a/api/main.py b/api/main.py index 6278f053..4e3bdbfb 100644 --- a/api/main.py +++ b/api/main.py @@ -9,6 +9,7 @@ from fastapi.encoders import jsonable_encoder from fastapi.exceptions import RequestValidationError from fastapi.middleware.cors import CORSMiddleware +from fastapi.routing import APIRoute from starlette.responses import RedirectResponse from starlette.exceptions import HTTPException as StarletteHTTPException @@ -173,6 +174,11 @@ async def update_user_setting(setting: UserSetting, user: User = Depends(authent from ee.api import ai_optimisations app.include_router(ai_optimisations.router) +for route in app.routes: + if not isinstance(route, APIRoute): + continue + + route.operation_id = route.name if __name__ == '__main__': app.run() # pylint: disable=no-member diff --git a/frontend/js/api/README.md b/frontend/js/api/README.md index e3415448..5d9c31e5 100644 --- a/frontend/js/api/README.md +++ b/frontend/js/api/README.md @@ -113,7 +113,7 @@ var ids = "ids_example"; // {String} var opts = { 'forceMode': "forceMode_example" // {String} }; -api.compareInRepoV1CompareGet(ids, opts).then(function(data) { +api.compareInRepo(ids, opts).then(function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); @@ -128,41 +128,41 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FastApi.DefaultApi* | [**compareInRepoV1CompareGet**](docs/DefaultApi.md#compareInRepoV1CompareGet) | **GET** /v1/compare | Compare In Repo -*FastApi.DefaultApi* | [**diffV1DiffGet**](docs/DefaultApi.md#diffV1DiffGet) | **GET** /v1/diff | Diff -*FastApi.DefaultApi* | [**getBadgeSingleV1BadgeSingleRunIdGet**](docs/DefaultApi.md#getBadgeSingleV1BadgeSingleRunIdGet) | **GET** /v1/badge/single/{run_id} | Get Badge Single -*FastApi.DefaultApi* | [**getCiBadgeGetV1CiBadgeGetGet**](docs/DefaultApi.md#getCiBadgeGetV1CiBadgeGetGet) | **GET** /v1/ci/badge/get | Get Ci Badge Get -*FastApi.DefaultApi* | [**getCiBadgeGetV1CiBadgeGetHead**](docs/DefaultApi.md#getCiBadgeGetV1CiBadgeGetHead) | **HEAD** /v1/ci/badge/get | Get Ci Badge Get -*FastApi.DefaultApi* | [**getCiMeasurementsV1CiMeasurementsGet**](docs/DefaultApi.md#getCiMeasurementsV1CiMeasurementsGet) | **GET** /v1/ci/measurements | Get Ci Measurements -*FastApi.DefaultApi* | [**getCiRepositoriesV1CiRepositoriesGet**](docs/DefaultApi.md#getCiRepositoriesV1CiRepositoriesGet) | **GET** /v1/ci/repositories | Get Ci Repositories -*FastApi.DefaultApi* | [**getCiRunsV1CiRunsGet**](docs/DefaultApi.md#getCiRunsV1CiRunsGet) | **GET** /v1/ci/runs | Get Ci Runs -*FastApi.DefaultApi* | [**getCiStatsV1CiStatsGet**](docs/DefaultApi.md#getCiStatsV1CiStatsGet) | **GET** /v1/ci/stats | Get Ci Stats -*FastApi.DefaultApi* | [**getInsightsV1CiInsightsGet**](docs/DefaultApi.md#getInsightsV1CiInsightsGet) | **GET** /v1/ci/insights | Get Insights -*FastApi.DefaultApi* | [**getInsightsV1InsightsGet**](docs/DefaultApi.md#getInsightsV1InsightsGet) | **GET** /v1/insights | Get Insights -*FastApi.DefaultApi* | [**getJobsV2JobsGet**](docs/DefaultApi.md#getJobsV2JobsGet) | **GET** /v2/jobs | Get Jobs -*FastApi.DefaultApi* | [**getMachinesV1MachinesGet**](docs/DefaultApi.md#getMachinesV1MachinesGet) | **GET** /v1/machines | Get Machines -*FastApi.DefaultApi* | [**getMeasurementsSingleV1MeasurementsSingleRunIdGet**](docs/DefaultApi.md#getMeasurementsSingleV1MeasurementsSingleRunIdGet) | **GET** /v1/measurements/single/{run_id} | Get Measurements Single -*FastApi.DefaultApi* | [**getNetworkV1NetworkRunIdGet**](docs/DefaultApi.md#getNetworkV1NetworkRunIdGet) | **GET** /v1/network/{run_id} | Get Network -*FastApi.DefaultApi* | [**getNotesV1NotesRunIdGet**](docs/DefaultApi.md#getNotesV1NotesRunIdGet) | **GET** /v1/notes/{run_id} | Get Notes -*FastApi.DefaultApi* | [**getOptimizationsV1OptimizationsRunIdGet**](docs/DefaultApi.md#getOptimizationsV1OptimizationsRunIdGet) | **GET** /v1/optimizations/{run_id} | Get Optimizations -*FastApi.DefaultApi* | [**getPhaseStatsSingleV1PhaseStatsSingleRunIdGet**](docs/DefaultApi.md#getPhaseStatsSingleV1PhaseStatsSingleRunIdGet) | **GET** /v1/phase_stats/single/{run_id} | Get Phase Stats Single -*FastApi.DefaultApi* | [**getRepositoriesV1RepositoriesGet**](docs/DefaultApi.md#getRepositoriesV1RepositoriesGet) | **GET** /v1/repositories | Get Repositories -*FastApi.DefaultApi* | [**getRunV2RunRunIdGet**](docs/DefaultApi.md#getRunV2RunRunIdGet) | **GET** /v2/run/{run_id} | Get Run -*FastApi.DefaultApi* | [**getRunsV2RunsGet**](docs/DefaultApi.md#getRunsV2RunsGet) | **GET** /v2/runs | Get Runs -*FastApi.DefaultApi* | [**getTimelineBadgeV1BadgeTimelineGet**](docs/DefaultApi.md#getTimelineBadgeV1BadgeTimelineGet) | **GET** /v1/badge/timeline | Get Timeline Badge -*FastApi.DefaultApi* | [**getTimelineStatsV1TimelineGet**](docs/DefaultApi.md#getTimelineStatsV1TimelineGet) | **GET** /v1/timeline | Get Timeline Stats -*FastApi.DefaultApi* | [**getUserSettingsV1UserSettingsGet**](docs/DefaultApi.md#getUserSettingsV1UserSettingsGet) | **GET** /v1/user/settings | Get User Settings -*FastApi.DefaultApi* | [**getWatchlistV1WatchlistGet**](docs/DefaultApi.md#getWatchlistV1WatchlistGet) | **GET** /v1/watchlist | Get Watchlist -*FastApi.DefaultApi* | [**homeGet**](docs/DefaultApi.md#homeGet) | **GET** / | Home -*FastApi.DefaultApi* | [**oldV1JobsEndpointV1JobsGet**](docs/DefaultApi.md#oldV1JobsEndpointV1JobsGet) | **GET** /v1/jobs | Old V1 Jobs Endpoint -*FastApi.DefaultApi* | [**oldV1RunEndpointV1RunRunIdGet**](docs/DefaultApi.md#oldV1RunEndpointV1RunRunIdGet) | **GET** /v1/run/{run_id} | Old V1 Run Endpoint -*FastApi.DefaultApi* | [**oldV1RunsEndpointV1RunsGet**](docs/DefaultApi.md#oldV1RunsEndpointV1RunsGet) | **GET** /v1/runs | Old V1 Runs Endpoint -*FastApi.DefaultApi* | [**postCiMeasurementAddDeprecatedV1CiMeasurementAddPost**](docs/DefaultApi.md#postCiMeasurementAddDeprecatedV1CiMeasurementAddPost) | **POST** /v1/ci/measurement/add | Post Ci Measurement Add Deprecated -*FastApi.DefaultApi* | [**postCiMeasurementAddV2CiMeasurementAddPost**](docs/DefaultApi.md#postCiMeasurementAddV2CiMeasurementAddPost) | **POST** /v2/ci/measurement/add | Post Ci Measurement Add -*FastApi.DefaultApi* | [**robotsTxtRobotsTxtGet**](docs/DefaultApi.md#robotsTxtRobotsTxtGet) | **GET** /robots.txt | Robots Txt -*FastApi.DefaultApi* | [**softwareAddV1SoftwareAddPost**](docs/DefaultApi.md#softwareAddV1SoftwareAddPost) | **POST** /v1/software/add | Software Add -*FastApi.DefaultApi* | [**updateJobV1JobPut**](docs/DefaultApi.md#updateJobV1JobPut) | **PUT** /v1/job | Update Job -*FastApi.DefaultApi* | [**updateUserSettingV1UserSettingPut**](docs/DefaultApi.md#updateUserSettingV1UserSettingPut) | **PUT** /v1/user/setting | Update User Setting +*FastApi.DefaultApi* | [**compareInRepo**](docs/DefaultApi.md#compareInRepo) | **GET** /v1/compare | Compare In Repo +*FastApi.DefaultApi* | [**diff**](docs/DefaultApi.md#diff) | **GET** /v1/diff | Diff +*FastApi.DefaultApi* | [**getBadgeSingle**](docs/DefaultApi.md#getBadgeSingle) | **GET** /v1/badge/single/{run_id} | Get Badge Single +*FastApi.DefaultApi* | [**getCiBadgeGet**](docs/DefaultApi.md#getCiBadgeGet) | **GET** /v1/ci/badge/get | Get Ci Badge Get +*FastApi.DefaultApi* | [**getCiBadgeGet_0**](docs/DefaultApi.md#getCiBadgeGet_0) | **HEAD** /v1/ci/badge/get | Get Ci Badge Get +*FastApi.DefaultApi* | [**getCiMeasurements**](docs/DefaultApi.md#getCiMeasurements) | **GET** /v1/ci/measurements | Get Ci Measurements +*FastApi.DefaultApi* | [**getCiRepositories**](docs/DefaultApi.md#getCiRepositories) | **GET** /v1/ci/repositories | Get Ci Repositories +*FastApi.DefaultApi* | [**getCiRuns**](docs/DefaultApi.md#getCiRuns) | **GET** /v1/ci/runs | Get Ci Runs +*FastApi.DefaultApi* | [**getCiStats**](docs/DefaultApi.md#getCiStats) | **GET** /v1/ci/stats | Get Ci Stats +*FastApi.DefaultApi* | [**getInsights**](docs/DefaultApi.md#getInsights) | **GET** /v1/insights | Get Insights +*FastApi.DefaultApi* | [**getInsights_0**](docs/DefaultApi.md#getInsights_0) | **GET** /v1/ci/insights | Get Insights +*FastApi.DefaultApi* | [**getJobs**](docs/DefaultApi.md#getJobs) | **GET** /v2/jobs | Get Jobs +*FastApi.DefaultApi* | [**getMachines**](docs/DefaultApi.md#getMachines) | **GET** /v1/machines | Get Machines +*FastApi.DefaultApi* | [**getMeasurementsSingle**](docs/DefaultApi.md#getMeasurementsSingle) | **GET** /v1/measurements/single/{run_id} | Get Measurements Single +*FastApi.DefaultApi* | [**getNetwork**](docs/DefaultApi.md#getNetwork) | **GET** /v1/network/{run_id} | Get Network +*FastApi.DefaultApi* | [**getNotes**](docs/DefaultApi.md#getNotes) | **GET** /v1/notes/{run_id} | Get Notes +*FastApi.DefaultApi* | [**getOptimizations**](docs/DefaultApi.md#getOptimizations) | **GET** /v1/optimizations/{run_id} | Get Optimizations +*FastApi.DefaultApi* | [**getPhaseStatsSingle**](docs/DefaultApi.md#getPhaseStatsSingle) | **GET** /v1/phase_stats/single/{run_id} | Get Phase Stats Single +*FastApi.DefaultApi* | [**getRepositories**](docs/DefaultApi.md#getRepositories) | **GET** /v1/repositories | Get Repositories +*FastApi.DefaultApi* | [**getRun**](docs/DefaultApi.md#getRun) | **GET** /v2/run/{run_id} | Get Run +*FastApi.DefaultApi* | [**getRuns**](docs/DefaultApi.md#getRuns) | **GET** /v2/runs | Get Runs +*FastApi.DefaultApi* | [**getTimelineBadge**](docs/DefaultApi.md#getTimelineBadge) | **GET** /v1/badge/timeline | Get Timeline Badge +*FastApi.DefaultApi* | [**getTimelineStats**](docs/DefaultApi.md#getTimelineStats) | **GET** /v1/timeline | Get Timeline Stats +*FastApi.DefaultApi* | [**getUserSettings**](docs/DefaultApi.md#getUserSettings) | **GET** /v1/user/settings | Get User Settings +*FastApi.DefaultApi* | [**getWatchlist**](docs/DefaultApi.md#getWatchlist) | **GET** /v1/watchlist | Get Watchlist +*FastApi.DefaultApi* | [**home**](docs/DefaultApi.md#home) | **GET** / | Home +*FastApi.DefaultApi* | [**oldV1JobsEndpoint**](docs/DefaultApi.md#oldV1JobsEndpoint) | **GET** /v1/jobs | Old V1 Jobs Endpoint +*FastApi.DefaultApi* | [**oldV1RunEndpoint**](docs/DefaultApi.md#oldV1RunEndpoint) | **GET** /v1/run/{run_id} | Old V1 Run Endpoint +*FastApi.DefaultApi* | [**oldV1RunsEndpoint**](docs/DefaultApi.md#oldV1RunsEndpoint) | **GET** /v1/runs | Old V1 Runs Endpoint +*FastApi.DefaultApi* | [**postCiMeasurementAdd**](docs/DefaultApi.md#postCiMeasurementAdd) | **POST** /v2/ci/measurement/add | Post Ci Measurement Add +*FastApi.DefaultApi* | [**postCiMeasurementAddDeprecated**](docs/DefaultApi.md#postCiMeasurementAddDeprecated) | **POST** /v1/ci/measurement/add | Post Ci Measurement Add Deprecated +*FastApi.DefaultApi* | [**robotsTxt**](docs/DefaultApi.md#robotsTxt) | **GET** /robots.txt | Robots Txt +*FastApi.DefaultApi* | [**softwareAdd**](docs/DefaultApi.md#softwareAdd) | **POST** /v1/software/add | Software Add +*FastApi.DefaultApi* | [**updateJob**](docs/DefaultApi.md#updateJob) | **PUT** /v1/job | Update Job +*FastApi.DefaultApi* | [**updateUserSetting**](docs/DefaultApi.md#updateUserSetting) | **PUT** /v1/user/setting | Update User Setting ## Documentation for Models diff --git a/frontend/js/api/src/api/DefaultApi.js b/frontend/js/api/src/api/DefaultApi.js index f20c4f6c..8afff8fe 100644 --- a/frontend/js/api/src/api/DefaultApi.js +++ b/frontend/js/api/src/api/DefaultApi.js @@ -47,12 +47,12 @@ export default class DefaultApi { * @param {String} [forceMode] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - compareInRepoV1CompareGetWithHttpInfo(ids, opts) { + compareInRepoWithHttpInfo(ids, opts) { opts = opts || {}; let postBody = null; // verify the required parameter 'ids' is set if (ids === undefined || ids === null) { - throw new Error("Missing the required parameter 'ids' when calling compareInRepoV1CompareGet"); + throw new Error("Missing the required parameter 'ids' when calling compareInRepo"); } let pathParams = { @@ -84,8 +84,8 @@ export default class DefaultApi { * @param {String} opts.forceMode * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - compareInRepoV1CompareGet(ids, opts) { - return this.compareInRepoV1CompareGetWithHttpInfo(ids, opts) + compareInRepo(ids, opts) { + return this.compareInRepoWithHttpInfo(ids, opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -97,11 +97,11 @@ export default class DefaultApi { * @param {String} ids * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - diffV1DiffGetWithHttpInfo(ids) { + diffWithHttpInfo(ids) { let postBody = null; // verify the required parameter 'ids' is set if (ids === undefined || ids === null) { - throw new Error("Missing the required parameter 'ids' when calling diffV1DiffGet"); + throw new Error("Missing the required parameter 'ids' when calling diff"); } let pathParams = { @@ -130,8 +130,8 @@ export default class DefaultApi { * @param {String} ids * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - diffV1DiffGet(ids) { - return this.diffV1DiffGetWithHttpInfo(ids) + diff(ids) { + return this.diffWithHttpInfo(ids) .then(function(response_and_data) { return response_and_data.data; }); @@ -147,12 +147,12 @@ export default class DefaultApi { * @param {String} [phase] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getBadgeSingleV1BadgeSingleRunIdGetWithHttpInfo(runId, opts) { + getBadgeSingleWithHttpInfo(runId, opts) { opts = opts || {}; let postBody = null; // verify the required parameter 'runId' is set if (runId === undefined || runId === null) { - throw new Error("Missing the required parameter 'runId' when calling getBadgeSingleV1BadgeSingleRunIdGet"); + throw new Error("Missing the required parameter 'runId' when calling getBadgeSingle"); } let pathParams = { @@ -188,8 +188,8 @@ export default class DefaultApi { * @param {String} opts.phase * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getBadgeSingleV1BadgeSingleRunIdGet(runId, opts) { - return this.getBadgeSingleV1BadgeSingleRunIdGetWithHttpInfo(runId, opts) + getBadgeSingle(runId, opts) { + return this.getBadgeSingleWithHttpInfo(runId, opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -208,20 +208,20 @@ export default class DefaultApi { * @param {String} [unit = 'watt-hours')] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getCiBadgeGetV1CiBadgeGetGetWithHttpInfo(repo, branch, workflow, opts) { + getCiBadgeGetWithHttpInfo(repo, branch, workflow, opts) { opts = opts || {}; let postBody = null; // verify the required parameter 'repo' is set if (repo === undefined || repo === null) { - throw new Error("Missing the required parameter 'repo' when calling getCiBadgeGetV1CiBadgeGetGet"); + throw new Error("Missing the required parameter 'repo' when calling getCiBadgeGet"); } // verify the required parameter 'branch' is set if (branch === undefined || branch === null) { - throw new Error("Missing the required parameter 'branch' when calling getCiBadgeGetV1CiBadgeGetGet"); + throw new Error("Missing the required parameter 'branch' when calling getCiBadgeGet"); } // verify the required parameter 'workflow' is set if (workflow === undefined || workflow === null) { - throw new Error("Missing the required parameter 'workflow' when calling getCiBadgeGetV1CiBadgeGetGet"); + throw new Error("Missing the required parameter 'workflow' when calling getCiBadgeGet"); } let pathParams = { @@ -263,8 +263,8 @@ export default class DefaultApi { * @param {String} opts.unit (default to 'watt-hours') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getCiBadgeGetV1CiBadgeGetGet(repo, branch, workflow, opts) { - return this.getCiBadgeGetV1CiBadgeGetGetWithHttpInfo(repo, branch, workflow, opts) + getCiBadgeGet(repo, branch, workflow, opts) { + return this.getCiBadgeGetWithHttpInfo(repo, branch, workflow, opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -283,20 +283,20 @@ export default class DefaultApi { * @param {String} [unit = 'watt-hours')] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getCiBadgeGetV1CiBadgeGetHeadWithHttpInfo(repo, branch, workflow, opts) { + getCiBadgeGet_0WithHttpInfo(repo, branch, workflow, opts) { opts = opts || {}; let postBody = null; // verify the required parameter 'repo' is set if (repo === undefined || repo === null) { - throw new Error("Missing the required parameter 'repo' when calling getCiBadgeGetV1CiBadgeGetHead"); + throw new Error("Missing the required parameter 'repo' when calling getCiBadgeGet_0"); } // verify the required parameter 'branch' is set if (branch === undefined || branch === null) { - throw new Error("Missing the required parameter 'branch' when calling getCiBadgeGetV1CiBadgeGetHead"); + throw new Error("Missing the required parameter 'branch' when calling getCiBadgeGet_0"); } // verify the required parameter 'workflow' is set if (workflow === undefined || workflow === null) { - throw new Error("Missing the required parameter 'workflow' when calling getCiBadgeGetV1CiBadgeGetHead"); + throw new Error("Missing the required parameter 'workflow' when calling getCiBadgeGet_0"); } let pathParams = { @@ -338,8 +338,8 @@ export default class DefaultApi { * @param {String} opts.unit (default to 'watt-hours') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getCiBadgeGetV1CiBadgeGetHead(repo, branch, workflow, opts) { - return this.getCiBadgeGetV1CiBadgeGetHeadWithHttpInfo(repo, branch, workflow, opts) + getCiBadgeGet_0(repo, branch, workflow, opts) { + return this.getCiBadgeGet_0WithHttpInfo(repo, branch, workflow, opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -355,27 +355,27 @@ export default class DefaultApi { * @param {Date} endDate * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getCiMeasurementsV1CiMeasurementsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) { + getCiMeasurementsWithHttpInfo(repo, branch, workflow, startDate, endDate) { let postBody = null; // verify the required parameter 'repo' is set if (repo === undefined || repo === null) { - throw new Error("Missing the required parameter 'repo' when calling getCiMeasurementsV1CiMeasurementsGet"); + throw new Error("Missing the required parameter 'repo' when calling getCiMeasurements"); } // verify the required parameter 'branch' is set if (branch === undefined || branch === null) { - throw new Error("Missing the required parameter 'branch' when calling getCiMeasurementsV1CiMeasurementsGet"); + throw new Error("Missing the required parameter 'branch' when calling getCiMeasurements"); } // verify the required parameter 'workflow' is set if (workflow === undefined || workflow === null) { - throw new Error("Missing the required parameter 'workflow' when calling getCiMeasurementsV1CiMeasurementsGet"); + throw new Error("Missing the required parameter 'workflow' when calling getCiMeasurements"); } // verify the required parameter 'startDate' is set if (startDate === undefined || startDate === null) { - throw new Error("Missing the required parameter 'startDate' when calling getCiMeasurementsV1CiMeasurementsGet"); + throw new Error("Missing the required parameter 'startDate' when calling getCiMeasurements"); } // verify the required parameter 'endDate' is set if (endDate === undefined || endDate === null) { - throw new Error("Missing the required parameter 'endDate' when calling getCiMeasurementsV1CiMeasurementsGet"); + throw new Error("Missing the required parameter 'endDate' when calling getCiMeasurements"); } let pathParams = { @@ -412,8 +412,8 @@ export default class DefaultApi { * @param {Date} endDate * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getCiMeasurementsV1CiMeasurementsGet(repo, branch, workflow, startDate, endDate) { - return this.getCiMeasurementsV1CiMeasurementsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) + getCiMeasurements(repo, branch, workflow, startDate, endDate) { + return this.getCiMeasurementsWithHttpInfo(repo, branch, workflow, startDate, endDate) .then(function(response_and_data) { return response_and_data.data; }); @@ -427,7 +427,7 @@ export default class DefaultApi { * @param {String} [sortBy = 'name')] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getCiRepositoriesV1CiRepositoriesGetWithHttpInfo(opts) { + getCiRepositoriesWithHttpInfo(opts) { opts = opts || {}; let postBody = null; @@ -460,8 +460,8 @@ export default class DefaultApi { * @param {String} opts.sortBy (default to 'name') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getCiRepositoriesV1CiRepositoriesGet(opts) { - return this.getCiRepositoriesV1CiRepositoriesGetWithHttpInfo(opts) + getCiRepositories(opts) { + return this.getCiRepositoriesWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -473,11 +473,11 @@ export default class DefaultApi { * @param {String} repo * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getCiRunsV1CiRunsGetWithHttpInfo(repo) { + getCiRunsWithHttpInfo(repo) { let postBody = null; // verify the required parameter 'repo' is set if (repo === undefined || repo === null) { - throw new Error("Missing the required parameter 'repo' when calling getCiRunsV1CiRunsGet"); + throw new Error("Missing the required parameter 'repo' when calling getCiRuns"); } let pathParams = { @@ -506,8 +506,8 @@ export default class DefaultApi { * @param {String} repo * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getCiRunsV1CiRunsGet(repo) { - return this.getCiRunsV1CiRunsGetWithHttpInfo(repo) + getCiRuns(repo) { + return this.getCiRunsWithHttpInfo(repo) .then(function(response_and_data) { return response_and_data.data; }); @@ -523,27 +523,27 @@ export default class DefaultApi { * @param {Date} endDate * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getCiStatsV1CiStatsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) { + getCiStatsWithHttpInfo(repo, branch, workflow, startDate, endDate) { let postBody = null; // verify the required parameter 'repo' is set if (repo === undefined || repo === null) { - throw new Error("Missing the required parameter 'repo' when calling getCiStatsV1CiStatsGet"); + throw new Error("Missing the required parameter 'repo' when calling getCiStats"); } // verify the required parameter 'branch' is set if (branch === undefined || branch === null) { - throw new Error("Missing the required parameter 'branch' when calling getCiStatsV1CiStatsGet"); + throw new Error("Missing the required parameter 'branch' when calling getCiStats"); } // verify the required parameter 'workflow' is set if (workflow === undefined || workflow === null) { - throw new Error("Missing the required parameter 'workflow' when calling getCiStatsV1CiStatsGet"); + throw new Error("Missing the required parameter 'workflow' when calling getCiStats"); } // verify the required parameter 'startDate' is set if (startDate === undefined || startDate === null) { - throw new Error("Missing the required parameter 'startDate' when calling getCiStatsV1CiStatsGet"); + throw new Error("Missing the required parameter 'startDate' when calling getCiStats"); } // verify the required parameter 'endDate' is set if (endDate === undefined || endDate === null) { - throw new Error("Missing the required parameter 'endDate' when calling getCiStatsV1CiStatsGet"); + throw new Error("Missing the required parameter 'endDate' when calling getCiStats"); } let pathParams = { @@ -580,8 +580,8 @@ export default class DefaultApi { * @param {Date} endDate * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getCiStatsV1CiStatsGet(repo, branch, workflow, startDate, endDate) { - return this.getCiStatsV1CiStatsGetWithHttpInfo(repo, branch, workflow, startDate, endDate) + getCiStats(repo, branch, workflow, startDate, endDate) { + return this.getCiStatsWithHttpInfo(repo, branch, workflow, startDate, endDate) .then(function(response_and_data) { return response_and_data.data; }); @@ -592,7 +592,7 @@ export default class DefaultApi { * Get Insights * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getInsightsV1CiInsightsGetWithHttpInfo() { + getInsightsWithHttpInfo() { let postBody = null; let pathParams = { @@ -609,7 +609,7 @@ export default class DefaultApi { let accepts = ['application/json']; let returnType = Object; return this.apiClient.callApi( - '/v1/ci/insights', 'GET', + '/v1/insights', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); @@ -619,8 +619,8 @@ export default class DefaultApi { * Get Insights * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getInsightsV1CiInsightsGet() { - return this.getInsightsV1CiInsightsGetWithHttpInfo() + getInsights() { + return this.getInsightsWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -631,7 +631,7 @@ export default class DefaultApi { * Get Insights * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getInsightsV1InsightsGetWithHttpInfo() { + getInsights_0WithHttpInfo() { let postBody = null; let pathParams = { @@ -648,7 +648,7 @@ export default class DefaultApi { let accepts = ['application/json']; let returnType = Object; return this.apiClient.callApi( - '/v1/insights', 'GET', + '/v1/ci/insights', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); @@ -658,8 +658,8 @@ export default class DefaultApi { * Get Insights * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getInsightsV1InsightsGet() { - return this.getInsightsV1InsightsGetWithHttpInfo() + getInsights_0() { + return this.getInsights_0WithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -674,7 +674,7 @@ export default class DefaultApi { * @param {Number} [jobId] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getJobsV2JobsGetWithHttpInfo(opts) { + getJobsWithHttpInfo(opts) { opts = opts || {}; let postBody = null; @@ -709,8 +709,8 @@ export default class DefaultApi { * @param {Number} opts.jobId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getJobsV2JobsGet(opts) { - return this.getJobsV2JobsGetWithHttpInfo(opts) + getJobs(opts) { + return this.getJobsWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -721,7 +721,7 @@ export default class DefaultApi { * Get Machines * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getMachinesV1MachinesGetWithHttpInfo() { + getMachinesWithHttpInfo() { let postBody = null; let pathParams = { @@ -748,8 +748,8 @@ export default class DefaultApi { * Get Machines * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getMachinesV1MachinesGet() { - return this.getMachinesV1MachinesGetWithHttpInfo() + getMachines() { + return this.getMachinesWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -761,11 +761,11 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getMeasurementsSingleV1MeasurementsSingleRunIdGetWithHttpInfo(runId) { + getMeasurementsSingleWithHttpInfo(runId) { let postBody = null; // verify the required parameter 'runId' is set if (runId === undefined || runId === null) { - throw new Error("Missing the required parameter 'runId' when calling getMeasurementsSingleV1MeasurementsSingleRunIdGet"); + throw new Error("Missing the required parameter 'runId' when calling getMeasurementsSingle"); } let pathParams = { @@ -794,8 +794,8 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getMeasurementsSingleV1MeasurementsSingleRunIdGet(runId) { - return this.getMeasurementsSingleV1MeasurementsSingleRunIdGetWithHttpInfo(runId) + getMeasurementsSingle(runId) { + return this.getMeasurementsSingleWithHttpInfo(runId) .then(function(response_and_data) { return response_and_data.data; }); @@ -807,11 +807,11 @@ export default class DefaultApi { * @param {Object} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getNetworkV1NetworkRunIdGetWithHttpInfo(runId) { + getNetworkWithHttpInfo(runId) { let postBody = null; // verify the required parameter 'runId' is set if (runId === undefined || runId === null) { - throw new Error("Missing the required parameter 'runId' when calling getNetworkV1NetworkRunIdGet"); + throw new Error("Missing the required parameter 'runId' when calling getNetwork"); } let pathParams = { @@ -840,8 +840,8 @@ export default class DefaultApi { * @param {Object} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getNetworkV1NetworkRunIdGet(runId) { - return this.getNetworkV1NetworkRunIdGetWithHttpInfo(runId) + getNetwork(runId) { + return this.getNetworkWithHttpInfo(runId) .then(function(response_and_data) { return response_and_data.data; }); @@ -853,11 +853,11 @@ export default class DefaultApi { * @param {Object} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getNotesV1NotesRunIdGetWithHttpInfo(runId) { + getNotesWithHttpInfo(runId) { let postBody = null; // verify the required parameter 'runId' is set if (runId === undefined || runId === null) { - throw new Error("Missing the required parameter 'runId' when calling getNotesV1NotesRunIdGet"); + throw new Error("Missing the required parameter 'runId' when calling getNotes"); } let pathParams = { @@ -886,8 +886,8 @@ export default class DefaultApi { * @param {Object} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getNotesV1NotesRunIdGet(runId) { - return this.getNotesV1NotesRunIdGetWithHttpInfo(runId) + getNotes(runId) { + return this.getNotesWithHttpInfo(runId) .then(function(response_and_data) { return response_and_data.data; }); @@ -899,11 +899,11 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getOptimizationsV1OptimizationsRunIdGetWithHttpInfo(runId) { + getOptimizationsWithHttpInfo(runId) { let postBody = null; // verify the required parameter 'runId' is set if (runId === undefined || runId === null) { - throw new Error("Missing the required parameter 'runId' when calling getOptimizationsV1OptimizationsRunIdGet"); + throw new Error("Missing the required parameter 'runId' when calling getOptimizations"); } let pathParams = { @@ -932,8 +932,8 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getOptimizationsV1OptimizationsRunIdGet(runId) { - return this.getOptimizationsV1OptimizationsRunIdGetWithHttpInfo(runId) + getOptimizations(runId) { + return this.getOptimizationsWithHttpInfo(runId) .then(function(response_and_data) { return response_and_data.data; }); @@ -945,11 +945,11 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getPhaseStatsSingleV1PhaseStatsSingleRunIdGetWithHttpInfo(runId) { + getPhaseStatsSingleWithHttpInfo(runId) { let postBody = null; // verify the required parameter 'runId' is set if (runId === undefined || runId === null) { - throw new Error("Missing the required parameter 'runId' when calling getPhaseStatsSingleV1PhaseStatsSingleRunIdGet"); + throw new Error("Missing the required parameter 'runId' when calling getPhaseStatsSingle"); } let pathParams = { @@ -978,8 +978,8 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getPhaseStatsSingleV1PhaseStatsSingleRunIdGet(runId) { - return this.getPhaseStatsSingleV1PhaseStatsSingleRunIdGetWithHttpInfo(runId) + getPhaseStatsSingle(runId) { + return this.getPhaseStatsSingleWithHttpInfo(runId) .then(function(response_and_data) { return response_and_data.data; }); @@ -997,7 +997,7 @@ export default class DefaultApi { * @param {String} [sortBy = 'name')] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getRepositoriesV1RepositoriesGetWithHttpInfo(opts) { + getRepositoriesWithHttpInfo(opts) { opts = opts || {}; let postBody = null; @@ -1038,8 +1038,8 @@ export default class DefaultApi { * @param {String} opts.sortBy (default to 'name') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getRepositoriesV1RepositoriesGet(opts) { - return this.getRepositoriesV1RepositoriesGetWithHttpInfo(opts) + getRepositories(opts) { + return this.getRepositoriesWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -1051,11 +1051,11 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getRunV2RunRunIdGetWithHttpInfo(runId) { + getRunWithHttpInfo(runId) { let postBody = null; // verify the required parameter 'runId' is set if (runId === undefined || runId === null) { - throw new Error("Missing the required parameter 'runId' when calling getRunV2RunRunIdGet"); + throw new Error("Missing the required parameter 'runId' when calling getRun"); } let pathParams = { @@ -1084,8 +1084,8 @@ export default class DefaultApi { * @param {String} runId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getRunV2RunRunIdGet(runId) { - return this.getRunV2RunRunIdGetWithHttpInfo(runId) + getRun(runId) { + return this.getRunWithHttpInfo(runId) .then(function(response_and_data) { return response_and_data.data; }); @@ -1106,7 +1106,7 @@ export default class DefaultApi { * @param {Object} [uriMode] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getRunsV2RunsGetWithHttpInfo(opts) { + getRunsWithHttpInfo(opts) { opts = opts || {}; let postBody = null; @@ -1153,8 +1153,8 @@ export default class DefaultApi { * @param {Object} opts.uriMode * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getRunsV2RunsGet(opts) { - return this.getRunsV2RunsGetWithHttpInfo(opts) + getRuns(opts) { + return this.getRunsWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -1173,16 +1173,16 @@ export default class DefaultApi { * @param {String} [unit = 'watt-hours')] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getTimelineBadgeV1BadgeTimelineGetWithHttpInfo(metric, uri, opts) { + getTimelineBadgeWithHttpInfo(metric, uri, opts) { opts = opts || {}; let postBody = null; // verify the required parameter 'metric' is set if (metric === undefined || metric === null) { - throw new Error("Missing the required parameter 'metric' when calling getTimelineBadgeV1BadgeTimelineGet"); + throw new Error("Missing the required parameter 'metric' when calling getTimelineBadge"); } // verify the required parameter 'uri' is set if (uri === undefined || uri === null) { - throw new Error("Missing the required parameter 'uri' when calling getTimelineBadgeV1BadgeTimelineGet"); + throw new Error("Missing the required parameter 'uri' when calling getTimelineBadge"); } let pathParams = { @@ -1224,8 +1224,8 @@ export default class DefaultApi { * @param {String} opts.unit (default to 'watt-hours') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getTimelineBadgeV1BadgeTimelineGet(metric, uri, opts) { - return this.getTimelineBadgeV1BadgeTimelineGetWithHttpInfo(metric, uri, opts) + getTimelineBadge(metric, uri, opts) { + return this.getTimelineBadgeWithHttpInfo(metric, uri, opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -1246,16 +1246,16 @@ export default class DefaultApi { * @param {String} [sorting] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getTimelineStatsV1TimelineGetWithHttpInfo(uri, machineId, opts) { + getTimelineStatsWithHttpInfo(uri, machineId, opts) { opts = opts || {}; let postBody = null; // verify the required parameter 'uri' is set if (uri === undefined || uri === null) { - throw new Error("Missing the required parameter 'uri' when calling getTimelineStatsV1TimelineGet"); + throw new Error("Missing the required parameter 'uri' when calling getTimelineStats"); } // verify the required parameter 'machineId' is set if (machineId === undefined || machineId === null) { - throw new Error("Missing the required parameter 'machineId' when calling getTimelineStatsV1TimelineGet"); + throw new Error("Missing the required parameter 'machineId' when calling getTimelineStats"); } let pathParams = { @@ -1301,8 +1301,8 @@ export default class DefaultApi { * @param {String} opts.sorting * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getTimelineStatsV1TimelineGet(uri, machineId, opts) { - return this.getTimelineStatsV1TimelineGetWithHttpInfo(uri, machineId, opts) + getTimelineStats(uri, machineId, opts) { + return this.getTimelineStatsWithHttpInfo(uri, machineId, opts) .then(function(response_and_data) { return response_and_data.data; }); @@ -1313,7 +1313,7 @@ export default class DefaultApi { * Get User Settings * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getUserSettingsV1UserSettingsGetWithHttpInfo() { + getUserSettingsWithHttpInfo() { let postBody = null; let pathParams = { @@ -1340,8 +1340,8 @@ export default class DefaultApi { * Get User Settings * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getUserSettingsV1UserSettingsGet() { - return this.getUserSettingsV1UserSettingsGetWithHttpInfo() + getUserSettings() { + return this.getUserSettingsWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -1352,7 +1352,7 @@ export default class DefaultApi { * Get Watchlist * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - getWatchlistV1WatchlistGetWithHttpInfo() { + getWatchlistWithHttpInfo() { let postBody = null; let pathParams = { @@ -1379,8 +1379,8 @@ export default class DefaultApi { * Get Watchlist * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - getWatchlistV1WatchlistGet() { - return this.getWatchlistV1WatchlistGetWithHttpInfo() + getWatchlist() { + return this.getWatchlistWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -1391,7 +1391,7 @@ export default class DefaultApi { * Home * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - homeGetWithHttpInfo() { + homeWithHttpInfo() { let postBody = null; let pathParams = { @@ -1418,8 +1418,8 @@ export default class DefaultApi { * Home * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - homeGet() { - return this.homeGetWithHttpInfo() + home() { + return this.homeWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -1430,7 +1430,7 @@ export default class DefaultApi { * Old V1 Jobs Endpoint * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - oldV1JobsEndpointV1JobsGetWithHttpInfo() { + oldV1JobsEndpointWithHttpInfo() { let postBody = null; let pathParams = { @@ -1457,8 +1457,8 @@ export default class DefaultApi { * Old V1 Jobs Endpoint * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - oldV1JobsEndpointV1JobsGet() { - return this.oldV1JobsEndpointV1JobsGetWithHttpInfo() + oldV1JobsEndpoint() { + return this.oldV1JobsEndpointWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -1469,7 +1469,7 @@ export default class DefaultApi { * Old V1 Run Endpoint * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - oldV1RunEndpointV1RunRunIdGetWithHttpInfo() { + oldV1RunEndpointWithHttpInfo() { let postBody = null; let pathParams = { @@ -1496,8 +1496,8 @@ export default class DefaultApi { * Old V1 Run Endpoint * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - oldV1RunEndpointV1RunRunIdGet() { - return this.oldV1RunEndpointV1RunRunIdGetWithHttpInfo() + oldV1RunEndpoint() { + return this.oldV1RunEndpointWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -1508,7 +1508,7 @@ export default class DefaultApi { * Old V1 Runs Endpoint * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - oldV1RunsEndpointV1RunsGetWithHttpInfo() { + oldV1RunsEndpointWithHttpInfo() { let postBody = null; let pathParams = { @@ -1535,8 +1535,8 @@ export default class DefaultApi { * Old V1 Runs Endpoint * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - oldV1RunsEndpointV1RunsGet() { - return this.oldV1RunsEndpointV1RunsGetWithHttpInfo() + oldV1RunsEndpoint() { + return this.oldV1RunsEndpointWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -1544,15 +1544,15 @@ export default class DefaultApi { /** - * Post Ci Measurement Add Deprecated - * @param {module:model/CIMeasurementOld} cIMeasurementOld + * Post Ci Measurement Add + * @param {module:model/CIMeasurement} cIMeasurement * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - postCiMeasurementAddDeprecatedV1CiMeasurementAddPostWithHttpInfo(cIMeasurementOld) { - let postBody = cIMeasurementOld; - // verify the required parameter 'cIMeasurementOld' is set - if (cIMeasurementOld === undefined || cIMeasurementOld === null) { - throw new Error("Missing the required parameter 'cIMeasurementOld' when calling postCiMeasurementAddDeprecatedV1CiMeasurementAddPost"); + postCiMeasurementAddWithHttpInfo(cIMeasurement) { + let postBody = cIMeasurement; + // verify the required parameter 'cIMeasurement' is set + if (cIMeasurement === undefined || cIMeasurement === null) { + throw new Error("Missing the required parameter 'cIMeasurement' when calling postCiMeasurementAdd"); } let pathParams = { @@ -1569,19 +1569,19 @@ export default class DefaultApi { let accepts = ['application/json']; let returnType = Object; return this.apiClient.callApi( - '/v1/ci/measurement/add', 'POST', + '/v2/ci/measurement/add', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** - * Post Ci Measurement Add Deprecated - * @param {module:model/CIMeasurementOld} cIMeasurementOld + * Post Ci Measurement Add + * @param {module:model/CIMeasurement} cIMeasurement * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - postCiMeasurementAddDeprecatedV1CiMeasurementAddPost(cIMeasurementOld) { - return this.postCiMeasurementAddDeprecatedV1CiMeasurementAddPostWithHttpInfo(cIMeasurementOld) + postCiMeasurementAdd(cIMeasurement) { + return this.postCiMeasurementAddWithHttpInfo(cIMeasurement) .then(function(response_and_data) { return response_and_data.data; }); @@ -1589,15 +1589,15 @@ export default class DefaultApi { /** - * Post Ci Measurement Add - * @param {module:model/CIMeasurement} cIMeasurement + * Post Ci Measurement Add Deprecated + * @param {module:model/CIMeasurementOld} cIMeasurementOld * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - postCiMeasurementAddV2CiMeasurementAddPostWithHttpInfo(cIMeasurement) { - let postBody = cIMeasurement; - // verify the required parameter 'cIMeasurement' is set - if (cIMeasurement === undefined || cIMeasurement === null) { - throw new Error("Missing the required parameter 'cIMeasurement' when calling postCiMeasurementAddV2CiMeasurementAddPost"); + postCiMeasurementAddDeprecatedWithHttpInfo(cIMeasurementOld) { + let postBody = cIMeasurementOld; + // verify the required parameter 'cIMeasurementOld' is set + if (cIMeasurementOld === undefined || cIMeasurementOld === null) { + throw new Error("Missing the required parameter 'cIMeasurementOld' when calling postCiMeasurementAddDeprecated"); } let pathParams = { @@ -1614,19 +1614,19 @@ export default class DefaultApi { let accepts = ['application/json']; let returnType = Object; return this.apiClient.callApi( - '/v2/ci/measurement/add', 'POST', + '/v1/ci/measurement/add', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** - * Post Ci Measurement Add - * @param {module:model/CIMeasurement} cIMeasurement + * Post Ci Measurement Add Deprecated + * @param {module:model/CIMeasurementOld} cIMeasurementOld * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - postCiMeasurementAddV2CiMeasurementAddPost(cIMeasurement) { - return this.postCiMeasurementAddV2CiMeasurementAddPostWithHttpInfo(cIMeasurement) + postCiMeasurementAddDeprecated(cIMeasurementOld) { + return this.postCiMeasurementAddDeprecatedWithHttpInfo(cIMeasurementOld) .then(function(response_and_data) { return response_and_data.data; }); @@ -1637,7 +1637,7 @@ export default class DefaultApi { * Robots Txt * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - robotsTxtRobotsTxtGetWithHttpInfo() { + robotsTxtWithHttpInfo() { let postBody = null; let pathParams = { @@ -1664,8 +1664,8 @@ export default class DefaultApi { * Robots Txt * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - robotsTxtRobotsTxtGet() { - return this.robotsTxtRobotsTxtGetWithHttpInfo() + robotsTxt() { + return this.robotsTxtWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); @@ -1677,11 +1677,11 @@ export default class DefaultApi { * @param {module:model/Software} software * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - softwareAddV1SoftwareAddPostWithHttpInfo(software) { + softwareAddWithHttpInfo(software) { let postBody = software; // verify the required parameter 'software' is set if (software === undefined || software === null) { - throw new Error("Missing the required parameter 'software' when calling softwareAddV1SoftwareAddPost"); + throw new Error("Missing the required parameter 'software' when calling softwareAdd"); } let pathParams = { @@ -1709,8 +1709,8 @@ export default class DefaultApi { * @param {module:model/Software} software * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - softwareAddV1SoftwareAddPost(software) { - return this.softwareAddV1SoftwareAddPostWithHttpInfo(software) + softwareAdd(software) { + return this.softwareAddWithHttpInfo(software) .then(function(response_and_data) { return response_and_data.data; }); @@ -1722,11 +1722,11 @@ export default class DefaultApi { * @param {module:model/JobChange} jobChange * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - updateJobV1JobPutWithHttpInfo(jobChange) { + updateJobWithHttpInfo(jobChange) { let postBody = jobChange; // verify the required parameter 'jobChange' is set if (jobChange === undefined || jobChange === null) { - throw new Error("Missing the required parameter 'jobChange' when calling updateJobV1JobPut"); + throw new Error("Missing the required parameter 'jobChange' when calling updateJob"); } let pathParams = { @@ -1754,8 +1754,8 @@ export default class DefaultApi { * @param {module:model/JobChange} jobChange * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - updateJobV1JobPut(jobChange) { - return this.updateJobV1JobPutWithHttpInfo(jobChange) + updateJob(jobChange) { + return this.updateJobWithHttpInfo(jobChange) .then(function(response_and_data) { return response_and_data.data; }); @@ -1767,11 +1767,11 @@ export default class DefaultApi { * @param {module:model/UserSetting} userSetting * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ - updateUserSettingV1UserSettingPutWithHttpInfo(userSetting) { + updateUserSettingWithHttpInfo(userSetting) { let postBody = userSetting; // verify the required parameter 'userSetting' is set if (userSetting === undefined || userSetting === null) { - throw new Error("Missing the required parameter 'userSetting' when calling updateUserSettingV1UserSettingPut"); + throw new Error("Missing the required parameter 'userSetting' when calling updateUserSetting"); } let pathParams = { @@ -1799,8 +1799,8 @@ export default class DefaultApi { * @param {module:model/UserSetting} userSetting * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ - updateUserSettingV1UserSettingPut(userSetting) { - return this.updateUserSettingV1UserSettingPutWithHttpInfo(userSetting) + updateUserSetting(userSetting) { + return this.updateUserSettingWithHttpInfo(userSetting) .then(function(response_and_data) { return response_and_data.data; }); From d6001f981f0898d4b690c5753a9d60e38e8fbb92 Mon Sep 17 00:00:00 2001 From: winniehell Date: Tue, 3 Jun 2025 16:24:38 +0200 Subject: [PATCH 4/4] Use getRun() from generate API client instead of makeAPICall() --- frontend/js/stats.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/js/stats.js b/frontend/js/stats.js index d8b09f2e..b2b736f5 100644 --- a/frontend/js/stats.js +++ b/frontend/js/stats.js @@ -1,3 +1,5 @@ +import DefaultApi from "./api/src/api/DefaultApi"; + class CO2Tangible extends HTMLElement { connectedCallback() { this.innerHTML = ` @@ -77,7 +79,8 @@ const fetchAndFillRunData = async (url_params) => { let run = null; try { - run = await makeAPICall('/v2/run/' + url_params['id']) + const api = new DefaultApi(); + run = await api.getRun(url_params['id']); } catch (err) { showNotification('Could not get run data from API', err); return