export type GetApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceCrCrnameArgs = {workspace: string}; export type GetApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceCrCrnameOptions = {baseUrl: string, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /kapis/application.kubesphere.io/v2/workspaces/{workspace}/cr/{crname} */ export const getApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceCrCrname = async (args: GetApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceCrCrnameArgs, options: GetApiKapisApplicationKubesphereIoV2WorkspacesWorkspaceCrCrnameOptions) => { 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))}/cr/${encodeURIComponent(String(args.crname))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };