export type CreateApiV1TasksIdEntitiesEntityIdBackupNowArgs = {id: string, entityId: string}; export type CreateApiV1TasksIdEntitiesEntityIdBackupNowOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * backupNow * * POST /v1/tasks/{id}/entities/{entityId}/backupNow */ export const createApiV1TasksIdEntitiesEntityIdBackupNow = async (args: CreateApiV1TasksIdEntitiesEntityIdBackupNowArgs, options?: CreateApiV1TasksIdEntitiesEntityIdBackupNowOptions) => { const {baseUrl = "https://api.cloudally.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v1/tasks/${encodeURIComponent(String(args.id))}/entities/${encodeURIComponent(String(args.entityId))}/backupNow${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 res.blob() };