export type DeleteApiV2StorageBucketsBucketIdMetadataMetadataIdArgs = {bucketId: string, metadataId: number}; export type DeleteApiV2StorageBucketsBucketIdMetadataMetadataIdOptions = {baseUrl?: string | undefined, StorageKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete bucket metadata * * DELETE /v2/storage/buckets/{bucketId}/metadata/{metadataId} * * Also accepts auth: ManageKey, BearerAuth */ export const deleteApiV2StorageBucketsBucketIdMetadataMetadataId = async (args: DeleteApiV2StorageBucketsBucketIdMetadataMetadataIdArgs, options?: DeleteApiV2StorageBucketsBucketIdMetadataMetadataIdOptions) => { const {baseUrl = "https://connection.keboola.com", fetch: fetchFn = fetch, StorageKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (StorageKey !== undefined) headers.set("X-StorageApi-Token", StorageKey) const url = `${baseUrl.replace(/\/+$/, '')}/v2/storage/buckets/${encodeURIComponent(String(args.bucketId))}/metadata/${encodeURIComponent(String(args.metadataId))}${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 };