UNPKG

cwmsjs

Version:

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

879 lines (878 loc) 48.3 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 RatingsApi extends runtime.BaseAPI { /** * Deletes requested rating specification * Delete ratings spec with ratingId */ deleteRatingsSpecWithRatingIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling deleteRatingsSpecWithRatingId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling deleteRatingsSpecWithRatingId.'); } if (requestParameters.method === null || requestParameters.method === undefined) { throw new runtime.RequiredError('method', 'Required parameter requestParameters.method was null or undefined when calling deleteRatingsSpecWithRatingId.'); } 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: `/ratings/spec/{rating-id}`.replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Deletes requested rating specification * Delete ratings spec with ratingId */ deleteRatingsSpecWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deleteRatingsSpecWithRatingIdRaw(requestParameters, initOverrides); }); } /** * Deletes requested rating specification * Delete ratings template with templateId */ deleteRatingsTemplateWithTemplateIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.templateId === null || requestParameters.templateId === undefined) { throw new runtime.RequiredError('templateId', 'Required parameter requestParameters.templateId was null or undefined when calling deleteRatingsTemplateWithTemplateId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling deleteRatingsTemplateWithTemplateId.'); } if (requestParameters.method === null || requestParameters.method === undefined) { throw new runtime.RequiredError('method', 'Required parameter requestParameters.method was null or undefined when calling deleteRatingsTemplateWithTemplateId.'); } 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: `/ratings/template/{template-id}`.replace(`{${"template-id"}}`, encodeURIComponent(String(requestParameters.templateId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Deletes requested rating specification * Delete ratings template with templateId */ deleteRatingsTemplateWithTemplateId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deleteRatingsTemplateWithTemplateIdRaw(requestParameters, initOverrides); }); } /** * Delete ratings with ratingId */ deleteRatingsWithRatingIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling deleteRatingsWithRatingId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling deleteRatingsWithRatingId.'); } if (requestParameters.begin === null || requestParameters.begin === undefined) { throw new runtime.RequiredError('begin', 'Required parameter requestParameters.begin was null or undefined when calling deleteRatingsWithRatingId.'); } if (requestParameters.end === null || requestParameters.end === undefined) { throw new runtime.RequiredError('end', 'Required parameter requestParameters.end was null or undefined when calling deleteRatingsWithRatingId.'); } const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.begin !== undefined) { queryParameters['begin'] = requestParameters.begin; } if (requestParameters.end !== undefined) { queryParameters['end'] = requestParameters.end; } if (requestParameters.timezone !== undefined) { queryParameters['timezone'] = requestParameters.timezone; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/{rating-id}`.replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Delete ratings with ratingId */ deleteRatingsWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deleteRatingsWithRatingIdRaw(requestParameters, initOverrides); }); } /** * Get ratings */ getRatingsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.name !== undefined) { queryParameters['name'] = requestParameters.name; } if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.unit !== undefined) { queryParameters['unit'] = requestParameters.unit; } if (requestParameters.datum !== undefined) { queryParameters['datum'] = requestParameters.datum; } if (requestParameters.at !== undefined) { queryParameters['at'] = requestParameters.at; } if (requestParameters.end !== undefined) { queryParameters['end'] = requestParameters.end; } if (requestParameters.timezone !== undefined) { queryParameters['timezone'] = requestParameters.timezone; } if (requestParameters.format !== undefined) { queryParameters['format'] = requestParameters.format; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * Get ratings */ getRatings(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns mapping of office -> spec id -> effective date-times for all matching offices and spec ids. * Get ratings effectiveDates */ getRatingsEffectiveDatesRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.officeMask !== undefined) { queryParameters['office-mask'] = requestParameters.officeMask; } if (requestParameters.ratingIdMask !== undefined) { queryParameters['rating-id-mask'] = requestParameters.ratingIdMask; } if (requestParameters.timezone !== undefined) { queryParameters['timezone'] = requestParameters.timezone; } if (requestParameters.begin !== undefined) { queryParameters['begin'] = requestParameters.begin; } if (requestParameters.end !== undefined) { queryParameters['end'] = requestParameters.end; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/effective-dates`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatingEffectiveDatesMapFromJSON(jsonValue)); }); } /** * Returns mapping of office -> spec id -> effective date-times for all matching offices and spec ids. * Get ratings effectiveDates */ getRatingsEffectiveDates(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsEffectiveDatesRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Get ratings metadata */ getRatingsMetadataRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.ratingIdMask !== undefined) { queryParameters['rating-id-mask'] = requestParameters.ratingIdMask; } if (requestParameters.start !== undefined) { queryParameters['start'] = requestParameters.start; } if (requestParameters.end !== undefined) { queryParameters['end'] = requestParameters.end; } if (requestParameters.timezone !== undefined) { queryParameters['timezone'] = requestParameters.timezone; } if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.pageSize !== undefined) { queryParameters['page-size'] = requestParameters.pageSize; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/metadata`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatingMetadataListFromJSON(jsonValue)); }); } /** * Get ratings metadata */ getRatingsMetadata(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsMetadataRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Get ratings spec */ getRatingsSpecRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.ratingIdMask !== undefined) { queryParameters['rating-id-mask'] = requestParameters.ratingIdMask; } if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.pageSize !== undefined) { queryParameters['page-size'] = requestParameters.pageSize; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/spec`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatingSpecsFromJSON(jsonValue)); }); } /** * Get ratings spec */ getRatingsSpec(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsSpecRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Get ratings spec with ratingId */ getRatingsSpecWithRatingIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling getRatingsSpecWithRatingId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling getRatingsSpecWithRatingId.'); } 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: `/ratings/spec/{rating-id}`.replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatingSpecFromJSON(jsonValue)); }); } /** * Get ratings spec with ratingId */ getRatingsSpecWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsSpecWithRatingIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Get ratings template */ getRatingsTemplateRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.templateIdMask !== undefined) { queryParameters['template-id-mask'] = requestParameters.templateIdMask; } if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.pageSize !== undefined) { queryParameters['page-size'] = requestParameters.pageSize; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/template`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatingTemplatesFromJSON(jsonValue)); }); } /** * Get ratings template */ getRatingsTemplate(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsTemplateRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Get ratings template with templateId */ getRatingsTemplateWithTemplateIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.templateId === null || requestParameters.templateId === undefined) { throw new runtime.RequiredError('templateId', 'Required parameter requestParameters.templateId was null or undefined when calling getRatingsTemplateWithTemplateId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling getRatingsTemplateWithTemplateId.'); } 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: `/ratings/template/{template-id}`.replace(`{${"template-id"}}`, encodeURIComponent(String(requestParameters.templateId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.RatingTemplateFromJSON)); }); } /** * Get ratings template with templateId */ getRatingsTemplateWithTemplateId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsTemplateWithTemplateIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns CWMS Rating Data. Supports accept header formatting. For more information about accept header usage, <a href=\"legacy-format/\">see this page.</a> * Get ratings with ratingId */ getRatingsWithRatingIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling getRatingsWithRatingId.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling getRatingsWithRatingId.'); } const queryParameters = {}; if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } if (requestParameters.begin !== undefined) { queryParameters['begin'] = requestParameters.begin; } if (requestParameters.end !== undefined) { queryParameters['end'] = requestParameters.end; } if (requestParameters.timezone !== undefined) { queryParameters['timezone'] = requestParameters.timezone; } 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: `/ratings/{rating-id}`.replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * Returns CWMS Rating Data. Supports accept header formatting. For more information about accept header usage, <a href=\"legacy-format/\">see this page.</a> * Get ratings with ratingId */ getRatingsWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsWithRatingIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns CWMS Rating Data * Get ratings with ratingId latest */ getRatingsWithRatingIdLatestRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling getRatingsWithRatingIdLatest.'); } if (requestParameters.office === null || requestParameters.office === undefined) { throw new runtime.RequiredError('office', 'Required parameter requestParameters.office was null or undefined when calling getRatingsWithRatingIdLatest.'); } 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: `/ratings/{rating-id}/latest`.replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * Returns CWMS Rating Data * Get ratings with ratingId latest */ getRatingsWithRatingIdLatest(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRatingsWithRatingIdLatestRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Update a RatingSet * Patch ratings with ratingId */ patchRatingsWithRatingIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling patchRatingsWithRatingId.'); } if (requestParameters.body === null || requestParameters.body === undefined) { throw new runtime.RequiredError('body', 'Required parameter requestParameters.body was null or undefined when calling patchRatingsWithRatingId.'); } const queryParameters = {}; if (requestParameters.storeTemplate !== undefined) { queryParameters['store-template'] = requestParameters.storeTemplate; } if (requestParameters.replaceBaseCurve !== undefined) { queryParameters['replace-base-curve'] = requestParameters.replaceBaseCurve; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/xml;version=2'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/{rating-id}`.replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'PATCH', headers: headerParameters, query: queryParameters, body: requestParameters.body, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Update a RatingSet * Patch ratings with ratingId */ patchRatingsWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.patchRatingsWithRatingIdRaw(requestParameters, initOverrides); }); } /** * Create new RatingSet * Post ratings */ postRatingsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.body === null || requestParameters.body === undefined) { throw new runtime.RequiredError('body', 'Required parameter requestParameters.body was null or undefined when calling postRatings.'); } const queryParameters = {}; if (requestParameters.storeTemplate !== undefined) { queryParameters['store-template'] = requestParameters.storeTemplate; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/xml;version=2'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings`, method: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters.body, }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Create new RatingSet * Post ratings */ postRatings(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postRatingsRaw(requestParameters, initOverrides); }); } /** * Rates input values using CWMS ratings. The input format `RateInputTimeSeries` DTO supports an array of CWMS time series ids, each corresponding to an independent parameter in the rating curve.The output format `RatedOutputTimeSeries` will contain a singular double array corresponding to the dependent parameter of the rating curve. * Post ratings rateTs with office with ratingId */ postRatingsRateTsWithOfficeWithRatingIdRaw(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 postRatingsRateTsWithOfficeWithRatingId.'); } if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling postRatingsRateTsWithOfficeWithRatingId.'); } if (requestParameters.rateInputTimeSeries === null || requestParameters.rateInputTimeSeries === undefined) { throw new runtime.RequiredError('rateInputTimeSeries', 'Required parameter requestParameters.rateInputTimeSeries was null or undefined when calling postRatingsRateTsWithOfficeWithRatingId.'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/rate-ts/{office}/{rating-id}`.replace(`{${"office"}}`, encodeURIComponent(String(requestParameters.office))).replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'POST', headers: headerParameters, query: queryParameters, body: models_1.RateInputTimeSeriesToJSON(requestParameters.rateInputTimeSeries), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatedOutputTimeSeriesFromJSON(jsonValue)); }); } /** * Rates input values using CWMS ratings. The input format `RateInputTimeSeries` DTO supports an array of CWMS time series ids, each corresponding to an independent parameter in the rating curve.The output format `RatedOutputTimeSeries` will contain a singular double array corresponding to the dependent parameter of the rating curve. * Post ratings rateTs with office with ratingId */ postRatingsRateTsWithOfficeWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postRatingsRateTsWithOfficeWithRatingIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Rates input values using CWMS ratings. The input format `RatingInputValues` includes a two dimensional array with each dimension corresponding to an independent parameter in the rating curve. The output format `RatedOutputTimeSeries` will contain a singular double array corresponding to the dependent parameter of the rating curve. * Post ratings rateValues with office with ratingId */ postRatingsRateValuesWithOfficeWithRatingIdRaw(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 postRatingsRateValuesWithOfficeWithRatingId.'); } if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling postRatingsRateValuesWithOfficeWithRatingId.'); } if (requestParameters.rateInputValues === null || requestParameters.rateInputValues === undefined) { throw new runtime.RequiredError('rateInputValues', 'Required parameter requestParameters.rateInputValues was null or undefined when calling postRatingsRateValuesWithOfficeWithRatingId.'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/rate-values/{office}/{rating-id}`.replace(`{${"office"}}`, encodeURIComponent(String(requestParameters.office))).replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'POST', headers: headerParameters, query: queryParameters, body: models_1.RateInputValuesToJSON(requestParameters.rateInputValues), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatedOutputValuesFromJSON(jsonValue)); }); } /** * Rates input values using CWMS ratings. The input format `RatingInputValues` includes a two dimensional array with each dimension corresponding to an independent parameter in the rating curve. The output format `RatedOutputTimeSeries` will contain a singular double array corresponding to the dependent parameter of the rating curve. * Post ratings rateValues with office with ratingId */ postRatingsRateValuesWithOfficeWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postRatingsRateValuesWithOfficeWithRatingIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Reverse rates input values using CWMS ratings. The input format `RateInputTimeSeries` requires a singular time series id corresponding to the dependent parameter in the rating curve. The output format `RatedOutputTimeSeries` will contain a singular double array corresponding to the independent parameter of the rating curve. Note: This endpoint only works on monotonically increase/decreasing table ratings with a single independent parameter. * Post ratings reverseRateTs with office with ratingId */ postRatingsReverseRateTsWithOfficeWithRatingIdRaw(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 postRatingsReverseRateTsWithOfficeWithRatingId.'); } if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling postRatingsReverseRateTsWithOfficeWithRatingId.'); } if (requestParameters.rateInputTimeSeries === null || requestParameters.rateInputTimeSeries === undefined) { throw new runtime.RequiredError('rateInputTimeSeries', 'Required parameter requestParameters.rateInputTimeSeries was null or undefined when calling postRatingsReverseRateTsWithOfficeWithRatingId.'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/reverse-rate-ts/{office}/{rating-id}`.replace(`{${"office"}}`, encodeURIComponent(String(requestParameters.office))).replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'POST', headers: headerParameters, query: queryParameters, body: models_1.RateInputTimeSeriesToJSON(requestParameters.rateInputTimeSeries), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatedOutputTimeSeriesFromJSON(jsonValue)); }); } /** * Reverse rates input values using CWMS ratings. The input format `RateInputTimeSeries` requires a singular time series id corresponding to the dependent parameter in the rating curve. The output format `RatedOutputTimeSeries` will contain a singular double array corresponding to the independent parameter of the rating curve. Note: This endpoint only works on monotonically increase/decreasing table ratings with a single independent parameter. * Post ratings reverseRateTs with office with ratingId */ postRatingsReverseRateTsWithOfficeWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postRatingsReverseRateTsWithOfficeWithRatingIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Reverse rates input values using CWMS ratings. The input format `RateInputValues` requires a singular array of doubles corresponding to the dependent parameter in the rating curve. The output format `RatedOutputValues` will contain a singular double array corresponding to the independent parameter of the rating curve. Note: This endpoint only works on monotonically increase/decreasing table ratings with a single independent parameter. * Post ratings reverseRateValues with office with ratingId */ postRatingsReverseRateValuesWithOfficeWithRatingIdRaw(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 postRatingsReverseRateValuesWithOfficeWithRatingId.'); } if (requestParameters.ratingId === null || requestParameters.ratingId === undefined) { throw new runtime.RequiredError('ratingId', 'Required parameter requestParameters.ratingId was null or undefined when calling postRatingsReverseRateValuesWithOfficeWithRatingId.'); } if (requestParameters.rateInputValues === null || requestParameters.rateInputValues === undefined) { throw new runtime.RequiredError('rateInputValues', 'Required parameter requestParameters.rateInputValues was null or undefined when calling postRatingsReverseRateValuesWithOfficeWithRatingId.'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/reverse-rate-values/{office}/{rating-id}`.replace(`{${"office"}}`, encodeURIComponent(String(requestParameters.office))).replace(`{${"rating-id"}}`, encodeURIComponent(String(requestParameters.ratingId))), method: 'POST', headers: headerParameters, query: queryParameters, body: models_1.RateInputValuesToJSON(requestParameters.rateInputValues), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => models_1.RatedOutputValuesFromJSON(jsonValue)); }); } /** * Reverse rates input values using CWMS ratings. The input format `RateInputValues` requires a singular array of doubles corresponding to the dependent parameter in the rating curve. The output format `RatedOutputValues` will contain a singular double array corresponding to the independent parameter of the rating curve. Note: This endpoint only works on monotonically increase/decreasing table ratings with a single independent parameter. * Post ratings reverseRateValues with office with ratingId */ postRatingsReverseRateValuesWithOfficeWithRatingId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postRatingsReverseRateValuesWithOfficeWithRatingIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create new Rating Specification * Post ratings spec */ postRatingsSpecRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingSpec === null || requestParameters.ratingSpec === undefined) { throw new runtime.RequiredError('ratingSpec', 'Required parameter requestParameters.ratingSpec was null or undefined when calling postRatingsSpec.'); } const queryParameters = {}; if (requestParameters.failIfExists !== undefined) { queryParameters['fail-if-exists'] = requestParameters.failIfExists; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/xml;version=2'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/spec`, method: 'POST', headers: headerParameters, query: queryParameters, body: models_1.RatingSpecToJSON(requestParameters.ratingSpec), }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Create new Rating Specification * Post ratings spec */ postRatingsSpec(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postRatingsSpecRaw(requestParameters, initOverrides); }); } /** * Create new Rating Template * Post ratings template */ postRatingsTemplateRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.ratingTemplate === null || requestParameters.ratingTemplate === undefined) { throw new runtime.RequiredError('ratingTemplate', 'Required parameter requestParameters.ratingTemplate was null or undefined when calling postRatingsTemplate.'); } const queryParameters = {}; if (requestParameters.failIfExists !== undefined) { queryParameters['fail-if-exists'] = requestParameters.failIfExists; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/xml;version=2'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = yield this.request({ path: `/ratings/template`, method: 'POST', headers: headerParameters, query: queryParameters, body: models_1.RatingTemplateToJSON(requestParameters.ratingTemplate), }, initOverrides); return new runtime.VoidApiResponse(response); }); } /** * Create new Rating Template * Post ratings template */ postRatingsTemplate(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postRatingsTemplateRaw(requestParameters, initOverrides); }); } } exports.RatingsApi = RatingsApi;