UNPKG

cwmsjs

Version:

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

188 lines (187 loc) 9.21 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 StandardTextApi extends runtime.BaseAPI { /** * Delete a single Standard Text value * Delete standardTextId with standardTextId */ deleteStandardTextIdWithStandardTextIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.standardTextId === null || requestParameters.standardTextId === undefined) { throw new runtime.RequiredError('standardTextId', 'Required parameter requestParameters.standardTextId was null or undefined when calling deleteStandardTextIdWithStandardTextId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling deleteStandardTextIdWithStandardTextId.'); } if (requestParameters.method === null || requestParameters.method === undefined) { throw new runtime.RequiredError('method', 'Required parameter requestParameters.method was null or undefined when calling deleteStandardTextIdWithStandardTextId.'); } const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.method !== undefined) { queryParameters['method'] = requestParameters.method; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/standard-text-id/{standard-text-id}`.replace(`{${"standard-text-id"}}`, encodeURIComponent(String(requestParameters.standardTextId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Delete a single Standard Text value * Delete standardTextId with standardTextId */ deleteStandardTextIdWithStandardTextId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deleteStandardTextIdWithStandardTextIdRaw(requestParameters, initOverrides); }); } /** * Retrieve a Standard Text catalog * Get standardTextId */ getStandardTextIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.officeMask !== undefined) { queryParameters['office-mask'] = requestParameters.officeMask; } if (requestParameters.standardTextIdMask !== undefined) { queryParameters['standard-text-id-mask'] = requestParameters.standardTextIdMask; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/standard-text-id`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.StandardTextCatalogFromJSON(jsonValue)); }); } /** * Retrieve a Standard Text catalog * Get standardTextId */ getStandardTextId(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getStandardTextIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Retrieve a single Standard Text value * Get standardTextId with standardTextId */ getStandardTextIdWithStandardTextIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.standardTextId === null || requestParameters.standardTextId === undefined) { throw new runtime.RequiredError('standardTextId', 'Required parameter requestParameters.standardTextId was null or undefined when calling getStandardTextIdWithStandardTextId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling getStandardTextIdWithStandardTextId.'); } const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/standard-text-id/{standard-text-id}`.replace(`{${"standard-text-id"}}`, encodeURIComponent(String(requestParameters.standardTextId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.StandardTextValueFromJSON(jsonValue)); }); } /** * Retrieve a single Standard Text value * Get standardTextId with standardTextId */ getStandardTextIdWithStandardTextId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getStandardTextIdWithStandardTextIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create new Standard Text * Post standardTextId */ postStandardTextIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.standardTextValue === null || requestParameters.standardTextValue === undefined) { throw new runtime.RequiredError('standardTextValue', 'Required parameter requestParameters.standardTextValue was null or undefined when calling postStandardTextId.'); } const queryParameters = {}; if (requestParameters.failIfExists !== undefined) { queryParameters['fail-if-exists'] = requestParameters.failIfExists; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/json;version=2'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/standard-text-id`, method: 'POST', headers: headerParameters, query: queryParameters, body: models_1.StandardTextValueToJSON(requestParameters.standardTextValue), }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Create new Standard Text * Post standardTextId */ postStandardTextId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postStandardTextIdRaw(requestParameters, initOverrides); }); } } exports.StandardTextApi = StandardTextApi;