export type PatchApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceReposRepoArgs = {workspace: string}; export type PatchApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceReposRepoOptions = {baseUrl: string, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /kapis/application.kubesphere.io/v2/workspaces/{workspace}/repos/{repo} */ export const patchApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceReposRepo = async (args: PatchApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceReposRepoArgs, options: PatchApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceReposRepoOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerToken !== undefined) headers.set("Authorization", BearerToken) const url = `${baseUrl.replace(/\/+$/, '')}/kapis/application.kubesphere.io/v2/workspaces/${encodeURIComponent(String(args.workspace))}/repos/${encodeURIComponent(String(args.repo))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };