UNPKG

cwmsjs

Version:

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

175 lines (174 loc) 8.44 kB
/* tslint:disable */ /* eslint-disable */ /** * CWMS Data API * CWMS REST API for Data Retrieval * * The version of the OpenAPI document: 2.3.2-2025.03.19 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import * as runtime from '../runtime'; import { LockRevokerRightsFromJSON, } from '../models/index'; /** * */ export class ProjectLockRevokerRightsApi extends runtime.BaseAPI { /** * Get a list of project lock revoker rights * Get cwmsData projectLockRights */ getProjectLockRightsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['officeMask'] == null) { throw new runtime.RequiredError('officeMask', 'Required parameter "officeMask" was null or undefined when calling getProjectLockRights().'); } const queryParameters = {}; if (requestParameters['officeMask'] != null) { queryParameters['office-mask'] = requestParameters['officeMask']; } if (requestParameters['projectMask'] != null) { queryParameters['project-mask'] = requestParameters['projectMask']; } if (requestParameters['applicationMask'] != null) { queryParameters['application-mask'] = requestParameters['applicationMask']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield 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(LockRevokerRightsFromJSON)); }); } /** * Get a list of project lock revoker rights * Get cwmsData 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 cwmsData projectLockRights removeAll */ postProjectLockRightsRemoveAllRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['office'] == null) { throw new runtime.RequiredError('office', 'Required parameter "office" was null or undefined when calling postProjectLockRightsRemoveAll().'); } if (requestParameters['applicationId'] == null) { throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling postProjectLockRightsRemoveAll().'); } if (requestParameters['userId'] == null) { throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling postProjectLockRightsRemoveAll().'); } const queryParameters = {}; if (requestParameters['office'] != null) { queryParameters['office'] = requestParameters['office']; } if (requestParameters['applicationId'] != null) { queryParameters['application-id'] = requestParameters['applicationId']; } if (requestParameters['userId'] != null) { queryParameters['user-id'] = requestParameters['userId']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield 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 cwmsData projectLockRights removeAll */ postProjectLockRightsRemoveAll(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postProjectLockRightsRemoveAllRaw(requestParameters, initOverrides); }); } /** * Update Lock Revoker Rights. * Post cwmsData projectLockRights update */ postProjectLockRightsUpdateRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['office'] == null) { throw new runtime.RequiredError('office', 'Required parameter "office" was null or undefined when calling postProjectLockRightsUpdate().'); } if (requestParameters['applicationId'] == null) { throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling postProjectLockRightsUpdate().'); } if (requestParameters['userId'] == null) { throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling postProjectLockRightsUpdate().'); } if (requestParameters['allow'] == null) { throw new runtime.RequiredError('allow', 'Required parameter "allow" was null or undefined when calling postProjectLockRightsUpdate().'); } const queryParameters = {}; if (requestParameters['office'] != null) { queryParameters['office'] = requestParameters['office']; } if (requestParameters['projectMask'] != null) { queryParameters['project-mask'] = requestParameters['projectMask']; } if (requestParameters['applicationId'] != null) { queryParameters['application-id'] = requestParameters['applicationId']; } if (requestParameters['userId'] != null) { queryParameters['user-id'] = requestParameters['userId']; } if (requestParameters['allow'] != null) { queryParameters['allow'] = requestParameters['allow']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield 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 cwmsData projectLockRights update */ postProjectLockRightsUpdate(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postProjectLockRightsUpdateRaw(requestParameters, initOverrides); }); } }