export type DeleteApiV1WorkspaceWsPublicKeyPublicKeyIdArgs = {workspace: string, public_key_id: string}; export type DeleteApiV1WorkspaceWsPublicKeyPublicKeyIdOptions = {baseUrl?: string | undefined, ServiceTokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Workspace Public Key * * DELETE /v1/{workspace}/ws_public_key/{public_key_id}/ */ export const deleteApiV1WorkspaceWsPublicKeyPublicKeyId = async (args: DeleteApiV1WorkspaceWsPublicKeyPublicKeyIdArgs, options?: DeleteApiV1WorkspaceWsPublicKeyPublicKeyIdOptions) => { 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_public_key/${encodeURIComponent(String(args.public_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 };