UNPKG

cwmsjs

Version:

CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps

177 lines (176 loc) 8.86 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * CWMS Data API * CWMS REST API for Data Retrieval * * The version of the OpenAPI document: 2.4.0-2026.3.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const runtime = require("../runtime"); const models_1 = require("../models"); /** * */ class ProjectLockRevokerRightsApi extends runtime.BaseAPI { /** * Get a list of project lock revoker rights * Get projectLockRights */ getProjectLockRightsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.officeMask === null || requestParameters.officeMask === undefined) { throw new runtime.RequiredError('officeMask', 'Required parameter requestParameters.officeMask was null or undefined when calling getProjectLockRights.'); } const queryParameters = {}; if (requestParameters.officeMask !== undefined) { queryParameters['office-mask'] = requestParameters.officeMask; } if (requestParameters.projectMask !== undefined) { queryParameters['project-mask'] = requestParameters.projectMask; } if (requestParameters.applicationMask !== undefined) { queryParameters['application-mask'] = requestParameters.applicationMask; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/project-lock-rights`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.LockRevokerRightsFromJSON)); }); } /** * Get a list of project lock revoker rights * Get projectLockRights */ getProjectLockRights(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getProjectLockRightsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Revokes a project lock, if successful the lock is deleted * Post projectLockRights removeAll */ postProjectLockRightsRemoveAllRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling postProjectLockRightsRemoveAll.'); } if (requestParameters.applicationId === null || requestParameters.applicationId === undefined) { throw new runtime.RequiredError('applicationId', 'Required parameter requestParameters.applicationId was null or undefined when calling postProjectLockRightsRemoveAll.'); } if (requestParameters.userId === null || requestParameters.userId === undefined) { throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling postProjectLockRightsRemoveAll.'); } const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.applicationId !== undefined) { queryParameters['application-id'] = requestParameters.applicationId; } if (requestParameters.userId !== undefined) { queryParameters['user-id'] = requestParameters.userId; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/project-lock-rights/remove-all`, method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Revokes a project lock, if successful the lock is deleted * Post projectLockRights removeAll */ postProjectLockRightsRemoveAll(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postProjectLockRightsRemoveAllRaw(requestParameters, initOverrides); }); } /** * Update Lock Revoker Rights. * Post projectLockRights update */ postProjectLockRightsUpdateRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling postProjectLockRightsUpdate.'); } if (requestParameters.applicationId === null || requestParameters.applicationId === undefined) { throw new runtime.RequiredError('applicationId', 'Required parameter requestParameters.applicationId was null or undefined when calling postProjectLockRightsUpdate.'); } if (requestParameters.userId === null || requestParameters.userId === undefined) { throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling postProjectLockRightsUpdate.'); } if (requestParameters.allow === null || requestParameters.allow === undefined) { throw new runtime.RequiredError('allow', 'Required parameter requestParameters.allow was null or undefined when calling postProjectLockRightsUpdate.'); } const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.projectMask !== undefined) { queryParameters['project-mask'] = requestParameters.projectMask; } if (requestParameters.applicationId !== undefined) { queryParameters['application-id'] = requestParameters.applicationId; } if (requestParameters.userId !== undefined) { queryParameters['user-id'] = requestParameters.userId; } if (requestParameters.allow !== undefined) { queryParameters['allow'] = requestParameters.allow; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/project-lock-rights/update`, method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Update Lock Revoker Rights. * Post projectLockRights update */ postProjectLockRightsUpdate(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postProjectLockRightsUpdateRaw(requestParameters, initOverrides); }); } } exports.ProjectLockRevokerRightsApi = ProjectLockRevokerRightsApi;