/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CourseExportEligibility } from '../models/CourseExportEligibility'; import type { EximTask } from '../models/EximTask'; import type { ExportTargetEnvironment } from '../models/ExportTargetEnvironment'; import type { PatchedCourseExportEligibility } from '../models/PatchedCourseExportEligibility'; import type { PatchedExportTargetEnvironment } from '../models/PatchedExportTargetEnvironment'; import type { PlatformMigrationRun } from '../models/PlatformMigrationRun'; import type { PlatformMigrationRunCreate } from '../models/PlatformMigrationRunCreate'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class EximService { /** * Admin-only CRUD for CourseExportEligibility records. * * Lookup is by primary key. Filter by ``is_enabled`` and * ``course__course_id``; search by ``course__course_id``. * @returns CourseExportEligibility * @throws ApiError */ public static eximManageEligibilityList({ courseCourseId, isEnabled, search, }: { courseCourseId?: string, isEnabled?: boolean, /** * A search term. */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/eligibility/', query: { 'course__course_id': courseCourseId, 'is_enabled': isEnabled, 'search': search, }, }); } /** * Admin-only CRUD for CourseExportEligibility records. * * Lookup is by primary key. Filter by ``is_enabled`` and * ``course__course_id``; search by ``course__course_id``. * @returns CourseExportEligibility * @throws ApiError */ public static eximManageEligibilityCreate({ requestBody, }: { requestBody: CourseExportEligibility, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/exim/manage/eligibility/', body: requestBody, mediaType: 'application/json', }); } /** * Admin-only CRUD for CourseExportEligibility records. * * Lookup is by primary key. Filter by ``is_enabled`` and * ``course__course_id``; search by ``course__course_id``. * @returns CourseExportEligibility * @throws ApiError */ public static eximManageEligibilityRetrieve({ id, }: { /** * A unique integer value identifying this course export eligibility. */ id: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/eligibility/{id}/', path: { 'id': id, }, }); } /** * Admin-only CRUD for CourseExportEligibility records. * * Lookup is by primary key. Filter by ``is_enabled`` and * ``course__course_id``; search by ``course__course_id``. * @returns CourseExportEligibility * @throws ApiError */ public static eximManageEligibilityUpdate({ id, requestBody, }: { /** * A unique integer value identifying this course export eligibility. */ id: number, requestBody: CourseExportEligibility, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/exim/manage/eligibility/{id}/', path: { 'id': id, }, body: requestBody, mediaType: 'application/json', }); } /** * Admin-only CRUD for CourseExportEligibility records. * * Lookup is by primary key. Filter by ``is_enabled`` and * ``course__course_id``; search by ``course__course_id``. * @returns CourseExportEligibility * @throws ApiError */ public static eximManageEligibilityPartialUpdate({ id, requestBody, }: { /** * A unique integer value identifying this course export eligibility. */ id: number, requestBody?: PatchedCourseExportEligibility, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/exim/manage/eligibility/{id}/', path: { 'id': id, }, body: requestBody, mediaType: 'application/json', }); } /** * Admin-only CRUD for CourseExportEligibility records. * * Lookup is by primary key. Filter by ``is_enabled`` and * ``course__course_id``; search by ``course__course_id``. * @returns void * @throws ApiError */ public static eximManageEligibilityDestroy({ id, }: { /** * A unique integer value identifying this course export eligibility. */ id: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/exim/manage/eligibility/{id}/', path: { 'id': id, }, }); } /** * Admin-only CRUD for ExportTargetEnvironment records. * @returns ExportTargetEnvironment * @throws ApiError */ public static eximManageEnvironmentsList({ isEnabled, search, }: { isEnabled?: boolean, /** * A search term. */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/environments/', query: { 'is_enabled': isEnabled, 'search': search, }, }); } /** * Admin-only CRUD for ExportTargetEnvironment records. * @returns ExportTargetEnvironment * @throws ApiError */ public static eximManageEnvironmentsCreate({ requestBody, }: { requestBody: ExportTargetEnvironment, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/exim/manage/environments/', body: requestBody, mediaType: 'application/json', }); } /** * Admin-only CRUD for ExportTargetEnvironment records. * @returns ExportTargetEnvironment * @throws ApiError */ public static eximManageEnvironmentsRetrieve({ id, }: { /** * A unique integer value identifying this export target environment. */ id: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/environments/{id}/', path: { 'id': id, }, }); } /** * Admin-only CRUD for ExportTargetEnvironment records. * @returns ExportTargetEnvironment * @throws ApiError */ public static eximManageEnvironmentsUpdate({ id, requestBody, }: { /** * A unique integer value identifying this export target environment. */ id: number, requestBody: ExportTargetEnvironment, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/exim/manage/environments/{id}/', path: { 'id': id, }, body: requestBody, mediaType: 'application/json', }); } /** * Admin-only CRUD for ExportTargetEnvironment records. * @returns ExportTargetEnvironment * @throws ApiError */ public static eximManageEnvironmentsPartialUpdate({ id, requestBody, }: { /** * A unique integer value identifying this export target environment. */ id: number, requestBody?: PatchedExportTargetEnvironment, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/exim/manage/environments/{id}/', path: { 'id': id, }, body: requestBody, mediaType: 'application/json', }); } /** * Admin-only CRUD for ExportTargetEnvironment records. * @returns void * @throws ApiError */ public static eximManageEnvironmentsDestroy({ id, }: { /** * A unique integer value identifying this export target environment. */ id: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/exim/manage/environments/{id}/', path: { 'id': id, }, }); } /** * Start and poll tenant-data migration runs (the platform_migration lane). * * ``POST`` starts a run and returns its ``run_id`` (kicking the Celery task); * ``GET`` list/detail surface status + progress + report. Detail lookup is by * the public ``run_id`` UUID, not the surrogate PK. Gated by the * feature flag — start is rejected with 503 on non-AI deployments. * @returns PlatformMigrationRun * @throws ApiError */ public static eximManagePlatformMigrationsList({ direction, ordering, sourceKey, status, targetKey, }: { /** * * `export` - Export * * `import` - Import */ direction?: 'export' | 'import', /** * Which field to use when ordering the results. */ ordering?: string, sourceKey?: string, /** * * `pending` - Pending * * `in_progress` - In Progress * * `completed` - Completed * * `failed` - Failed * * `canceled` - Canceled */ status?: 'canceled' | 'completed' | 'failed' | 'in_progress' | 'pending', targetKey?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/platform-migrations/', query: { 'direction': direction, 'ordering': ordering, 'source_key': sourceKey, 'status': status, 'target_key': targetKey, }, }); } /** * Start and poll tenant-data migration runs (the platform_migration lane). * * ``POST`` starts a run and returns its ``run_id`` (kicking the Celery task); * ``GET`` list/detail surface status + progress + report. Detail lookup is by * the public ``run_id`` UUID, not the surrogate PK. Gated by the * feature flag — start is rejected with 503 on non-AI deployments. * @returns PlatformMigrationRunCreate * @throws ApiError */ public static eximManagePlatformMigrationsCreate({ requestBody, }: { requestBody: PlatformMigrationRunCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/exim/manage/platform-migrations/', body: requestBody, mediaType: 'application/json', }); } /** * Start and poll tenant-data migration runs (the platform_migration lane). * * ``POST`` starts a run and returns its ``run_id`` (kicking the Celery task); * ``GET`` list/detail surface status + progress + report. Detail lookup is by * the public ``run_id`` UUID, not the surrogate PK. Gated by the * feature flag — start is rejected with 503 on non-AI deployments. * @returns PlatformMigrationRun * @throws ApiError */ public static eximManagePlatformMigrationsRetrieve({ runId, }: { runId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/platform-migrations/{run_id}/', path: { 'run_id': runId, }, }); } /** * Cancel a still-pending run. No-op for any other status. * * Conditional UPDATE so we don't race the worker: if it has already flipped * the row to ``in_progress`` the UPDATE matches zero rows and we return 409. * A run already executing is not interrupted mid-phase. * @returns PlatformMigrationRun * @throws ApiError */ public static eximManagePlatformMigrationsCancelCreate({ runId, requestBody, }: { runId: string, requestBody?: PlatformMigrationRun, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/exim/manage/platform-migrations/{run_id}/cancel/', path: { 'run_id': runId, }, body: requestBody, mediaType: 'application/json', }); } /** * Stream a completed export's bundle as a single ``.zip``. * * Token-gated (IsDMAdmin) REST mirror of the admin "Download .zip" link, so * a programmatic caller can pull the bundle down to move it to another * deployment. Only a completed EXPORT with a bundle still on disk is * downloadable; imports and not-yet-finished runs have nothing to stream. * @returns PlatformMigrationRun * @throws ApiError */ public static eximManagePlatformMigrationsDownloadRetrieve({ runId, }: { runId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/platform-migrations/{run_id}/download/', path: { 'run_id': runId, }, }); } /** * Upload a bundle ``.zip`` and start an import run from it (API parity). * * The programmatic mirror of the admin "Import from uploaded ZIP" page, so a * caller that pulled a bundle off one deployment can push it to another over * the API alone. Multipart fields: ``bundle_file`` (the zip, required), * ``target_key`` (required), optional ``selected_components`` (repeatable), * ``admin_user``, ``email``. * * On an S3 deployment the validated bundle is stored to S3 and the import * runs from there (any node can execute it); otherwise it stays on local * disk like the admin flow. * @returns PlatformMigrationRun * @throws ApiError */ public static eximManagePlatformMigrationsImportUploadCreate({ formData, }: { formData?: PlatformMigrationRun, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/exim/manage/platform-migrations/import-upload/', formData: formData, mediaType: 'multipart/form-data', }); } /** * Admin-only read-only access to EximTask records. * * Tasks are created by signals and the admin sync action; this API * surfaces them for inspection only. The ``cancel`` action transitions * a still-pending task to ``canceled`` so it gets skipped by the worker. * @returns EximTask * @throws ApiError */ public static eximManageTasksList({ courseCourseId, ordering, status, targetEnvironment, }: { courseCourseId?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * * `pending` - Pending * * `in_progress` - In Progress * * `completed` - Completed * * `failed` - Failed * * `canceled` - Canceled */ status?: 'canceled' | 'completed' | 'failed' | 'in_progress' | 'pending', targetEnvironment?: number, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/tasks/', query: { 'course__course_id': courseCourseId, 'ordering': ordering, 'status': status, 'target_environment': targetEnvironment, }, }); } /** * Admin-only read-only access to EximTask records. * * Tasks are created by signals and the admin sync action; this API * surfaces them for inspection only. The ``cancel`` action transitions * a still-pending task to ``canceled`` so it gets skipped by the worker. * @returns EximTask * @throws ApiError */ public static eximManageTasksRetrieve({ id, }: { /** * A unique integer value identifying this exim task. */ id: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/exim/manage/tasks/{id}/', path: { 'id': id, }, }); } /** * Cancel a pending task. No-op for any other status. * * Uses a conditional UPDATE so that we don't race with the worker: * if the worker has just locked the row and flipped status to * ``in_progress``, the UPDATE matches zero rows and we return 409 * instead of overwriting the worker's transition. * @returns EximTask * @throws ApiError */ public static eximManageTasksCancelCreate({ id, requestBody, }: { /** * A unique integer value identifying this exim task. */ id: number, requestBody?: EximTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/exim/manage/tasks/{id}/cancel/', path: { 'id': id, }, body: requestBody, mediaType: 'application/json', }); } }