export type Vcs = {type?: string | undefined, id?: string | undefined, attributes?: ({accessToken?: string | undefined, clientId?: string | undefined, clientSecret?: string | undefined, createdBy?: string | undefined, createdDate?: string | undefined, description?: string | undefined, name?: string | undefined, status?: ('PENDING' | 'COMPLETED' | 'ERROR') | undefined, updatedBy?: string | undefined, updatedDate?: string | undefined, vcsType?: ('GITHUB' | 'GITLAB' | 'BITBUCKET' | 'AZURE_DEVOPS' | 'PUBLIC') | undefined}) | undefined, relationships?: ({organization?: ({id?: string | undefined, type?: 'organization' | undefined}) | undefined}) | undefined}; export type PatchApiWorkspaceWorkspaceIdVcsVcsIdArgs = {body: {data?: Vcs | undefined}}; export type PatchApiWorkspaceWorkspaceIdVcsVcsIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type vcs * * PATCH /workspace/{workspaceId}/vcs/{vcsId} */ export const patchApiWorkspaceWorkspaceIdVcsVcsId = async (args: PatchApiWorkspaceWorkspaceIdVcsVcsIdArgs, options: PatchApiWorkspaceWorkspaceIdVcsVcsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") const url = `${baseUrl.replace(/\/+$/, '')}/workspace/${encodeURIComponent(String(args.workspaceId))}/vcs/${encodeURIComponent(String(args.vcsId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };