Skip to main content
Module

x/windmill/windmill-api/apis/ScriptApi.ts

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
File
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
// TODO: better import syntax?import {BaseAPIRequestFactory, RequiredError} from './baseapi.ts';import {Configuration} from '../configuration.ts';import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts';import {ObjectSerializer} from '../models/ObjectSerializer.ts';import {ApiException} from './exception.ts';import {canConsumeForm, isCodeInRange} from '../util.ts';import {SecurityAuthentication} from '../auth/auth.ts';

import { InlineObject15 } from '../models/InlineObject15.ts';import { InlineResponse2002 } from '../models/InlineResponse2002.ts';import { InlineResponse2005 } from '../models/InlineResponse2005.ts';import { MainArgSignature } from '../models/MainArgSignature.ts';import { Script } from '../models/Script.ts';
/** * no description */export class ScriptApiRequestFactory extends BaseAPIRequestFactory {
/** * archive script by hash * @param workspace * @param hash */ public async archiveScriptByHash(workspace: string, hash: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "archiveScriptByHash", "workspace"); }

// verify required parameter 'hash' is not null or undefined if (hash === null || hash === undefined) { throw new RequiredError("ScriptApi", "archiveScriptByHash", "hash"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/archive/h/{hash}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'hash' + '}', encodeURIComponent(String(hash)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * archive script by path * @param workspace * @param path */ public async archiveScriptByPath(workspace: string, path: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "archiveScriptByPath", "workspace"); }

// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("ScriptApi", "archiveScriptByPath", "path"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/archive/p/{path}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * create script * @param workspace * @param inlineObject15 */ public async createScript(workspace: string, inlineObject15: InlineObject15, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "createScript", "workspace"); }

// verify required parameter 'inlineObject15' is not null or undefined if (inlineObject15 === null || inlineObject15 === undefined) { throw new RequiredError("ScriptApi", "createScript", "inlineObject15"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/create' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(inlineObject15, "InlineObject15", ""), contentType ); requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * delete script by hash (erase content but keep hash) * @param workspace * @param hash */ public async deleteScriptByHash(workspace: string, hash: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "deleteScriptByHash", "workspace"); }

// verify required parameter 'hash' is not null or undefined if (hash === null || hash === undefined) { throw new RequiredError("ScriptApi", "deleteScriptByHash", "hash"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/delete/h/{hash}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'hash' + '}', encodeURIComponent(String(hash)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * inspect deno code to infer jsonschema of arguments * @param body deno code with the main function */ public async denoToJsonschema(body: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("ScriptApi", "denoToJsonschema", "body"); }

// Path Params const localVarPath = '/scripts/deno/tojsonschema';
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(body, "string", ""), contentType ); requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * exists script by path * @param workspace * @param path */ public async existsScriptByPath(workspace: string, path: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "existsScriptByPath", "workspace"); }

// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("ScriptApi", "existsScriptByPath", "path"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/exists/p/{path}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * get hub script content by path * @param path */ public async getHubScriptContentByPath(path: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("ScriptApi", "getHubScriptContentByPath", "path"); }

// Path Params const localVarPath = '/scripts/hub/get/{path}' .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * get script by hash * @param workspace * @param hash */ public async getScriptByHash(workspace: string, hash: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "getScriptByHash", "workspace"); }

// verify required parameter 'hash' is not null or undefined if (hash === null || hash === undefined) { throw new RequiredError("ScriptApi", "getScriptByHash", "hash"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/get/h/{hash}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'hash' + '}', encodeURIComponent(String(hash)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * get script by path * @param workspace * @param path */ public async getScriptByPath(workspace: string, path: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "getScriptByPath", "workspace"); }

// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("ScriptApi", "getScriptByPath", "path"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/get/p/{path}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * get script deployment status * @param workspace * @param hash */ public async getScriptDeploymentStatus(workspace: string, hash: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "getScriptDeploymentStatus", "workspace"); }

// verify required parameter 'hash' is not null or undefined if (hash === null || hash === undefined) { throw new RequiredError("ScriptApi", "getScriptDeploymentStatus", "hash"); }

// Path Params const localVarPath = '/w/{workspace}/scripts/deployment_status/h/{hash}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'hash' + '}', encodeURIComponent(String(hash)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * list all available hub scripts */ public async listHubScripts(_options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// Path Params const localVarPath = '/scripts/hub/list';
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * list all available scripts * @param workspace * @param page which page to return (start at 1, default 1) * @param perPage number of items to return for a given page (default 30, max 100) * @param orderDesc order by desc order (default true) * @param createdBy mask to filter exact matching user creator * @param pathStart mask to filter matching starting path * @param pathExact mask to filter exact matching path * @param firstParentHash mask to filter scripts whom first direct parent has exact hash * @param lastParentHash mask to filter scripts whom last parent in the chain has exact hash. Beware that each script stores only a limited number of parents. Hence the last parent hash for a script is not necessarily its top-most parent. To find the top-most parent you will have to jump from last to last hash until finding the parent * @param parentHash is the hash present in the array of stored parent hashes for this script. The same warning applies than for last_parent_hash. A script only store a limited number of direct parent * @param showArchived (default false) show also the archived files. when multiple archived hash share the same path, only the ones with the latest create_at are displayed. * @param isTemplate (default regardless) if true show only the templates if false show only the non templates if not defined, show all regardless of if the script is a template * @param isTrigger (default regardless) if true show only the trigger scripts if false show only the non trigger scripts if not defined, show all regardless of if the script is a trigger script */ public async listScripts(workspace: string, page?: number, perPage?: number, orderDesc?: boolean, createdBy?: string, pathStart?: string, pathExact?: string, firstParentHash?: string, lastParentHash?: string, parentHash?: string, showArchived?: boolean, isTemplate?: boolean, isTrigger?: boolean, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("ScriptApi", "listScripts", "workspace"); }













