/** * Apimatic APILib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { ApiResponse, FileWrapper, RequestOptions } from '../core.js'; import { ContentType, contentTypeSchema } from '../models/contentType.js'; import { BaseController } from './baseController.js'; export class TableOfContentsController extends BaseController { /** * Generate Table of Contents (TOC) data for an API specification by uploading the API specification * file as a zip archive. * * This endpoint streams the generated TOC data directly in the response as a JSON file. * * @param contentType * @param file The API specification zip archive. The zip file should contain the API * specification file in any of the [supported formats](https://docs.apimatic. * io/api-transformer/overview-transformer#supported-input-formats). * @return Response from the API call */ async generateTocData( contentType: ContentType, file: FileWrapper, queryParameters?: Record, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST', '/toc-data'); const mapped = req.prepareArgs({ contentType: [contentType, contentTypeSchema], }); req.header('Content-Type', mapped.contentType); req.query(queryParameters); req.formData({ file: file }); req.authenticate([{ authorization: true }]); return req.callAsStream(requestOptions); } }