UNPKG

cwmsjs

Version:

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

82 lines (67 loc) 2.63 kB
/* 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, CwmsIdLocationKind, CwmsIdLocationKindFromJSON, CwmsIdLocationKindToJSON, } from '../models'; export interface GetLocationsWithKindsRequest { names?: string; locationKindLike?: string; office?: string; } /** * */ export class REGIApi extends runtime.BaseAPI { /** * Returns CWMS Location Data. The Catalog end-point is also capable of retrieving lists of locations and can filter on additional fields. * Get locations withKinds */ async getLocationsWithKindsRaw(requestParameters: GetLocationsWithKindsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<CwmsIdLocationKind>>> { const queryParameters: any = {}; if (requestParameters.names !== undefined) { queryParameters['names'] = requestParameters.names; } if (requestParameters.locationKindLike !== undefined) { queryParameters['location-kind-like'] = requestParameters.locationKindLike; } if (requestParameters.office !== undefined) { queryParameters['office'] = requestParameters.office; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/locations/with-kinds`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CwmsIdLocationKindFromJSON)); } /** * Returns CWMS Location Data. The Catalog end-point is also capable of retrieving lists of locations and can filter on additional fields. * Get locations withKinds */ async getLocationsWithKinds(requestParameters: GetLocationsWithKindsRequest = {}, initOverrides?: RequestInit): Promise<Array<CwmsIdLocationKind>> { const response = await this.getLocationsWithKindsRaw(requestParameters, initOverrides); return await response.value(); } }