/* tslint:disable */ /* eslint-disable */ /** * Fabric API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.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 * as runtime from '../runtime'; import type { CreateFile201Response, FileCreation, } from '../models/index'; import { CreateFile201ResponseFromJSON, CreateFile201ResponseToJSON, FileCreationFromJSON, FileCreationToJSON, } from '../models/index'; export type CreateFileRequest = Omit; /** * */ export class FilesApi extends runtime.BaseAPI { /** * To create a file item you first need to store it using the upload endpoint. * Create file */ async createRaw(requestParameters: CreateFileRequest, initOverrides?: runtime.InitOverrides | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (requestParameters['baseId'] != null) { headerParameters['X-Fabric-Base-Id'] = String(requestParameters['baseId']); } if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); } if (this.configuration && this.configuration.apiKey) { headerParameters["X-Api-Key"] = await this.configuration.apiKey("X-Api-Key"); // ApiKey authentication } let urlPath = `/v2/files`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: FileCreationToJSON(requestParameters), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateFile201ResponseFromJSON(jsonValue)); } /** * To create a file item you first need to store it using the upload endpoint. * Create file */ async create(requestParameters: CreateFileRequest, initOverrides?: runtime.InitOverrides | runtime.InitOverrideFunction): Promise { const response = await this.createRaw(requestParameters, initOverrides); return await response.value(); } }