UNPKG

cwmsjs

Version:

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

231 lines (230 loc) 10.8 kB
"use strict"; /* 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()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ClobApi = void 0; const runtime = require("../runtime"); const index_1 = require("../models/index"); /** * */ class ClobApi extends runtime.BaseAPI { /** * Delete clob * Delete cwmsData clobs with clobId */ deleteClobsWithClobIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['clobId'] == null) { throw new runtime.RequiredError('clobId', 'Required parameter "clobId" was null or undefined when calling deleteClobsWithClobId().'); } if (requestParameters['office'] == null) { throw new runtime.RequiredError('office', 'Required parameter "office" was null or undefined when calling deleteClobsWithClobId().'); } const queryParameters = {}; if (requestParameters['office'] != null) { queryParameters['office'] = requestParameters['office']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/clobs/{clob-id}`.replace(`{${"clob-id"}}`, encodeURIComponent(String(requestParameters['clobId']))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Delete clob * Delete cwmsData clobs with clobId */ deleteClobsWithClobId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deleteClobsWithClobIdRaw(requestParameters, initOverrides); }); } /** * Get cwmsData clobs */ getClobsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters['office'] != null) { queryParameters['office'] = requestParameters['office']; } if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } if (requestParameters['pageSize'] != null) { queryParameters['page-size'] = requestParameters['pageSize']; } if (requestParameters['includeValues'] != null) { queryParameters['include-values'] = requestParameters['includeValues']; } if (requestParameters['like'] != null) { queryParameters['like'] = requestParameters['like']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/clobs`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ClobsFromJSON)(jsonValue)); }); } /** * Get cwmsData clobs */ getClobs(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getClobsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Get a single clob. If the accept header is set to text/plain, the raw value is returned as the response body. Responses to text/plain requests are streamed and support the Range header. When the accept header is set to application/json;version=2 the clob will be returned as a serialized Clob object with fields for office-id, id, description and value. * Get cwmsData clobs with clobId */ getClobsWithClobIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['clobId'] == null) { throw new runtime.RequiredError('clobId', 'Required parameter "clobId" was null or undefined when calling getClobsWithClobId().'); } const queryParameters = {}; if (requestParameters['office'] != null) { queryParameters['office'] = requestParameters['office']; } if (requestParameters['clobId2'] != null) { queryParameters['clob-id'] = requestParameters['clobId2']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/clobs/{clob-id}`.replace(`{${"clob-id"}}`, encodeURIComponent(String(requestParameters['clobId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ClobFromJSON)(jsonValue)); }); } /** * Get a single clob. If the accept header is set to text/plain, the raw value is returned as the response body. Responses to text/plain requests are streamed and support the Range header. When the accept header is set to application/json;version=2 the clob will be returned as a serialized Clob object with fields for office-id, id, description and value. * Get cwmsData clobs with clobId */ getClobsWithClobId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getClobsWithClobIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Update clob * Patch cwmsData clobs with clobId */ patchClobsWithClobIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['clobId'] == null) { throw new runtime.RequiredError('clobId', 'Required parameter "clobId" was null or undefined when calling patchClobsWithClobId().'); } if (requestParameters['clob'] == null) { throw new runtime.RequiredError('clob', 'Required parameter "clob" was null or undefined when calling patchClobsWithClobId().'); } const queryParameters = {}; if (requestParameters['ignoreNulls'] != null) { queryParameters['ignore-nulls'] = requestParameters['ignoreNulls']; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/json;version=2'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/clobs/{clob-id}`.replace(`{${"clob-id"}}`, encodeURIComponent(String(requestParameters['clobId']))), method: 'PATCH', headers: headerParameters, query: queryParameters, body: (0, index_1.ClobToJSON)(requestParameters['clob']), }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Update clob * Patch cwmsData clobs with clobId */ patchClobsWithClobId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.patchClobsWithClobIdRaw(requestParameters, initOverrides); }); } /** * Create new Clob * Post cwmsData clobs */ postClobsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['clob'] == null) { throw new runtime.RequiredError('clob', 'Required parameter "clob" was null or undefined when calling postClobs().'); } const queryParameters = {}; if (requestParameters['failIfExists'] != null) { queryParameters['fail-if-exists'] = requestParameters['failIfExists']; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/json;version=2'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = yield this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/clobs`, method: 'POST', headers: headerParameters, query: queryParameters, body: (0, index_1.ClobToJSON)(requestParameters['clob']), }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Create new Clob * Post cwmsData clobs */ postClobs(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postClobsRaw(requestParameters, initOverrides); }); } } exports.ClobApi = ClobApi;