cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
64 lines (53 loc) • 1.67 kB
text/typescript
/* 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.
*/
import * as runtime from '../runtime';
import {
CdaError,
CdaErrorFromJSON,
CdaErrorToJSON,
CdaVersion,
CdaVersionFromJSON,
CdaVersionToJSON,
} from '../models';
/**
*
*/
export class VersionApi extends runtime.BaseAPI {
/**
* Determine the current active version of CWMS Data API.
* Get version
*/
async getVersionRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<CdaVersion>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
}
const response = await this.request({
path: `/version`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => CdaVersionFromJSON(jsonValue));
}
/**
* Determine the current active version of CWMS Data API.
* Get version
*/
async getVersion(initOverrides?: RequestInit): Promise<CdaVersion> {
const response = await this.getVersionRaw(initOverrides);
return await response.value();
}
}