// Path Params const localVarPath = '/w/{workspace}/scripts/list' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params if (page !== undefined) { requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", "int32")); }
// Query Params if (perPage !== undefined) { requestContext.setQueryParam("per_page", ObjectSerializer.serialize(perPage, "number", "int32")); }
// Query Params if (orderDesc !== undefined) { requestContext.setQueryParam("order_desc", ObjectSerializer.serialize(orderDesc, "boolean", "")); }
// Query Params if (createdBy !== undefined) { requestContext.setQueryParam("created_by", ObjectSerializer.serialize(createdBy, "string", "")); }
// Query Params if (pathStart !== undefined) { requestContext.setQueryParam("path_start", ObjectSerializer.serialize(pathStart, "string", "")); }
// Query Params if (pathExact !== undefined) { requestContext.setQueryParam("path_exact", ObjectSerializer.serialize(pathExact, "string", "")); }
// Query Params if (firstParentHash !== undefined) { requestContext.setQueryParam("first_parent_hash", ObjectSerializer.serialize(firstParentHash, "string", "")); }
// Query Params if (lastParentHash !== undefined) { requestContext.setQueryParam("last_parent_hash", ObjectSerializer.serialize(lastParentHash, "string", "")); }
// Query Params if (parentHash !== undefined) { requestContext.setQueryParam("parent_hash", ObjectSerializer.serialize(parentHash, "string", "")); }
// Query Params if (showArchived !== undefined) { requestContext.setQueryParam("show_archived", ObjectSerializer.serialize(showArchived, "boolean", "")); }
// Query Params if (isTemplate !== undefined) { requestContext.setQueryParam("is_template", ObjectSerializer.serialize(isTemplate, "boolean", "")); }
// Query Params if (isTrigger !== undefined) { requestContext.setQueryParam("is_trigger", ObjectSerializer.serialize(isTrigger, "boolean", "")); }

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * inspect python code to infer jsonschema of arguments * @param body python code with the main function */ public async pythonToJsonschema(body: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("ScriptApi", "pythonToJsonschema", "body"); }

// Path Params const localVarPath = '/scripts/python/tojsonschema';
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(body, "string", ""), contentType ); requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
}
export class ScriptApiResponseProcessor {
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to archiveScriptByHash * @throws ApiException if the response code was not in [200, 299] */ public async archiveScriptByHash(response: ResponseContext): Promise<Script > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to archiveScriptByPath * @throws ApiException if the response code was not in [200, 299] */ public async archiveScriptByPath(response: ResponseContext): Promise<string > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to createScript * @throws ApiException if the response code was not in [200, 299] */ public async createScript(response: ResponseContext): Promise<string > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to deleteScriptByHash * @throws ApiException if the response code was not in [200, 299] */ public async deleteScriptByHash(response: ResponseContext): Promise<Script > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to denoToJsonschema * @throws ApiException if the response code was not in [200, 299] */ public async denoToJsonschema(response: ResponseContext): Promise<MainArgSignature > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: MainArgSignature = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "MainArgSignature", "" ) as MainArgSignature; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: MainArgSignature = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "MainArgSignature", "" ) as MainArgSignature; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to existsScriptByPath * @throws ApiException if the response code was not in [200, 299] */ public async existsScriptByPath(response: ResponseContext): Promise<boolean > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: boolean = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "boolean", "" ) as boolean; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: boolean = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "boolean", "" ) as boolean; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to getHubScriptContentByPath * @throws ApiException if the response code was not in [200, 299] */ public async getHubScriptContentByPath(response: ResponseContext): Promise<string > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to getScriptByHash * @throws ApiException if the response code was not in [200, 299] */ public async getScriptByHash(response: ResponseContext): Promise<Script > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to getScriptByPath * @throws ApiException if the response code was not in [200, 299] */ public async getScriptByPath(response: ResponseContext): Promise<Script > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: Script = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Script", "" ) as Script; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to getScriptDeploymentStatus * @throws ApiException if the response code was not in [200, 299] */ public async getScriptDeploymentStatus(response: ResponseContext): Promise<InlineResponse2005 > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: InlineResponse2005 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2005", "" ) as InlineResponse2005; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: InlineResponse2005 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2005", "" ) as InlineResponse2005; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listHubScripts * @throws ApiException if the response code was not in [200, 299] */ public async listHubScripts(response: ResponseContext): Promise<InlineResponse2002 > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: InlineResponse2002 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2002", "" ) as InlineResponse2002; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: InlineResponse2002 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2002", "" ) as InlineResponse2002; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listScripts * @throws ApiException if the response code was not in [200, 299] */ public async listScripts(response: ResponseContext): Promise<Array<Script> > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Array<Script> = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Array<Script>", "" ) as Array<Script>; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: Array<Script> = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Array<Script>", "" ) as Array<Script>; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to pythonToJsonschema * @throws ApiException if the response code was not in [200, 299] */ public async pythonToJsonschema(response: ResponseContext): Promise<MainArgSignature > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: MainArgSignature = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "MainArgSignature", "" ) as MainArgSignature; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: MainArgSignature = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "MainArgSignature", "" ) as MainArgSignature; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
}