/* tslint:disable */ /* eslint-disable */ /** * Faraday REST API * The [Faraday](https://faraday.ai) API makes it easy to predict customer behavior programmatically. See our [API change policy](https://faraday.ai/legal). * * The version of the OpenAPI document: 1.0.0 * Contact: support@faraday.ai * * 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 { Location, } from '../models'; export interface GetAtlasLocationsRequest { atlasId: string; limit?: number; offset?: number; } export interface GetLocationsRequest { limit?: number; offset?: number; } /** * */ export class LocationsApi extends runtime.BaseAPI { /** * Get a list of the locations belonging to a specific atlas * List the locations of an atlas */ async getAtlasLocationsRaw(requestParameters: GetAtlasLocationsRequest, ): Promise>> { if (requestParameters.atlasId === null || requestParameters.atlasId === undefined) { throw new runtime.RequiredError('atlasId','Required parameter requestParameters.atlasId was null or undefined when calling getAtlasLocations.'); } const queryParameters: any = {}; if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.offset !== undefined) { queryParameters['offset'] = requestParameters.offset; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/atlases/{atlas_id}/locations`.replace(`{${"atlas_id"}}`, encodeURIComponent(String(requestParameters.atlasId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get a list of the locations belonging to a specific atlas * List the locations of an atlas */ async getAtlasLocations(atlasId: string, limit?: number, offset?: number, ): Promise> { const response = await this.getAtlasLocationsRaw({ atlasId: atlasId, limit: limit, offset: offset }, ); return await response.value(); } /** * Get a list of the locations belonging to every atlas on the account * List locations */ async getLocationsRaw(requestParameters: GetLocationsRequest, ): Promise>> { const queryParameters: any = {}; if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.offset !== undefined) { queryParameters['offset'] = requestParameters.offset; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/locations`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get a list of the locations belonging to every atlas on the account * List locations */ async getLocations(limit?: number, offset?: number, ): Promise> { const response = await this.getLocationsRaw({ limit: limit, offset: offset }, ); return await response.value(); } }