export type TenantModelBulkIn = {all?: (boolean | null) | undefined, tenant_ids?: (Array | null) | undefined}; export type DeleteApiTenantsModelsModelIdBulkArgs = {model_id: number, cookie_name?: (string | null) | undefined, body: TenantModelBulkIn}; export type DeleteApiTenantsModelsModelIdBulkOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable a model for multiple tenants * * DELETE /tenants/models/{model_id}/bulk */ export const deleteApiTenantsModelsModelIdBulk = async (args: DeleteApiTenantsModelsModelIdBulkArgs, options?: DeleteApiTenantsModelsModelIdBulkOptions) => { const {baseUrl = "https://api.your-domain.com", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.cookie_name != null) query.append("cookie_name", String(args.cookie_name)) if (APIKeyHeader !== undefined) headers.set("X-API-KEY", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/tenants/models/${encodeURIComponent(String(args.model_id))}/bulk${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };