export type CreateApiV2StorageBranchBranchIdTablesArgs = {branchId: string}; export type CreateApiV2StorageBranchBranchIdTablesOptions = {baseUrl?: string | undefined, StorageKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a table (not allowed) * * POST /v2/storage/branch/{branchId}/tables * * Also accepts auth: ManageKey, BearerAuth */ export const createApiV2StorageBranchBranchIdTables = async (args: CreateApiV2StorageBranchBranchIdTablesArgs, options?: CreateApiV2StorageBranchBranchIdTablesOptions) => { 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/branch/${encodeURIComponent(String(args.branchId))}/tables${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };