UNPKG

@space-cow-media/spellbook-client

Version:

An Open Api generated client for the Commander Spellbook backend REST API.

118 lines 5.15 kB
/* tslint:disable */ /* eslint-disable */ /** * Commander Spellbook API * API for Commander Spellbook, the combo database engine for Magic: The Gathering * * The version of the OpenAPI document: 5.4.10 * * * 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.js'; import { DeckFromJSON, } from '../models/Deck.js'; /** * */ export class CardListFromTextApi extends runtime.BaseAPI { /** * Creates request options for cardListFromTextCreate without sending the request */ cardListFromTextCreateRequestOpts(requestParameters) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'text/plain'; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token("jwtAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/card-list-from-text`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters['body'], }; }); } /** */ cardListFromTextCreateRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const requestOptions = yield this.cardListFromTextCreateRequestOpts(requestParameters); const response = yield this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => DeckFromJSON(jsonValue)); }); } /** */ cardListFromTextCreate() { return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) { const response = yield this.cardListFromTextCreateRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Creates request options for cardListFromTextRetrieve without sending the request */ cardListFromTextRetrieveRequestOpts() { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; const headerParameters = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token("jwtAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/card-list-from-text`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; }); } /** */ cardListFromTextRetrieveRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const requestOptions = yield this.cardListFromTextRetrieveRequestOpts(); const response = yield this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => DeckFromJSON(jsonValue)); }); } /** */ cardListFromTextRetrieve(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cardListFromTextRetrieveRaw(initOverrides); return yield response.value(); }); } } //# sourceMappingURL=CardListFromTextApi.js.map