Module
x/windmill/windmill-api/services/ResourceService.ts
Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Extremely Popular
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515/* istanbul ignore file *//* tslint:disable *//* eslint-disable */import type { CreateResource } from '../models/CreateResource.ts';import type { EditResource } from '../models/EditResource.ts';import type { EditResourceType } from '../models/EditResourceType.ts';import type { ListableResource } from '../models/ListableResource.ts';import type { Resource } from '../models/Resource.ts';import type { ResourceType } from '../models/ResourceType.ts';
import type { CancelablePromise } from '../core/CancelablePromise.ts';import { OpenAPI } from '../core/OpenAPI.ts';import { request as __request } from '../core/request.ts';
export class ResourceService {
/** * create resource * @returns string resource created * @throws ApiError */ public static createResource({ workspace, requestBody, updateIfExists, }: { workspace: string, /** * new resource */ requestBody: CreateResource, updateIfExists?: boolean, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/resources/create', path: { 'workspace': workspace, }, query: { 'update_if_exists': updateIfExists, }, body: requestBody, mediaType: 'application/json', }); }
/** * delete resource * @returns string resource deleted * @throws ApiError */ public static deleteResource({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'DELETE', url: '/w/{workspace}/resources/delete/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * update resource * @returns string resource updated * @throws ApiError */ public static updateResource({ workspace, path, requestBody, }: { workspace: string, path: string, /** * updated resource */ requestBody: EditResource, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/resources/update/{path}', path: { 'workspace': workspace, 'path': path, }, body: requestBody, mediaType: 'application/json', }); }
/** * update resource value * @returns string resource value updated * @throws ApiError */ public static updateResourceValue({ workspace, path, requestBody, }: { workspace: string, path: string, /** * updated resource */ requestBody: { value?: any; }, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/resources/update_value/{path}', path: { 'workspace': workspace, 'path': path, }, body: requestBody, mediaType: 'application/json', }); }
/** * get resource * @returns Resource resource * @throws ApiError */ public static getResource({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<Resource> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/get/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * get resource interpolated (variables and resources are fully unrolled) * @returns any resource value * @throws ApiError */ public static getResourceValueInterpolated({ workspace, path, jobId, }: { workspace: string, path: string, /** * job id */ jobId?: string, }): CancelablePromise<any> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/get_value_interpolated/{path}', path: { 'workspace': workspace, 'path': path, }, query: { 'job_id': jobId, }, }); }
/** * get resource value * @returns any resource value * @throws ApiError */ public static getResourceValue({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<any> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/get_value/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * does resource exists * @returns boolean does resource exists * @throws ApiError */ public static existsResource({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<boolean> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/exists/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * list resources * @returns ListableResource resource list * @throws ApiError */ public static listResource({ workspace, page, perPage, resourceType, resourceTypeExclude, }: { workspace: string, /** * which page to return (start at 1, default 1) */ page?: number, /** * number of items to return for a given page (default 30, max 100) */ perPage?: number, /** * resource_types to list from, separated by ',', */ resourceType?: string, /** * resource_types to not list from, separated by ',', */ resourceTypeExclude?: string, }): CancelablePromise<Array<ListableResource>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/list', path: { 'workspace': workspace, }, query: { 'page': page, 'per_page': perPage, 'resource_type': resourceType, 'resource_type_exclude': resourceTypeExclude, }, }); }
/** * list resources for search * @returns any resource list * @throws ApiError */ public static listSearchResource({ workspace, }: { workspace: string, }): CancelablePromise<Array<{ path: string; value: any; }>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/list_search', path: { 'workspace': workspace, }, }); }
/** * list resource names * @returns any resource list names * @throws ApiError */ public static listResourceNames({ workspace, name, }: { workspace: string, name: string, }): CancelablePromise<Array<{ name: string; path: string; }>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/list_names/{name}', path: { 'workspace': workspace, 'name': name, }, }); }
/** * create resource_type * @returns string resource_type created * @throws ApiError */ public static createResourceType({ workspace, requestBody, }: { workspace: string, /** * new resource_type */ requestBody: ResourceType, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/resources/type/create', path: { 'workspace': workspace, }, body: requestBody, mediaType: 'application/json', }); }
/** * delete resource_type * @returns string resource_type deleted * @throws ApiError */ public static deleteResourceType({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'DELETE', url: '/w/{workspace}/resources/type/delete/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * update resource_type * @returns string resource_type updated * @throws ApiError */ public static updateResourceType({ workspace, path, requestBody, }: { workspace: string, path: string, /** * updated resource_type */ requestBody: EditResourceType, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/resources/type/update/{path}', path: { 'workspace': workspace, 'path': path, }, body: requestBody, mediaType: 'application/json', }); }
/** * get resource_type * @returns ResourceType resource_type deleted * @throws ApiError */ public static getResourceType({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<ResourceType> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/type/get/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * does resource_type exists * @returns boolean does resource_type exist * @throws ApiError */ public static existsResourceType({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<boolean> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/type/exists/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * list resource_types * @returns ResourceType resource_type list * @throws ApiError */ public static listResourceType({ workspace, }: { workspace: string, }): CancelablePromise<Array<ResourceType>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/type/list', path: { 'workspace': workspace, }, }); }
/** * list resource_types names * @returns string resource_type list * @throws ApiError */ public static listResourceTypeNames({ workspace, }: { workspace: string, }): CancelablePromise<Array<string>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/resources/type/listnames', path: { 'workspace': workspace, }, }); }
/** * query resource types by similarity * @returns any resource type details * @throws ApiError */ public static queryResourceTypes({ workspace, text, limit, }: { workspace: string, /** * query text */ text: string, /** * query limit */ limit?: number, }): CancelablePromise<Array<{ name: string; score: number; schema?: any; }>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/embeddings/query_resource_types', path: { 'workspace': workspace, }, query: { 'text': text, 'limit': limit, }, }); }
}