/** * Apimatic APILib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { ApiResponse, RequestOptions } from '../core.js'; import { string } from '../schema.js'; import { BaseController } from './baseController.js'; import { InternalServerErrorResponseError } from '../errors/internalServerErrorResponseError.js'; import { ProblemDetailsError } from '../errors/problemDetailsError.js'; import { UnauthorizedResponseError } from '../errors/unauthorizedResponseError.js'; export class SdkSourceTreeGenerationAsyncController extends BaseController { /** * Downloads the SDK Source Tree artifact. The endpoint returns a zip file containing the generated SDK * Source Tree. * * @param id * @return Response from the API call */ async downloadGeneratedSdkSourceTree( id: string, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('GET'); const mapped = req.prepareArgs({ id: [id, string()] }); req.appendTemplatePath`/sdk-source-tree/${mapped.id}/download`; req.throwOn(400, ProblemDetailsError, 'Bad Request'); req.throwOn(401, UnauthorizedResponseError, 'Unauthorized'); req.throwOn(500, InternalServerErrorResponseError, 'Internal Server Error'); req.authenticate([{ authorization: true }]); return req.callAsStream(requestOptions); } }