/** * FastAPI * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import localVarRequest from 'request'; import http from 'http'; /* tslint:disable:no-unused-locals */ import { HDChart } from '../model/hDChart'; import { HTTPValidationError } from '../model/hTTPValidationError'; import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; import { HttpError, RequestFile } from './apis'; let defaultBasePath = 'https://astro.macdorfenburger.com/api/v1'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== export enum DefaultApiApiKeys { APIKeyCookie, APIKeyHeader, APIKeyQuery, } export class DefaultApi { protected _basePath = defaultBasePath; protected _defaultHeaders : any = {}; protected _useQuerystring : boolean = false; protected authentications = { 'default': new VoidAuth(), 'APIKeyCookie': new ApiKeyAuth('cookie', 'api_key'), 'APIKeyHeader': new ApiKeyAuth('header', 'api_key'), 'APIKeyQuery': new ApiKeyAuth('query', 'api_key'), } protected interceptors: Interceptor[] = []; constructor(basePath?: string); constructor(basePathOrUsername: string, password?: string, basePath?: string) { if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername } } } set useQuerystring(value: boolean) { this._useQuerystring = value; } set basePath(basePath: string) { this._basePath = basePath; } set defaultHeaders(defaultHeaders: any) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } public setDefaultAuthentication(auth: Authentication) { this.authentications.default = auth; } public setApiKey(key: DefaultApiApiKeys, value: string) { (this.authentications as any)[DefaultApiApiKeys[key]].apiKey = value; } public addInterceptor(interceptor: Interceptor) { this.interceptors.push(interceptor); } /** * Get the human design chart for the given birth coordinates. * @summary * @param tz * @param localDate * @param localTime * @param lat * @param lng */ public async chartGet (tz: string, localDate: string, localTime: string, lat: number, lng: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: HDChart; }> { const localVarPath = this.basePath + '/chart'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'tz' is not null or undefined if (tz === null || tz === undefined) { throw new Error('Required parameter tz was null or undefined when calling chartGet.'); } // verify required parameter 'localDate' is not null or undefined if (localDate === null || localDate === undefined) { throw new Error('Required parameter localDate was null or undefined when calling chartGet.'); } // verify required parameter 'localTime' is not null or undefined if (localTime === null || localTime === undefined) { throw new Error('Required parameter localTime was null or undefined when calling chartGet.'); } // verify required parameter 'lat' is not null or undefined if (lat === null || lat === undefined) { throw new Error('Required parameter lat was null or undefined when calling chartGet.'); } // verify required parameter 'lng' is not null or undefined if (lng === null || lng === undefined) { throw new Error('Required parameter lng was null or undefined when calling chartGet.'); } if (tz !== undefined) { localVarQueryParameters['tz'] = ObjectSerializer.serialize(tz, "string"); } if (localDate !== undefined) { localVarQueryParameters['local_date'] = ObjectSerializer.serialize(localDate, "string"); } if (localTime !== undefined) { localVarQueryParameters['local_time'] = ObjectSerializer.serialize(localTime, "string"); } if (lat !== undefined) { localVarQueryParameters['lat'] = ObjectSerializer.serialize(lat, "number"); } if (lng !== undefined) { localVarQueryParameters['lng'] = ObjectSerializer.serialize(lng, "number"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.APIKeyCookie.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyCookie.applyToRequest(localVarRequestOptions)); } if (this.authentications.APIKeyHeader.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyHeader.applyToRequest(localVarRequestOptions)); } if (this.authentications.APIKeyQuery.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyQuery.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: HDChart; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { body = ObjectSerializer.deserialize(body, "HDChart"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * Get the full chart for the date of Saturn\'s conjunction with its own position in the natal chart for the given date of birth. * @summary * @param tz * @param localDate * @param localTime * @param lat * @param lng */ public async saturnReturnGet (tz: string, localDate: string, localTime: string, lat: number, lng: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: HDChart; }> { const localVarPath = this.basePath + '/saturn_return'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'tz' is not null or undefined if (tz === null || tz === undefined) { throw new Error('Required parameter tz was null or undefined when calling saturnReturnGet.'); } // verify required parameter 'localDate' is not null or undefined if (localDate === null || localDate === undefined) { throw new Error('Required parameter localDate was null or undefined when calling saturnReturnGet.'); } // verify required parameter 'localTime' is not null or undefined if (localTime === null || localTime === undefined) { throw new Error('Required parameter localTime was null or undefined when calling saturnReturnGet.'); } // verify required parameter 'lat' is not null or undefined if (lat === null || lat === undefined) { throw new Error('Required parameter lat was null or undefined when calling saturnReturnGet.'); } // verify required parameter 'lng' is not null or undefined if (lng === null || lng === undefined) { throw new Error('Required parameter lng was null or undefined when calling saturnReturnGet.'); } if (tz !== undefined) { localVarQueryParameters['tz'] = ObjectSerializer.serialize(tz, "string"); } if (localDate !== undefined) { localVarQueryParameters['local_date'] = ObjectSerializer.serialize(localDate, "string"); } if (localTime !== undefined) { localVarQueryParameters['local_time'] = ObjectSerializer.serialize(localTime, "string"); } if (lat !== undefined) { localVarQueryParameters['lat'] = ObjectSerializer.serialize(lat, "number"); } if (lng !== undefined) { localVarQueryParameters['lng'] = ObjectSerializer.serialize(lng, "number"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.APIKeyCookie.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyCookie.applyToRequest(localVarRequestOptions)); } if (this.authentications.APIKeyHeader.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyHeader.applyToRequest(localVarRequestOptions)); } if (this.authentications.APIKeyQuery.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyQuery.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: HDChart; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { body = ObjectSerializer.deserialize(body, "HDChart"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * Get the full chart for the date of Uranus\' opposition across its own position in the natal chart for the given date of birth. * @summary * @param tz * @param localDate * @param localTime * @param lat * @param lng */ public async uranusOppositionGet (tz: string, localDate: string, localTime: string, lat: number, lng: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: HDChart; }> { const localVarPath = this.basePath + '/uranus_opposition'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'tz' is not null or undefined if (tz === null || tz === undefined) { throw new Error('Required parameter tz was null or undefined when calling uranusOppositionGet.'); } // verify required parameter 'localDate' is not null or undefined if (localDate === null || localDate === undefined) { throw new Error('Required parameter localDate was null or undefined when calling uranusOppositionGet.'); } // verify required parameter 'localTime' is not null or undefined if (localTime === null || localTime === undefined) { throw new Error('Required parameter localTime was null or undefined when calling uranusOppositionGet.'); } // verify required parameter 'lat' is not null or undefined if (lat === null || lat === undefined) { throw new Error('Required parameter lat was null or undefined when calling uranusOppositionGet.'); } // verify required parameter 'lng' is not null or undefined if (lng === null || lng === undefined) { throw new Error('Required parameter lng was null or undefined when calling uranusOppositionGet.'); } if (tz !== undefined) { localVarQueryParameters['tz'] = ObjectSerializer.serialize(tz, "string"); } if (localDate !== undefined) { localVarQueryParameters['local_date'] = ObjectSerializer.serialize(localDate, "string"); } if (localTime !== undefined) { localVarQueryParameters['local_time'] = ObjectSerializer.serialize(localTime, "string"); } if (lat !== undefined) { localVarQueryParameters['lat'] = ObjectSerializer.serialize(lat, "number"); } if (lng !== undefined) { localVarQueryParameters['lng'] = ObjectSerializer.serialize(lng, "number"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.APIKeyCookie.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyCookie.applyToRequest(localVarRequestOptions)); } if (this.authentications.APIKeyHeader.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyHeader.applyToRequest(localVarRequestOptions)); } if (this.authentications.APIKeyQuery.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.APIKeyQuery.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: HDChart; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { body = ObjectSerializer.deserialize(body, "HDChart"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } }