export type DeleteApiV1beta1ProjectsProjectWarehousesWarehouseArgs = {project: string, warehouse: string}; export type DeleteApiV1beta1ProjectsProjectWarehousesWarehouseOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Warehouse * * DELETE /v1beta1/projects/{project}/warehouses/{warehouse} */ export const deleteApiV1beta1ProjectsProjectWarehousesWarehouse = async (args: DeleteApiV1beta1ProjectsProjectWarehousesWarehouseArgs, options: DeleteApiV1beta1ProjectsProjectWarehousesWarehouseOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set("Authorization", BearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1beta1/projects/${encodeURIComponent(String(args.project))}/warehouses/${encodeURIComponent(String(args.warehouse))}${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 };