export type DeleteApiV1WorkspaceWsApiKeyApiKeyIdArgs = {workspace: string, api_key_id: string}; export type DeleteApiV1WorkspaceWsApiKeyApiKeyIdOptions = {baseUrl?: string | undefined, ServiceTokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete API Key * * DELETE /v1/{workspace}/ws_api_key/{api_key_id}/ */ export const deleteApiV1WorkspaceWsApiKeyApiKeyId = async (args: DeleteApiV1WorkspaceWsApiKeyApiKeyIdArgs, options?: DeleteApiV1WorkspaceWsApiKeyApiKeyIdOptions) => { const {baseUrl = "https://management-api.suprsend.com", fetch: fetchFn = fetch, ServiceTokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ServiceTokenAuth !== undefined) headers.set("Authorization", ServiceTokenAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/${encodeURIComponent(String(args.workspace))}/ws_api_key/${encodeURIComponent(String(args.api_key_id))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };