UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
84 lines (83 loc) 3.42 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](https://status.asknews.app/status/prod) * * The version of the OpenAPI document: 0.24.66 * Contact: contact@emergentmethods.ai * * 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) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 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) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import * as runtime from '../runtime'; import { ProfileResponseFromJSON, RateLimitStatusResponseFromJSON, } from '../models/index'; /** * */ export class ProfileApi extends runtime.BaseAPI { /** * Return the caller\'s current rate-limit and concurrency-limit state without consuming any tokens. * Get the current user\'s rate limit status */ getRateLimitStatusRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; const headerParameters = {}; const response = yield this.request({ path: `/v1/profiles/me/limits`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RateLimitStatusResponseFromJSON(jsonValue)); }); } /** * Return the caller\'s current rate-limit and concurrency-limit state without consuming any tokens. * Get the current user\'s rate limit status */ getRateLimitStatus(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getRateLimitStatusRaw(initOverrides); return yield response.value(); }); } /** * Get the current profile * Get the current user\'s profile */ getUserProfileRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; const headerParameters = {}; const response = yield this.request({ path: `/v1/profiles/me`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProfileResponseFromJSON(jsonValue)); }); } /** * Get the current profile * Get the current user\'s profile */ getUserProfile(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getUserProfileRaw(initOverrides); return yield response.value(); }); } }