export type DeleteApiV1StoragesStorageIdAutoScanArgs = {'App-ID': string, 'Auth-Token': string, storage_id: string}; export type DeleteApiV1StoragesStorageIdAutoScanOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Disable cloud storage auto scan * * DELETE /v1/storages/{storage_id}/auto_scan/ */ export const deleteApiV1StoragesStorageIdAutoScan = async (args: DeleteApiV1StoragesStorageIdAutoScanArgs, options: DeleteApiV1StoragesStorageIdAutoScanOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/storages/${encodeURIComponent(String(args.storage_id))}/auto_scan/${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 };