cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
190 lines (189 loc) • 9.09 kB
JavaScript
;
/* 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.StandardTextApi = void 0;
const runtime = require("../runtime");
const index_1 = require("../models/index");
/**
*
*/
class StandardTextApi extends runtime.BaseAPI {
/**
* Delete a single Standard Text value
* Delete cwmsData standardTextId with standardTextId
*/
deleteStandardTextIdWithStandardTextIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['standardTextId'] == null) {
throw new runtime.RequiredError('standardTextId', 'Required parameter "standardTextId" was null or undefined when calling deleteStandardTextIdWithStandardTextId().');
}
if (requestParameters['office'] == null) {
throw new runtime.RequiredError('office', 'Required parameter "office" was null or undefined when calling deleteStandardTextIdWithStandardTextId().');
}
if (requestParameters['method'] == null) {
throw new runtime.RequiredError('method', 'Required parameter "method" was null or undefined when calling deleteStandardTextIdWithStandardTextId().');
}
const queryParameters = {};
if (requestParameters['office'] != null) {
queryParameters['office'] = requestParameters['office'];
}
if (requestParameters['method'] != null) {
queryParameters['method'] = requestParameters['method'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = yield 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 cwmsData 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 cwmsData standardTextId
*/
getStandardTextIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
if (requestParameters['officeMask'] != null) {
queryParameters['office-mask'] = requestParameters['officeMask'];
}
if (requestParameters['standardTextIdMask'] != null) {
queryParameters['standard-text-id-mask'] = requestParameters['standardTextIdMask'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = yield 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) => (0, index_1.StandardTextCatalogFromJSON)(jsonValue));
});
}
/**
* Retrieve a Standard Text catalog
* Get cwmsData 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 cwmsData standardTextId with standardTextId
*/
getStandardTextIdWithStandardTextIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['standardTextId'] == null) {
throw new runtime.RequiredError('standardTextId', 'Required parameter "standardTextId" was null or undefined when calling getStandardTextIdWithStandardTextId().');
}
if (requestParameters['office'] == null) {
throw new runtime.RequiredError('office', 'Required parameter "office" was null or undefined when calling getStandardTextIdWithStandardTextId().');
}
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: `/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) => (0, index_1.StandardTextValueFromJSON)(jsonValue));
});
}
/**
* Retrieve a single Standard Text value
* Get cwmsData 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 cwmsData standardTextId
*/
postStandardTextIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['standardTextValue'] == null) {
throw new runtime.RequiredError('standardTextValue', 'Required parameter "standardTextValue" was null or undefined when calling postStandardTextId().');
}
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: `/standard-text-id`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.StandardTextValueToJSON)(requestParameters['standardTextValue']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
* Create new Standard Text
* Post cwmsData standardTextId
*/
postStandardTextId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.postStandardTextIdRaw(requestParameters, initOverrides);
});
}
}
exports.StandardTextApi = StandardTextApi;