/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { BlankCourseInvitationCreate } from '../models/BlankCourseInvitationCreate'; import type { BlankPlatformInvitationCreate } from '../models/BlankPlatformInvitationCreate'; import type { BlankProgramInvitationCreate } from '../models/BlankProgramInvitationCreate'; import type { BlockSkillPointInfoRequest } from '../models/BlockSkillPointInfoRequest'; import type { BulkCourseInvitationCreate } from '../models/BulkCourseInvitationCreate'; import type { BulkCourseInvitationResponse } from '../models/BulkCourseInvitationResponse'; import type { BulkPlatformInvitationCreate } from '../models/BulkPlatformInvitationCreate'; import type { BulkPlatformInvitationResponse } from '../models/BulkPlatformInvitationResponse'; import type { BulkProgramInvitationCreate } from '../models/BulkProgramInvitationCreate'; import type { BulkProgramInvitationResponse } from '../models/BulkProgramInvitationResponse'; import type { BulkSuggestionResponse } from '../models/BulkSuggestionResponse'; import type { CatalogAutoIncrementResponse } from '../models/CatalogAutoIncrementResponse'; import type { CatalogAutoIncrementUpdateRequest } from '../models/CatalogAutoIncrementUpdateRequest'; import type { Course } from '../models/Course'; import type { CourseAccessRequestCreate } from '../models/CourseAccessRequestCreate'; import type { CourseAccessRequestDetail } from '../models/CourseAccessRequestDetail'; import type { CourseAccessRequestStatusResponse } from '../models/CourseAccessRequestStatusResponse'; import type { CourseAccessRequestUpdate } from '../models/CourseAccessRequestUpdate'; import type { CourseCompletion } from '../models/CourseCompletion'; import type { CourseCreateUpdate } from '../models/CourseCreateUpdate'; import type { CourseDeleteResponse } from '../models/CourseDeleteResponse'; import type { CourseEnrollmentSearchResponse } from '../models/CourseEnrollmentSearchResponse'; import type { CourseGroupSuggestionCreate } from '../models/CourseGroupSuggestionCreate'; import type { CourseGroupSuggestionDetail } from '../models/CourseGroupSuggestionDetail'; import type { CourseInvitationCreate } from '../models/CourseInvitationCreate'; import type { CourseInvitationDetail } from '../models/CourseInvitationDetail'; import type { CourseInvitationRedemption } from '../models/CourseInvitationRedemption'; import type { CourseLicenseAssignmentCreate } from '../models/CourseLicenseAssignmentCreate'; import type { CourseLicenseAssignmentDetail } from '../models/CourseLicenseAssignmentDetail'; import type { CourseLicenseCreate } from '../models/CourseLicenseCreate'; import type { CourseLicenseDetail } from '../models/CourseLicenseDetail'; import type { CourseLicenseGroupAssignmentCreate } from '../models/CourseLicenseGroupAssignmentCreate'; import type { CourseLicenseGroupAssignmentDetail } from '../models/CourseLicenseGroupAssignmentDetail'; import type { CourseLicenseUpdate } from '../models/CourseLicenseUpdate'; import type { CourseMetadataSearchRequest } from '../models/CourseMetadataSearchRequest'; import type { CourseMetadataUpdateRequest } from '../models/CourseMetadataUpdateRequest'; import type { CourseReviewInfoResponse } from '../models/CourseReviewInfoResponse'; import type { CourseReviewPaginatedResponse } from '../models/CourseReviewPaginatedResponse'; import type { CourseReviewRequest } from '../models/CourseReviewRequest'; import type { CourseReviewResponse } from '../models/CourseReviewResponse'; import type { CourseSkillPointInfoRequest } from '../models/CourseSkillPointInfoRequest'; import type { CourseSuggestionBulkCreate } from '../models/CourseSuggestionBulkCreate'; import type { CourseSuggestionCreate } from '../models/CourseSuggestionCreate'; import type { CourseSuggestionDetail } from '../models/CourseSuggestionDetail'; import type { DesiredRole } from '../models/DesiredRole'; import type { DesiredRoleCreateUpdateRequest } from '../models/DesiredRoleCreateUpdateRequest'; import type { DesiredSkill } from '../models/DesiredSkill'; import type { DesiredSkillCreateUpdateRequest } from '../models/DesiredSkillCreateUpdateRequest'; import type { PaginatedCourseAccessRequest } from '../models/PaginatedCourseAccessRequest'; import type { PaginatedCourseGroupSuggestion } from '../models/PaginatedCourseGroupSuggestion'; import type { PaginatedCourseInvitation } from '../models/PaginatedCourseInvitation'; import type { PaginatedCourseLicense } from '../models/PaginatedCourseLicense'; import type { PaginatedCourseLicenseAssignment } from '../models/PaginatedCourseLicenseAssignment'; import type { PaginatedCourseLicenseGroupAssignment } from '../models/PaginatedCourseLicenseGroupAssignment'; import type { PaginatedCourseSuggestion } from '../models/PaginatedCourseSuggestion'; import type { PaginatedPathwayGroupSuggestion } from '../models/PaginatedPathwayGroupSuggestion'; import type { PaginatedPathwaySuggestion } from '../models/PaginatedPathwaySuggestion'; import type { PaginatedPlatformInvitation } from '../models/PaginatedPlatformInvitation'; import type { PaginatedPlatformLicense } from '../models/PaginatedPlatformLicense'; import type { PaginatedProgramGroupSuggestion } from '../models/PaginatedProgramGroupSuggestion'; import type { PaginatedProgramInvitation } from '../models/PaginatedProgramInvitation'; import type { PaginatedProgramLicense } from '../models/PaginatedProgramLicense'; import type { PaginatedProgramLicenseAssignment } from '../models/PaginatedProgramLicenseAssignment'; import type { PaginatedProgramLicenseGroupAssignment } from '../models/PaginatedProgramLicenseGroupAssignment'; import type { PaginatedProgramSuggestion } from '../models/PaginatedProgramSuggestion'; import type { PaginatedResource } from '../models/PaginatedResource'; import type { PaginatedSkill } from '../models/PaginatedSkill'; import type { PaginatedUserLicense } from '../models/PaginatedUserLicense'; import type { PaginatedUserLicenseAssignment } from '../models/PaginatedUserLicenseAssignment'; import type { PaginatedUserLicenseGroupAssignment } from '../models/PaginatedUserLicenseGroupAssignment'; import type { PatchedPlacementAssessmentUpdate } from '../models/PatchedPlacementAssessmentUpdate'; import type { PatchedPlatformApplicationFormUpdate } from '../models/PatchedPlatformApplicationFormUpdate'; import type { PatchedPlatformApplicationNote } from '../models/PatchedPlatformApplicationNote'; import type { PatchedPlatformApplicationPlacementUpdate } from '../models/PatchedPlatformApplicationPlacementUpdate'; import type { PatchedPlatformApplicationUpdate } from '../models/PatchedPlatformApplicationUpdate'; import type { Pathway } from '../models/Pathway'; import type { PathwayCompletionResponse } from '../models/PathwayCompletionResponse'; import type { PathwayCreateUpdateRequest } from '../models/PathwayCreateUpdateRequest'; import type { PathwayDeleteResponse } from '../models/PathwayDeleteResponse'; import type { PathwayEnrollment } from '../models/PathwayEnrollment'; import type { PathwayEnrollmentPlus } from '../models/PathwayEnrollmentPlus'; import type { PathwayEnrollmentRequest } from '../models/PathwayEnrollmentRequest'; import type { PathwayGroupSuggestionCreate } from '../models/PathwayGroupSuggestionCreate'; import type { PathwayGroupSuggestionDetail } from '../models/PathwayGroupSuggestionDetail'; import type { PathwaySelfEnrollmentRequest } from '../models/PathwaySelfEnrollmentRequest'; import type { PathwaySuggestionBulkCreate } from '../models/PathwaySuggestionBulkCreate'; import type { PathwaySuggestionCreate } from '../models/PathwaySuggestionCreate'; import type { PathwaySuggestionDetail } from '../models/PathwaySuggestionDetail'; import type { PlacementAssessment } from '../models/PlacementAssessment'; import type { PlacementCourseAssignmentCreate } from '../models/PlacementCourseAssignmentCreate'; import type { PlacementProgramAssignmentCreate } from '../models/PlacementProgramAssignmentCreate'; import type { PlacementRecordCreate } from '../models/PlacementRecordCreate'; import type { PlatformApplicationAdminSubmit } from '../models/PlatformApplicationAdminSubmit'; import type { PlatformApplicationAttachmentUpload } from '../models/PlatformApplicationAttachmentUpload'; import type { PlatformApplicationCandidateLink } from '../models/PlatformApplicationCandidateLink'; import type { PlatformApplicationCourseAssignment } from '../models/PlatformApplicationCourseAssignment'; import type { PlatformApplicationCreate } from '../models/PlatformApplicationCreate'; import type { PlatformApplicationDetail } from '../models/PlatformApplicationDetail'; import type { PlatformApplicationFeeAction } from '../models/PlatformApplicationFeeAction'; import type { PlatformApplicationFormCreate } from '../models/PlatformApplicationFormCreate'; import type { PlatformApplicationFormDetail } from '../models/PlatformApplicationFormDetail'; import type { PlatformApplicationNote } from '../models/PlatformApplicationNote'; import type { PlatformApplicationPlacementCreate } from '../models/PlatformApplicationPlacementCreate'; import type { PlatformApplicationSubmit } from '../models/PlatformApplicationSubmit'; import type { PlatformApplicationTransition } from '../models/PlatformApplicationTransition'; import type { PlatformApplicationWaiver } from '../models/PlatformApplicationWaiver'; import type { PlatformInvitationCreate } from '../models/PlatformInvitationCreate'; import type { PlatformInvitationDetail } from '../models/PlatformInvitationDetail'; import type { PlatformInvitationRedemption } from '../models/PlatformInvitationRedemption'; import type { PlatformLicenseCreate } from '../models/PlatformLicenseCreate'; import type { PlatformLicenseDetail } from '../models/PlatformLicenseDetail'; import type { PlatformLicenseUpdate } from '../models/PlatformLicenseUpdate'; import type { PlatformSkillPointBulkRequest } from '../models/PlatformSkillPointBulkRequest'; import type { PlatformSkillPointBulkResponse } from '../models/PlatformSkillPointBulkResponse'; import type { PlatformSkillPointGroupRequest } from '../models/PlatformSkillPointGroupRequest'; import type { PlatformSkillPointRequest } from '../models/PlatformSkillPointRequest'; import type { PlatformSkillPointResponse } from '../models/PlatformSkillPointResponse'; import type { Program } from '../models/Program'; import type { ProgramCompletionResponse } from '../models/ProgramCompletionResponse'; import type { ProgramCreateUpdateRequest } from '../models/ProgramCreateUpdateRequest'; import type { ProgramDeleteResponse } from '../models/ProgramDeleteResponse'; import type { ProgramEnrollment } from '../models/ProgramEnrollment'; import type { ProgramEnrollmentPlus } from '../models/ProgramEnrollmentPlus'; import type { ProgramEnrollmentSearchResponse } from '../models/ProgramEnrollmentSearchResponse'; import type { ProgramGroupSuggestionCreate } from '../models/ProgramGroupSuggestionCreate'; import type { ProgramGroupSuggestionDetail } from '../models/ProgramGroupSuggestionDetail'; import type { ProgramInvitationCreate } from '../models/ProgramInvitationCreate'; import type { ProgramInvitationDetail } from '../models/ProgramInvitationDetail'; import type { ProgramInvitationRedemption } from '../models/ProgramInvitationRedemption'; import type { ProgramLicenseAssignmentCreate } from '../models/ProgramLicenseAssignmentCreate'; import type { ProgramLicenseAssignmentDetail } from '../models/ProgramLicenseAssignmentDetail'; import type { ProgramLicenseCreateDetail } from '../models/ProgramLicenseCreateDetail'; import type { ProgramLicenseDetail } from '../models/ProgramLicenseDetail'; import type { ProgramLicenseGroupAssignmentCreate } from '../models/ProgramLicenseGroupAssignmentCreate'; import type { ProgramLicenseGroupAssignmentDetail } from '../models/ProgramLicenseGroupAssignmentDetail'; import type { ProgramLicenseUpdateDetail } from '../models/ProgramLicenseUpdateDetail'; import type { ProgramMetadataRequest } from '../models/ProgramMetadataRequest'; import type { ProgramMetadataResponse } from '../models/ProgramMetadataResponse'; import type { ProgramReview } from '../models/ProgramReview'; import type { ProgramReviewInfoResponse } from '../models/ProgramReviewInfoResponse'; import type { ProgramReviewPaginatedResponse } from '../models/ProgramReviewPaginatedResponse'; import type { ProgramReviewRequest } from '../models/ProgramReviewRequest'; import type { ProgramSearch } from '../models/ProgramSearch'; import type { ProgramSuggestionBulkCreate } from '../models/ProgramSuggestionBulkCreate'; import type { ProgramSuggestionCreate } from '../models/ProgramSuggestionCreate'; import type { ProgramSuggestionDetail } from '../models/ProgramSuggestionDetail'; import type { ReportedRole } from '../models/ReportedRole'; import type { ReportedRoleCreateUpdateRequest } from '../models/ReportedRoleCreateUpdateRequest'; import type { ReportedSkill } from '../models/ReportedSkill'; import type { ReportedSkillCreateUpdateRequest } from '../models/ReportedSkillCreateUpdateRequest'; import type { Resource } from '../models/Resource'; import type { ResourceCompletion } from '../models/ResourceCompletion'; import type { ResourceCompletionRequest } from '../models/ResourceCompletionRequest'; import type { ResourceCreateUpdate } from '../models/ResourceCreateUpdate'; import type { ResourceDeleteResponse } from '../models/ResourceDeleteResponse'; import type { Role } from '../models/Role'; import type { RoleCreateUpdateRequest } from '../models/RoleCreateUpdateRequest'; import type { Skill } from '../models/Skill'; import type { SkillCreateUpdateRequest } from '../models/SkillCreateUpdateRequest'; import type { UserLicenseAssignmentCreate } from '../models/UserLicenseAssignmentCreate'; import type { UserLicenseAssignmentDetail } from '../models/UserLicenseAssignmentDetail'; import type { UserLicenseCreate } from '../models/UserLicenseCreate'; import type { UserLicenseDetail } from '../models/UserLicenseDetail'; import type { UserLicenseGroupAssignmentCreate } from '../models/UserLicenseGroupAssignmentCreate'; import type { UserLicenseGroupAssignmentDetail } from '../models/UserLicenseGroupAssignmentDetail'; import type { UserLicenseUpdate } from '../models/UserLicenseUpdate'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class CatalogService { /** * Retrieve a paginated list of access requests * @returns PaginatedCourseAccessRequest * @throws ApiError */ public static catalogAccessRequestsCourseManageRetrieve({ page, pageSize, platformKey, platformOrg, reviewed, sort = '-id', }: { /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Filter by reviewed status */ reviewed?: boolean, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/access_requests/course/manage/', query: { 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'reviewed': reviewed, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - platform doesn't exist`, 500: `Internal server error`, }, }); } /** * Update an existing access request (approve/reject) * @returns CourseAccessRequestDetail * @throws ApiError */ public static catalogAccessRequestsCourseManageCreate({ requestBody, page, pageSize, platformKey, platformOrg, reviewed, sort = '-id', }: { requestBody: CourseAccessRequestUpdate, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Filter by reviewed status */ reviewed?: boolean, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/access_requests/course/manage/', query: { 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'reviewed': reviewed, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - platform or access request doesn't exist`, 500: `Internal server error`, }, }); } /** * Check if the user has an active access request for a course * @returns CourseAccessRequestStatusResponse * @throws ApiError */ public static catalogAccessRequestsCourseRequestRetrieve({ courseId, platformKey, platformOrg, }: { /** * The unique identifier for the course */ courseId: string, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/access_requests/course/request/', query: { 'course_id': courseId, 'platform_key': platformKey, 'platform_org': platformOrg, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - platform or course doesn't exist`, }, }); } /** * Create a new access request for a course * @returns CourseAccessRequestDetail * @throws ApiError */ public static catalogAccessRequestsCourseRequestCreate({ courseId, requestBody, platformKey, platformOrg, }: { /** * The unique identifier for the course */ courseId: string, requestBody: CourseAccessRequestCreate, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/access_requests/course/request/', query: { 'course_id': courseId, 'platform_key': platformKey, 'platform_org': platformOrg, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - platform or course doesn't exist`, 500: `Internal server error`, }, }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns any Own submissions * @throws ApiError */ public static catalogApplicationsPlatformRetrieve({ formId, platformKey, platformOrg, }: { formId?: number, platformKey?: string, platformOrg?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/', query: { 'form_id': formId, 'platform_key': platformKey, 'platform_org': platformOrg, }, }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns PlatformApplicationDetail * @throws ApiError */ public static catalogApplicationsPlatformCreate({ requestBody, }: { requestBody: PlatformApplicationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/', body: requestBody, mediaType: 'application/json', }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns PlatformApplicationDetail * @throws ApiError */ public static catalogApplicationsPlatformRetrieve2({ submissionId, }: { submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/{submission_id}/', path: { 'submission_id': submissionId, }, }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns PlatformApplicationDetail * @throws ApiError */ public static catalogApplicationsPlatformPartialUpdate({ submissionId, requestBody, }: { submissionId: string, requestBody?: PatchedPlatformApplicationUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/catalog/applications/platform/{submission_id}/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns any Attachment stored * @throws ApiError */ public static catalogApplicationsPlatformAttachmentsCreate({ submissionId, formData, }: { submissionId: string, formData: PlatformApplicationAttachmentUpload, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/{submission_id}/attachments/', path: { 'submission_id': submissionId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns void * @throws ApiError */ public static catalogApplicationsPlatformAttachmentsDestroy({ attachmentId, submissionId, }: { attachmentId: string, submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/applications/platform/{submission_id}/attachments/{attachment_id}/', path: { 'attachment_id': attachmentId, 'submission_id': submissionId, }, }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns PlatformApplicationDetail * @throws ApiError */ public static catalogApplicationsPlatformSubmitCreate({ submissionId, requestBody, }: { submissionId: string, requestBody?: PlatformApplicationSubmit, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/{submission_id}/submit/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns PlatformApplicationDetail * @throws ApiError */ public static catalogApplicationsPlatformWithdrawCreate({ submissionId, }: { submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/{submission_id}/withdraw/', path: { 'submission_id': submissionId, }, }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns any Active form * @throws ApiError */ public static catalogApplicationsPlatformFormRetrieve({ formId, platformKey, platformOrg, }: { formId?: number, platformKey?: string, platformOrg?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/form/', query: { 'form_id': formId, 'platform_key': platformKey, 'platform_org': platformOrg, }, }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns any Forms for the platform * @throws ApiError */ public static catalogApplicationsPlatformFormsManageRetrieve({ platformKey, platformOrg, sort, }: { platformKey?: string, platformOrg?: string, sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/forms/manage/', query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns PlatformApplicationFormDetail * @throws ApiError */ public static catalogApplicationsPlatformFormsManageCreate({ requestBody, platformKey, platformOrg, sort, }: { requestBody: PlatformApplicationFormCreate, platformKey?: string, platformOrg?: string, sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/forms/manage/', query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, body: requestBody, mediaType: 'application/json', }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns PlatformApplicationFormDetail * @throws ApiError */ public static catalogApplicationsPlatformFormsManageRetrieve2({ formId, platformKey, platformOrg, sort, }: { formId: string, platformKey?: string, platformOrg?: string, sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/forms/manage/{form_id}/', path: { 'form_id': formId, }, query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns PlatformApplicationFormDetail * @throws ApiError */ public static catalogApplicationsPlatformFormsManagePartialUpdate({ formId, platformKey, platformOrg, sort, requestBody, }: { formId: string, platformKey?: string, platformOrg?: string, sort?: string, requestBody?: PatchedPlatformApplicationFormUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/catalog/applications/platform/forms/manage/{form_id}/', path: { 'form_id': formId, }, query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, body: requestBody, mediaType: 'application/json', }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns any Submissions for the platform * @throws ApiError */ public static catalogApplicationsPlatformManageRetrieve({ platformKey, platformOrg, search, sort, status, }: { platformKey?: string, platformOrg?: string, search?: string, sort?: string, status?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/', query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'search': search, 'sort': sort, 'status': status, }, }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns any Full submission detail * @throws ApiError */ public static catalogApplicationsPlatformManageRetrieve2({ submissionId, platformKey, platformOrg, search, sort, status, }: { submissionId: string, platformKey?: string, platformOrg?: string, search?: string, sort?: string, status?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/{submission_id}/', path: { 'submission_id': submissionId, }, query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'search': search, 'sort': sort, 'status': status, }, }); } /** * Reviewer download: redirect to the storage's (signed, on S3) file URL. * * Gated by ``IsDMAdmin | IsPlatformAdmin`` plus the RBAC verb check on the * attachment's own platform when RBAC is enabled. * @returns void * @throws ApiError */ public static catalogApplicationsPlatformManageAttachmentsDownloadRetrieve({ attachmentId, submissionId, }: { attachmentId: string, submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/{submission_id}/attachments/{attachment_id}/download/', path: { 'attachment_id': attachmentId, 'submission_id': submissionId, }, errors: { 302: `Redirect to the file URL`, }, }); } /** * Re-run settlement provisioning for one accepted candidate: links them * if an account with their designated email now exists, or re-issues the * platform invitation if none is active. Covers the invite-missing state. * @returns any Candidate after provisioning * @throws ApiError */ public static catalogApplicationsPlatformManageCandidatesInviteCreate({ candidateId, submissionId, }: { candidateId: string, submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/candidates/{candidate_id}/invite/', path: { 'candidate_id': candidateId, 'submission_id': submissionId, }, }); } /** * Manually link an accepted candidate to an existing account (the * account-unlinked state: the family signed up outside invitation * redemption, or under a different email than designated). * @returns any Candidate linked * @throws ApiError */ public static catalogApplicationsPlatformManageCandidatesLinkCreate({ candidateId, submissionId, requestBody, }: { candidateId: string, submissionId: string, requestBody?: PlatformApplicationCandidateLink, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/candidates/{candidate_id}/link/', path: { 'candidate_id': candidateId, 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Course assignments for a submission (#2134): list, and assign courses to * accepted candidates individually or in bulk. Each successful item issues a * CourseInvitation that the existing pipeline enrolls. * @returns any Assignments for the submission * @throws ApiError */ public static catalogApplicationsPlatformManageCourseAssignmentsRetrieve({ submissionId, }: { submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/{submission_id}/course-assignments/', path: { 'submission_id': submissionId, }, }); } /** * Course assignments for a submission (#2134): list, and assign courses to * accepted candidates individually or in bulk. Each successful item issues a * CourseInvitation that the existing pipeline enrolls. * @returns any Per-item assignment results * @throws ApiError */ public static catalogApplicationsPlatformManageCourseAssignmentsCreate({ submissionId, requestBody, }: { submissionId: string, requestBody: PlatformApplicationCourseAssignment, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/course-assignments/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Remove one course assignment (§9.2 "enrollment changes after the school * year begins" — the record side). * * Deactivates the assignment and cancels its invitation when the student has * not yet been enrolled through it. It never unenrolls an already-enrolled * student: platform admins un-enroll deliberately through the catalog * enrollment endpoints, not from an admissions record. * @returns void * @throws ApiError */ public static catalogApplicationsPlatformManageCourseAssignmentsDestroy({ assignmentId, submissionId, }: { assignmentId: string, submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/applications/platform/manage/{submission_id}/course-assignments/{assignment_id}/', path: { 'assignment_id': assignmentId, 'submission_id': submissionId, }, }); } /** * Reviewer/admin view of a submission's application fee (#2132, §5). * * GET returns the charge and its event history; POST records an out-of-band * payment or a waiver/refund/credit. Money collection through Stripe is a * later segment; this is the domain side. * @returns any Charge + events * @throws ApiError */ public static catalogApplicationsPlatformManageFeeRetrieve({ submissionId, }: { submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/{submission_id}/fee/', path: { 'submission_id': submissionId, }, }); } /** * Reviewer/admin view of a submission's application fee (#2132, §5). * * GET returns the charge and its event history; POST records an out-of-band * payment or a waiver/refund/credit. Money collection through Stripe is a * later segment; this is the domain side. * @returns any Charge updated * @throws ApiError */ public static catalogApplicationsPlatformManageFeeCreate({ submissionId, requestBody, }: { submissionId: string, requestBody: PlatformApplicationFeeAction, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/fee/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Internal reviewer notes on a submission (#2089, §6). Never surfaced on * applicant endpoints. GET lists (optional ``kind`` filter); POST adds one. * @returns any Notes for the submission * @throws ApiError */ public static catalogApplicationsPlatformManageNotesRetrieve({ submissionId, platformKey, platformOrg, search, sort, status, }: { submissionId: string, platformKey?: string, platformOrg?: string, search?: string, sort?: string, status?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/{submission_id}/notes/', path: { 'submission_id': submissionId, }, query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'search': search, 'sort': sort, 'status': status, }, }); } /** * Internal reviewer notes on a submission (#2089, §6). Never surfaced on * applicant endpoints. GET lists (optional ``kind`` filter); POST adds one. * @returns any Note created * @throws ApiError */ public static catalogApplicationsPlatformManageNotesCreate({ submissionId, requestBody, }: { submissionId: string, requestBody: PlatformApplicationNote, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/notes/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Edit or remove a single internal reviewer note. * @returns any Note updated * @throws ApiError */ public static catalogApplicationsPlatformManageNotesPartialUpdate({ noteId, submissionId, requestBody, }: { noteId: string, submissionId: string, requestBody?: PatchedPlatformApplicationNote, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/catalog/applications/platform/manage/{submission_id}/notes/{note_id}/', path: { 'note_id': noteId, 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Edit or remove a single internal reviewer note. * @returns void * @throws ApiError */ public static catalogApplicationsPlatformManageNotesDestroy({ noteId, submissionId, }: { noteId: string, submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/applications/platform/manage/{submission_id}/notes/{note_id}/', path: { 'note_id': noteId, 'submission_id': submissionId, }, }); } /** * Placements for a submission (#2133): list, and assign a new placement * linking an accepted candidate to the placement mentor. * @returns any Placements for the submission * @throws ApiError */ public static catalogApplicationsPlatformManagePlacementsRetrieve({ submissionId, }: { submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/{submission_id}/placements/', path: { 'submission_id': submissionId, }, }); } /** * Placements for a submission (#2133): list, and assign a new placement * linking an accepted candidate to the placement mentor. * @returns any Per-item placement results * @throws ApiError */ public static catalogApplicationsPlatformManagePlacementsCreate({ submissionId, requestBody, }: { submissionId: string, requestBody: PlatformApplicationPlacementCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/placements/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Advance a single placement: status, the agent's result, admin override. * @returns any Placement updated * @throws ApiError */ public static catalogApplicationsPlatformManagePlacementsPartialUpdate({ placementId, submissionId, requestBody, }: { placementId: string, submissionId: string, requestBody?: PatchedPlatformApplicationPlacementUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/catalog/applications/platform/manage/{submission_id}/placements/{placement_id}/', path: { 'placement_id': placementId, 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Admin submit-with-exceptions (§2.1 "administratively waived"): push a * family's editable application to Submitted, recording a waiver for every * required item still missing and bypassing an unpaid fee gate (the charge * stays payable/waivable). Present-but-invalid answers still block (400). * @returns any Application submitted * @throws ApiError */ public static catalogApplicationsPlatformManageSubmitCreate({ submissionId, requestBody, }: { submissionId: string, requestBody?: PlatformApplicationAdminSubmit, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/submit/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Advance a submission or a single candidate through the review pipeline * (#2089, §5-6). A ``candidate_id`` scopes the action to one person; without * it the action applies to every candidate that can legally accept it. When * ``action`` is ``decline`` and ``block`` is set, the applicant is also added * to the platform ban-list (deny-with-block). * @returns any Updated submission detail * @throws ApiError */ public static catalogApplicationsPlatformManageTransitionCreate({ submissionId, requestBody, }: { submissionId: string, requestBody: PlatformApplicationTransition, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/transition/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Waive a required item on one application (§2.1 "administratively * waived"): POST excuses a missing required field so it no longer blocks * submission; DELETE reinstates it. Waivers excuse absence only — a * present-but-invalid answer still blocks. The fee is waived through its own * fee endpoint action, which also settles the money record. * @returns any Waiver recorded * @throws ApiError */ public static catalogApplicationsPlatformManageWaiversCreate({ submissionId, requestBody, }: { submissionId: string, requestBody: PlatformApplicationWaiver, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/manage/{submission_id}/waivers/', path: { 'submission_id': submissionId, }, body: requestBody, mediaType: 'application/json', }); } /** * Waive a required item on one application (§2.1 "administratively * waived"): POST excuses a missing required field so it no longer blocks * submission; DELETE reinstates it. Waivers excuse absence only — a * present-but-invalid answer still blocks. The fee is waived through its own * fee endpoint action, which also settles the money record. * @returns void * @throws ApiError */ public static catalogApplicationsPlatformManageWaiversDestroy({ submissionId, }: { submissionId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/applications/platform/manage/{submission_id}/waivers/', path: { 'submission_id': submissionId, }, }); } /** * List the active application blocks (ban-list) for a platform. * @returns any Active blocks * @throws ApiError */ public static catalogApplicationsPlatformManageBlocksRetrieve({ platformKey, platformOrg, search, sort, status, }: { platformKey?: string, platformOrg?: string, search?: string, sort?: string, status?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/blocks/', query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'search': search, 'sort': sort, 'status': status, }, }); } /** * Lift a single active application block (unblock). * @returns void * @throws ApiError */ public static catalogApplicationsPlatformManageBlocksDestroy({ blockId, platformKey, platformOrg, search, sort, status, }: { blockId: string, platformKey?: string, platformOrg?: string, search?: string, sort?: string, status?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/applications/platform/manage/blocks/{block_id}/', path: { 'block_id': blockId, }, query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'search': search, 'sort': sort, 'status': status, }, }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns any Per-status counts * @throws ApiError */ public static catalogApplicationsPlatformManageStatsRetrieve({ platformKey, platformOrg, search, sort, status, }: { platformKey?: string, platformOrg?: string, search?: string, sort?: string, status?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/manage/stats/', query: { 'platform_key': platformKey, 'platform_org': platformOrg, 'search': search, 'sort': sort, 'status': status, }, }); } /** * Start an annual re-enrollment (#2135): a normal draft create whose * responses are pre-filled from the caller's most recent approved submission * (current-schema fields only; signatures, consents, files, and fields the * form flags fresh are re-asked), linked to that prior submission. With no * prior approved submission this behaves as a plain create. * @returns PlatformApplicationDetail * @throws ApiError */ public static catalogApplicationsPlatformRenewCreate({ requestBody, }: { requestBody: PlatformApplicationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/applications/platform/renew/', body: requestBody, mediaType: 'application/json', }); } /** * Authenticated applicants, including learners on AXD student tokens. * * Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is * not in the DRF defaults, but learners self-applying use it). An anonymous * request returns 401, not 403: DRF's ``permission_denied`` raises * ``NotAuthenticated`` whenever no authenticator succeeded. * @returns any Gate state * @throws ApiError */ public static catalogApplicationsPlatformStatusRetrieve({ formId, platformKey, platformOrg, }: { formId?: number, platformKey?: string, platformOrg?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/applications/platform/status/', query: { 'form_id': formId, 'platform_key': platformKey, 'platform_org': platformOrg, }, }); } /** * GET * Retrieve prerequisite eligibility info for user/course * * Params: * user_id/username * course_id * @returns any No response body * @throws ApiError */ public static catalogConditionalsCourseEligibilityRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/conditionals/course/eligibility/', }); } /** * GET * Retrieve prerequisite info for course * * Params: * course_id * * key_only * @returns any No response body * @throws ApiError */ public static catalogConditionalsCoursePrerequisitesManageRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/conditionals/course/prerequisites/manage/', }); } /** * Prerequisite bulk management view * * Params: * course_id * * rules * key_only * @returns any No response body * @throws ApiError */ public static catalogConditionalsCoursePrerequisitesManageBulkCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/conditionals/course/prerequisites/manage/bulk/', }); } /** * Retrieve courses matching specified filters. * @returns Course * @throws ApiError */ public static catalogCoursesList({ courseId, org, slug, }: { /** * Filter courses by their unique identifier */ courseId?: string, /** * Filter courses by their associated organization */ org?: string, /** * Filter courses by their slug (case-insensitive) */ slug?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/courses/', query: { 'course_id': courseId, 'org': org, 'slug': slug, }, errors: { 400: `No response body`, }, }); } /** * Add or update a course in the database. * @returns Course * @throws ApiError */ public static catalogCoursesCreate({ requestBody, courseId, org, slug, }: { requestBody: CourseCreateUpdate, /** * Filter courses by their unique identifier */ courseId?: string, /** * Filter courses by their associated organization */ org?: string, /** * Filter courses by their slug (case-insensitive) */ slug?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/courses/', query: { 'course_id': courseId, 'org': org, 'slug': slug, }, body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, }, }); } /** * Remove a course from the database. * @returns CourseDeleteResponse * @throws ApiError */ public static catalogCoursesDestroy({ courseId, org, slug, }: { /** * The unique identifier for the course to be deleted */ courseId: string, /** * Filter courses by their associated organization */ org?: string, /** * Filter courses by their slug (case-insensitive) */ slug?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/courses/', query: { 'course_id': courseId, 'org': org, 'slug': slug, }, errors: { 400: `No response body`, }, }); } /** * List courses that a user is eligible for. * @returns Course * @throws ApiError */ public static catalogEligibilityCoursesList({ org, query, userId, username, }: { /** * Filter eligible courses by organization */ org?: string, /** * Search term to filter eligible courses */ query?: string, /** * User ID to check eligibility for */ userId?: string, /** * Username to check eligibility for */ username?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/eligibility/courses/', query: { 'org': org, 'query': query, 'user_id': userId, 'username': username, }, errors: { 400: `No response body`, }, }); } /** * Check whether a user is eligible to enroll in a specific course. * @returns any * @throws ApiError */ public static catalogEligibilityCoursesCheckRetrieve({ courseId, localOnly, org, userId, username, }: { /** * Course ID to check eligibility for */ courseId: string, /** * Whether to check eligibility only within the local organization */ localOnly?: boolean, /** * Organization of the course */ org?: string, /** * User ID to check eligibility for */ userId?: string, /** * Username to check eligibility for */ username?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/eligibility/courses/check/', query: { 'course_id': courseId, 'local_only': localOnly, 'org': org, 'user_id': userId, 'username': username, }, errors: { 400: `No response body`, 500: `No response body`, }, }); } /** * API View for searching course enrollments. * * This endpoint allows searching for course enrollments based on various filters such as user ID, * username, email, course ID, slug, organization, and platform key. Results are paginated and * include detailed enrollment information. * * Query Parameters: * user_id (str, optional): Filter enrollments by user ID * username (str, optional): Filter enrollments by username * email (str, optional): Filter enrollments by user email * course_id (str, optional): Filter enrollments by course ID * slug (str, optional): Filter enrollments by course slug * org (str, optional): Filter enrollments by organization * platform_key (str, optional): Filter enrollments by platform key * course_name (str, optional): Filter enrollments by course name (partial match) * include_default_platform (bool, optional): Include enrollments from default platform * sort (str, optional): Field to sort results by (default: '-id') * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Search for course enrollments with filtering and pagination * * Returns: * GET: A paginated JSON response containing course enrollments: * { * "count": 42, * "next": "https://api.example.com/api/catalog/enrollment/courses/search/?page=2", * "previous": null, * "results": [ * { * "user_id": 123, * "username": "student1", * "email": "student1@example.com", * "course_id": "course-v1:org+course+run", * "active": true, * "created": "2023-01-15T10:30:00Z", * "started": "2023-01-15T10:30:00Z", * "ended": null, * "expired": null, * "metadata": {}, * "name": "John Doe", * "course_name": "Introduction to Data Science" * }, * ... * ] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or if enrollment search fails * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsEdxUserReadOnly, or IsPlatformAdminOfUserReadOnly permission * - Users can view their own enrollments * - Platform admins can view enrollments for users in their platform * - DM admins can view all enrollments * @returns CourseEnrollmentSearchResponse * @throws ApiError */ public static catalogEnrollmentCoursesSearchRetrieve({ courseId, courseName, email, includeDefaultPlatform, org, page, pageSize, platformKey, slug, sort = '-id', userId, username, }: { /** * Filter enrollments by course ID */ courseId?: string, /** * Filter enrollments by course name (partial match) */ courseName?: string, /** * Filter enrollments by user email */ email?: string, /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Filter enrollments by organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Filter enrollments by platform key */ platformKey?: string, /** * Filter enrollments by course slug */ slug?: string, /** * Field to sort results by */ sort?: string, /** * Filter enrollments by user ID */ userId?: string, /** * Filter enrollments by username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/enrollment/courses/search/', query: { 'course_id': courseId, 'course_name': courseName, 'email': email, 'include_default_platform': includeDefaultPlatform, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'slug': slug, 'sort': sort, 'user_id': userId, 'username': username, }, }); } /** * Search pathway enrollments. Requires user_id or username and pathway_id or slug. * @returns PathwayEnrollmentPlus * @throws ApiError */ public static catalogEnrollmentPathwaysRetrieve({ active = true, includeDefaultPlatform, includeMetadata = true, org, pathwayId, pathwayKey, pathwayUuid, platformKey, slug, userId, username, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Include metadata in the response */ includeMetadata?: boolean, /** * Organization for the pathway */ org?: string, /** * Pathway ID for enrollment */ pathwayId?: string, /** * Pathway key for enrollment */ pathwayKey?: string, /** * Pathway UUID for enrollment */ pathwayUuid?: string, /** * Platform key for the pathway */ platformKey?: string, /** * Pathway slug for enrollment */ slug?: string, /** * User ID for enrollment */ userId?: string, /** * Username for enrollment */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/enrollment/pathways/', query: { 'active': active, 'include_default_platform': includeDefaultPlatform, 'include_metadata': includeMetadata, 'org': org, 'pathway_id': pathwayId, 'pathway_key': pathwayKey, 'pathway_uuid': pathwayUuid, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, }, }); } /** * Log user enrollment with a pathway. * @returns PathwayEnrollment * @throws ApiError */ public static catalogEnrollmentPathwaysCreate({ active = true, includeDefaultPlatform, includeMetadata = true, org, pathwayId, pathwayKey, pathwayUuid, platformKey, slug, userId, username, requestBody, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Include metadata in the response */ includeMetadata?: boolean, /** * Organization for the pathway */ org?: string, /** * Pathway ID for enrollment */ pathwayId?: string, /** * Pathway key for enrollment */ pathwayKey?: string, /** * Pathway UUID for enrollment */ pathwayUuid?: string, /** * Platform key for the pathway */ platformKey?: string, /** * Pathway slug for enrollment */ slug?: string, /** * User ID for enrollment */ userId?: string, /** * Username for enrollment */ username?: string, requestBody?: PathwayEnrollmentRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/enrollment/pathways/', query: { 'active': active, 'include_default_platform': includeDefaultPlatform, 'include_metadata': includeMetadata, 'org': org, 'pathway_id': pathwayId, 'pathway_key': pathwayKey, 'pathway_uuid': pathwayUuid, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Unenroll from a pathway. Deactivates enrollment. * @returns PathwayEnrollment * @throws ApiError */ public static catalogEnrollmentPathwaysDestroy({ active = true, includeDefaultPlatform, includeMetadata = true, org, pathwayId, pathwayKey, pathwayUuid, platformKey, slug, userId, username, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Include metadata in the response */ includeMetadata?: boolean, /** * Organization for the pathway */ org?: string, /** * Pathway ID for enrollment */ pathwayId?: string, /** * Pathway key for enrollment */ pathwayKey?: string, /** * Pathway UUID for enrollment */ pathwayUuid?: string, /** * Platform key for the pathway */ platformKey?: string, /** * Pathway slug for enrollment */ slug?: string, /** * User ID for enrollment */ userId?: string, /** * Username for enrollment */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/enrollment/pathways/', query: { 'active': active, 'include_default_platform': includeDefaultPlatform, 'include_metadata': includeMetadata, 'org': org, 'pathway_id': pathwayId, 'pathway_key': pathwayKey, 'pathway_uuid': pathwayUuid, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, }, }); } /** * Search pathway enrollments based on user or pathway identifiers. Returns paginated enrollment results. * @returns PathwayEnrollmentPlus * @throws ApiError */ public static catalogEnrollmentPathwaysSearchRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/enrollment/pathways/search/', }); } /** * Log user enrollment with a pathway. * @returns PathwayEnrollment * @throws ApiError */ public static catalogEnrollmentPathwaysSelfCreate({ active = true, org, pathwayId, pathwayKey, platformKey, slug, userId, username, requestBody, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Organization for the pathway */ org?: string, /** * Pathway ID for self-enrollment */ pathwayId?: string, /** * Pathway key for self-enrollment */ pathwayKey?: string, /** * Platform key for the pathway */ platformKey?: string, /** * Pathway slug for self-enrollment */ slug?: string, /** * User ID for self-enrollment */ userId?: string, /** * Username for self-enrollment */ username?: string, requestBody?: PathwaySelfEnrollmentRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/enrollment/pathways/self/', query: { 'active': active, 'org': org, 'pathway_id': pathwayId, 'pathway_key': pathwayKey, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Unenroll from a pathway. Deactivates enrollment. * @returns PathwayEnrollment * @throws ApiError */ public static catalogEnrollmentPathwaysSelfDestroy({ active = true, org, pathwayId, pathwayKey, platformKey, slug, userId, username, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Organization for the pathway */ org?: string, /** * Pathway ID for self-enrollment */ pathwayId?: string, /** * Pathway key for self-enrollment */ pathwayKey?: string, /** * Platform key for the pathway */ platformKey?: string, /** * Pathway slug for self-enrollment */ slug?: string, /** * User ID for self-enrollment */ userId?: string, /** * Username for self-enrollment */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/enrollment/pathways/self/', query: { 'active': active, 'org': org, 'pathway_id': pathwayId, 'pathway_key': pathwayKey, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, }, }); } /** * Search program enrollments. Requires user_id or username and program_id or slug. * @returns ProgramEnrollmentPlus * @throws ApiError */ public static catalogEnrollmentProgramsRetrieve({ active = true, expired, ignoreExpiration = false, includeDefaultPlatform, includeMetadata = true, org, platformKey, programId, programKey, programType, slug, started, userId, username, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Date when enrollment expires */ expired?: string, /** * Whether to ignore expiration during unenrollment */ ignoreExpiration?: boolean, /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Include metadata in the response */ includeMetadata?: boolean, /** * Organization for the program */ org?: string, /** * Platform key for the program */ platformKey?: string, /** * Program ID for enrollment */ programId?: string, /** * Program key for enrollment */ programKey?: string, /** * Program type (standard, platform, custom) */ programType?: string, /** * Program slug for enrollment */ slug?: string, /** * Date when enrollment started */ started?: string, /** * User ID for enrollment */ userId?: string, /** * Username for enrollment */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/enrollment/programs/', query: { 'active': active, 'expired': expired, 'ignore_expiration': ignoreExpiration, 'include_default_platform': includeDefaultPlatform, 'include_metadata': includeMetadata, 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, 'program_type': programType, 'slug': slug, 'started': started, 'user_id': userId, 'username': username, }, }); } /** * Log user enrollment with a program. * @returns ProgramEnrollment * @throws ApiError */ public static catalogEnrollmentProgramsCreate({ active = true, expired, ignoreExpiration = false, includeDefaultPlatform, includeMetadata = true, org, platformKey, programId, programKey, programType, slug, started, userId, username, requestBody, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Date when enrollment expires */ expired?: string, /** * Whether to ignore expiration during unenrollment */ ignoreExpiration?: boolean, /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Include metadata in the response */ includeMetadata?: boolean, /** * Organization for the program */ org?: string, /** * Platform key for the program */ platformKey?: string, /** * Program ID for enrollment */ programId?: string, /** * Program key for enrollment */ programKey?: string, /** * Program type (standard, platform, custom) */ programType?: string, /** * Program slug for enrollment */ slug?: string, /** * Date when enrollment started */ started?: string, /** * User ID for enrollment */ userId?: string, /** * Username for enrollment */ username?: string, requestBody?: ProgramEnrollmentPlus, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/enrollment/programs/', query: { 'active': active, 'expired': expired, 'ignore_expiration': ignoreExpiration, 'include_default_platform': includeDefaultPlatform, 'include_metadata': includeMetadata, 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, 'program_type': programType, 'slug': slug, 'started': started, 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Unenroll from a program. Deactivates enrollment. * @returns ProgramEnrollment * @throws ApiError */ public static catalogEnrollmentProgramsDestroy({ active = true, expired, ignoreExpiration = false, includeDefaultPlatform, includeMetadata = true, org, platformKey, programId, programKey, programType, slug, started, userId, username, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Date when enrollment expires */ expired?: string, /** * Whether to ignore expiration during unenrollment */ ignoreExpiration?: boolean, /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Include metadata in the response */ includeMetadata?: boolean, /** * Organization for the program */ org?: string, /** * Platform key for the program */ platformKey?: string, /** * Program ID for enrollment */ programId?: string, /** * Program key for enrollment */ programKey?: string, /** * Program type (standard, platform, custom) */ programType?: string, /** * Program slug for enrollment */ slug?: string, /** * Date when enrollment started */ started?: string, /** * User ID for enrollment */ userId?: string, /** * Username for enrollment */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/enrollment/programs/', query: { 'active': active, 'expired': expired, 'ignore_expiration': ignoreExpiration, 'include_default_platform': includeDefaultPlatform, 'include_metadata': includeMetadata, 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, 'program_type': programType, 'slug': slug, 'started': started, 'user_id': userId, 'username': username, }, }); } /** * Search program enrollments based on user or program identifiers. Returns paginated enrollment results. * @returns ProgramEnrollmentSearchResponse * @throws ApiError */ public static catalogEnrollmentProgramsSearchRetrieve({ includeDefaultPlatform, org, page, pageSize, platformKey, programId, programType, slug, sort = '-id', userId, username, }: { /** * Include enrollments from default platform */ includeDefaultPlatform?: boolean, /** * Filter enrollments by organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Filter enrollments by platform key */ platformKey?: string, /** * Filter enrollments by program ID */ programId?: string, /** * Filter by program type (standard, platform, custom) */ programType?: string, /** * Filter enrollments by program slug */ slug?: string, /** * Field to sort results by */ sort?: string, /** * Filter enrollments by user ID */ userId?: string, /** * Filter enrollments by username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/enrollment/programs/search/', query: { 'include_default_platform': includeDefaultPlatform, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'program_id': programId, 'program_type': programType, 'slug': slug, 'sort': sort, 'user_id': userId, 'username': username, }, }); } /** * Log user enrollment with a program. * @returns ProgramEnrollment * @throws ApiError */ public static catalogEnrollmentProgramsSelfCreate({ active = true, expired, ignoreExpiration = false, org, platformKey, programId, programKey, slug, started, userId, username, requestBody, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Date when enrollment expires */ expired?: string, /** * Whether to ignore expiration during unenrollment */ ignoreExpiration?: boolean, /** * Organization for the program */ org?: string, /** * Platform key for the program */ platformKey?: string, /** * Program ID for self-enrollment */ programId?: string, /** * Program key for self-enrollment */ programKey?: string, /** * Program slug for self-enrollment */ slug?: string, /** * Date when enrollment started */ started?: string, /** * User ID for self-enrollment */ userId?: string, /** * Username for self-enrollment */ username?: string, requestBody?: ProgramEnrollment, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/enrollment/programs/self/', query: { 'active': active, 'expired': expired, 'ignore_expiration': ignoreExpiration, 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, 'slug': slug, 'started': started, 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Unenroll from a program. Deactivates enrollment. * @returns void * @throws ApiError */ public static catalogEnrollmentProgramsSelfDestroy({ active = true, expired, ignoreExpiration = false, org, platformKey, programId, programKey, slug, started, userId, username, }: { /** * Whether the enrollment should be active */ active?: boolean, /** * Date when enrollment expires */ expired?: string, /** * Whether to ignore expiration during unenrollment */ ignoreExpiration?: boolean, /** * Organization for the program */ org?: string, /** * Platform key for the program */ platformKey?: string, /** * Program ID for self-enrollment */ programId?: string, /** * Program key for self-enrollment */ programKey?: string, /** * Program slug for self-enrollment */ slug?: string, /** * Date when enrollment started */ started?: string, /** * User ID for self-enrollment */ userId?: string, /** * Username for self-enrollment */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/enrollment/programs/self/', query: { 'active': active, 'expired': expired, 'ignore_expiration': ignoreExpiration, 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, 'slug': slug, 'started': started, 'user_id': userId, 'username': username, }, }); } /** * Retrieve auto increment information for a specific platform. * @returns CatalogAutoIncrementResponse * @throws ApiError */ public static catalogIncrementRetrieve({ key, org, }: { /** * Platform key identifier */ key?: string, /** * Platform organization identifier */ org?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/increment/', query: { 'key': key, 'org': org, }, errors: { 404: `No response body`, }, }); } /** * Update auto increment information and retrieve a new ID for a specific platform. * @returns number * @throws ApiError */ public static catalogIncrementCreate({ requestBody, }: { requestBody: CatalogAutoIncrementUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/increment/', body: requestBody, mediaType: 'application/json', }); } /** * Retrieve a paginated list of course invitations * @returns PaginatedCourseInvitation * @throws ApiError */ public static catalogInvitationsCourseRetrieve({ active, courseId, email, org, page, pageSize, platformKey, platformOrg, sort = '-id', source, username, verbose, }: { /** * Filter by active status */ active?: boolean, /** * Filter by course ID */ courseId?: string, /** * Filter by user email */ email?: string, /** * Alternative filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Filter by platform organization */ platformOrg?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/invitations/course/', query: { 'active': active, 'course_id': courseId, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create a new course invitation * @returns CourseInvitationDetail * @throws ApiError */ public static catalogInvitationsCourseCreate({ requestBody, active, courseId, email, org, page, pageSize, platformKey, platformOrg, sort = '-id', source, username, verbose, }: { requestBody: CourseInvitationCreate, /** * Filter by active status */ active?: boolean, /** * Filter by course ID */ courseId?: string, /** * Filter by user email */ email?: string, /** * Alternative filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Filter by platform organization */ platformOrg?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/course/', query: { 'active': active, 'course_id': courseId, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - course doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a course invitation: TBD * @returns any Invitation successfully deleted * @throws ApiError */ public static catalogInvitationsCourseDestroy({ active, courseId, email, org, page, pageSize, platformKey, platformOrg, sort = '-id', source, username, verbose, }: { /** * Filter by active status */ active?: boolean, /** * Filter by course ID */ courseId?: string, /** * Filter by user email */ email?: string, /** * Alternative filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Filter by platform organization */ platformOrg?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/invitations/course/', query: { 'active': active, 'course_id': courseId, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - invitation doesn't exist`, 500: `Internal server error`, }, }); } /** * Create multiple blank course invitations * @returns BulkCourseInvitationResponse * @throws ApiError */ public static catalogInvitationsCourseBlankCreate({ requestBody, }: { requestBody: BlankCourseInvitationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/course/blank/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - course doesn't exist`, 500: `Internal server error`, }, }); } /** * Create multiple course invitations * @returns BulkCourseInvitationResponse * @throws ApiError */ public static catalogInvitationsCourseBulkCreate({ requestBody, }: { requestBody: BulkCourseInvitationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/course/bulk/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Redeem a blank course invitation * @returns CourseInvitationDetail * @throws ApiError */ public static catalogInvitationsCourseRedeemCreate({ requestBody, }: { requestBody: CourseInvitationRedemption, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/course/redeem/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - no blank invitation available`, 500: `Internal server error`, }, }); } /** * API View for managing platform invitations. * * This endpoint allows querying, creating, and deleting platform invitations for users. * * Query/Request Parameters: * For GET: * platform_key (str, optional): Filter by platform key * org (str, optional): Filter by platform organization * email (str, optional): Filter by user email * source (str, optional): Filter by invitation source * active (bool, optional): Filter by active status * sort (str, optional): Field to sort results by (default: '-id') * metadata fields: Any additional parameters will be treated as metadata filters * * For POST: * platform_key (str, required): The platform to create an invitation for * email (str, required): The email address to invite * active (bool, optional): Whether the invitation is active * metadata fields: Any additional parameters will be added as metadata * * For DELETE: * id (int, required): The ID of the invitation to delete * org (str, required): The platform organization for verification * * Methods: * GET: Retrieve a paginated list of platform invitations * POST: Create a new platform invitation * DELETE: Remove a platform invitation * * Returns: * GET: A paginated JSON response containing platform invitations: * { * "count": 10, * "next": "https://example.com/api/catalog/invitations/platform/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "username", * "email": "user@example.com", * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "source": "source", * "redirect_to": "https://example.com", * "expired": null, * "active": true, * "metadata": {}, * "platform_key": "platform1" * }, * ... * ] * } * * POST: A JSON response containing the created invitation: * { * "id": 123, * "user_id": 456, * "username": "username", * "email": "user@example.com", * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "source": "source", * "redirect_to": "https://example.com", * "expired": null, * "active": true, * "metadata": {}, * "platform_key": "platform1" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the platform or invitation doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin or IsPlatformAdmin permission * - Available to platform administrators and DM admins * @returns PaginatedPlatformInvitation * @throws ApiError */ public static catalogInvitationsPlatformRetrieve({ active, email, org, page, pageSize, platformKey, sort = '-id', source, username, verbose, }: { /** * Filter by active status */ active?: boolean, /** * Filter by user email */ email?: string, /** * Filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/invitations/platform/', query: { 'active': active, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create a new platform invitation * @returns PlatformInvitationDetail * @throws ApiError */ public static catalogInvitationsPlatformCreate({ requestBody, active, email, org, page, pageSize, platformKey, sort = '-id', source, username, verbose, }: { requestBody: PlatformInvitationCreate, /** * Filter by active status */ active?: boolean, /** * Filter by user email */ email?: string, /** * Filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/platform/', query: { 'active': active, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - platform doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a platform invitation: TBD * @returns any Invitation successfully deleted * @throws ApiError */ public static catalogInvitationsPlatformDestroy({ active, email, org, page, pageSize, platformKey, sort = '-id', source, username, verbose, }: { /** * Filter by active status */ active?: boolean, /** * Filter by user email */ email?: string, /** * Filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/invitations/platform/', query: { 'active': active, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - invitation doesn't exist`, 500: `Internal server error`, }, }); } /** * Create multiple blank platform invitations * @returns BulkPlatformInvitationResponse * @throws ApiError */ public static catalogInvitationsPlatformBlankCreate({ requestBody, }: { requestBody: BlankPlatformInvitationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/platform/blank/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - platform doesn't exist`, 500: `Internal server error`, }, }); } /** * API View for bulk creating platform invitations. * * This endpoint allows creating multiple platform invitations in a single request. * * Request Parameters: * invitation_data (list, required): List of invitation data objects, each containing: * platform_key (str, required): The platform to create an invitation for * email (str, required): The email address to invite * active (bool, optional): Whether the invitation is active * metadata fields: Any additional parameters will be added as metadata * platform_key (str, required for platform admins): The platform key for permission validation * * Methods: * POST: Create multiple platform invitations * * Returns: * POST: A JSON response containing the creation results: * { * "successes": 5, * "error_codes": [] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs during creation * * Access Control: * - Requires IsDMAdmin or IsPlatformAdmin permission * - Available to platform administrators and DM admins * @returns BulkPlatformInvitationResponse * @throws ApiError */ public static catalogInvitationsPlatformBulkCreate({ requestBody, }: { requestBody: BulkPlatformInvitationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/platform/bulk/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Check if a user has an active platform invitation * @returns any Active invitation exists for the email * @throws ApiError */ public static catalogInvitationsPlatformCheckRetrieve({ email, }: { /** * The email address to check for active invitations */ email: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/invitations/platform/check/', query: { 'email': email, }, errors: { 400: `Bad request - missing or invalid parameters`, 404: `No active invitation exists for the email`, }, }); } /** * Redeem a blank platform invitation * @returns PlatformInvitationDetail * @throws ApiError */ public static catalogInvitationsPlatformRedeemCreate({ requestBody, }: { requestBody: PlatformInvitationRedemption, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/platform/redeem/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - no blank invitation available`, 500: `Internal server error`, }, }); } /** * API View for managing program invitations. * * This endpoint allows querying, creating, and deleting program invitations for users. * * Query/Request Parameters: * For GET: * program_key (str, optional): Filter by program key * org (str, optional): Filter by platform organization * email (str, optional): Filter by user email * source (str, optional): Filter by invitation source * active (bool, optional): Filter by active status * sort (str, optional): Field to sort results by (default: '-id') * metadata fields: Any additional parameters will be treated as metadata filters * * For POST: * program_key (str, required): The program to create an invitation for * email (str, required): The email address to invite * active (bool, optional): Whether the invitation is active * metadata fields: Any additional parameters will be added as metadata * * For DELETE: * id (int, required): The ID of the invitation to delete * org (str, required): The platform organization for verification * * Methods: * GET: Retrieve a paginated list of program invitations * POST: Create a new program invitation * DELETE: Remove a program invitation * * Returns: * GET: A paginated JSON response containing program invitations: * { * "count": 10, * "next": "https://example.com/api/catalog/invitations/program/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "username", * "email": "user@example.com", * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "source": "source", * "redirect_to": "https://example.com", * "expired": null, * "active": true, * "metadata": {}, * "program_key": "org+program1" * }, * ... * ] * } * * POST: A JSON response containing the created invitation: * { * "id": 123, * "user_id": 456, * "username": "username", * "email": "user@example.com", * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "source": "source", * "redirect_to": "https://example.com", * "expired": null, * "active": true, * "metadata": {}, * "program_key": "org+program1" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the program or invitation doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsPlatformAdminForProgram permission * - Read-only access for platform admins, full access for DM admins and program-specific admins * @returns PaginatedProgramInvitation * @throws ApiError */ public static catalogInvitationsProgramRetrieve({ active, email, org, page, pageSize, platformKey, programKey, sort = '-id', source, username, verbose, }: { /** * Filter by active status */ active?: boolean, /** * Filter by user email */ email?: string, /** * Filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Filter by program key */ programKey?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/invitations/program/', query: { 'active': active, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'program_key': programKey, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * API View for managing program invitations. * * This endpoint allows querying, creating, and deleting program invitations for users. * * Query/Request Parameters: * For GET: * program_key (str, optional): Filter by program key * org (str, optional): Filter by platform organization * email (str, optional): Filter by user email * source (str, optional): Filter by invitation source * active (bool, optional): Filter by active status * sort (str, optional): Field to sort results by (default: '-id') * metadata fields: Any additional parameters will be treated as metadata filters * * For POST: * program_key (str, required): The program to create an invitation for * email (str, required): The email address to invite * active (bool, optional): Whether the invitation is active * metadata fields: Any additional parameters will be added as metadata * * For DELETE: * id (int, required): The ID of the invitation to delete * org (str, required): The platform organization for verification * * Methods: * GET: Retrieve a paginated list of program invitations * POST: Create a new program invitation * DELETE: Remove a program invitation * * Returns: * GET: A paginated JSON response containing program invitations: * { * "count": 10, * "next": "https://example.com/api/catalog/invitations/program/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "username", * "email": "user@example.com", * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "source": "source", * "redirect_to": "https://example.com", * "expired": null, * "active": true, * "metadata": {}, * "program_key": "org+program1" * }, * ... * ] * } * * POST: A JSON response containing the created invitation: * { * "id": 123, * "user_id": 456, * "username": "username", * "email": "user@example.com", * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "source": "source", * "redirect_to": "https://example.com", * "expired": null, * "active": true, * "metadata": {}, * "program_key": "org+program1" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If the program or invitation doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsPlatformAdminForProgram permission * - Read-only access for platform admins, full access for DM admins and program-specific admins * @returns ProgramInvitationDetail * @throws ApiError */ public static catalogInvitationsProgramCreate({ requestBody, active, email, org, page, pageSize, platformKey, programKey, sort = '-id', source, username, verbose, }: { requestBody: ProgramInvitationCreate, /** * Filter by active status */ active?: boolean, /** * Filter by user email */ email?: string, /** * Filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Filter by program key */ programKey?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/program/', query: { 'active': active, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'program_key': programKey, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - program doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a program invitation: TBD * @returns any Invitation successfully deleted * @throws ApiError */ public static catalogInvitationsProgramDestroy({ active, email, org, page, pageSize, platformKey, programKey, sort = '-id', source, username, verbose, }: { /** * Filter by active status */ active?: boolean, /** * Filter by user email */ email?: string, /** * Filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Filter by platform key */ platformKey?: string, /** * Filter by program key */ programKey?: string, /** * Field to sort results by */ sort?: string, /** * Filter by invitation source */ source?: string, /** * Filter by username */ username?: string, /** * Whether to include verbose output */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/invitations/program/', query: { 'active': active, 'email': email, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'program_key': programKey, 'sort': sort, 'source': source, 'username': username, 'verbose': verbose, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - invitation doesn't exist`, 500: `Internal server error`, }, }); } /** * API View for creating blank program invitations. * * This endpoint allows creating multiple blank program invitations (without user association) * that can be redeemed later. * * Request Parameters: * program_key (str, required): The program to create invitations for * source (str, required): The source identifier for the invitations * count (int, required): The number of blank invitations to create * metadata fields: Any additional parameters will be added as metadata * * Methods: * POST: Create multiple blank program invitations * * Returns: * POST: A JSON response containing the creation results: * { * "successes": 10, * "error_codes": [] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs during creation * * Access Control: * - Requires IsDMAdmin or IsPlatformAdminForProgram permission * - Available to DM admins and platform admins for the specific program * @returns BulkProgramInvitationResponse * @throws ApiError */ public static catalogInvitationsProgramBlankCreate({ requestBody, }: { requestBody: BlankProgramInvitationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/program/blank/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - program doesn't exist`, 500: `Internal server error`, }, }); } /** * API View for bulk creation of program invitations. * * This endpoint allows creating multiple program invitations at once. * * Request Parameters: * invitation_data (list, required): List of invitation data objects, each containing: * program_key (str, required): The program to create an invitation for * email (str, required): The email address to invite * active (bool, optional): Whether the invitation is active * metadata fields: Any additional parameters will be added as metadata * platform_key (str, required for platform admins): The platform key for permission validation * * Methods: * POST: Create multiple program invitations * * Returns: * POST: A JSON response containing the creation results: * { * "successes": 5, * "error_codes": [] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs during creation * * Access Control: * - Requires IsDMAdmin or IsPlatformAdmin permission * - Available to platform administrators and DM admins * @returns BulkProgramInvitationResponse * @throws ApiError */ public static catalogInvitationsProgramBulkCreate({ requestBody, }: { requestBody: BulkProgramInvitationCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/program/bulk/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * API View for redeeming blank program invitations. * * This endpoint allows redeeming a blank program invitation by associating it with a user. * * Request Parameters: * program_key (str, required): The program key for the invitation * source (str, required): The source identifier for the invitation * email (str, optional): The email to associate with the invitation * username (str, optional): The username to associate with the invitation * metadata fields: Any additional parameters will be added as metadata * * Methods: * POST: Redeem a blank program invitation * * Returns: * POST: A JSON response containing the redeemed invitation: * { * "id": 123, * "user_id": 456, * "username": "username", * "email": "user@example.com", * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "source": "source", * "redirect_to": "https://example.com", * "expired": null, * "active": true, * "metadata": {}, * "program_key": "org+program1" * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 404 Not Found: If no blank invitation is available * 500 Internal Server Error: If an unexpected error occurs during redemption * * Access Control: * - Requires IsDMAdmin or IsPlatformAdminForProgram permission * - Available to DM admins and platform admins for the specific program * @returns ProgramInvitationDetail * @throws ApiError */ public static catalogInvitationsProgramRedeemCreate({ requestBody, }: { requestBody: ProgramInvitationRedemption, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/invitations/program/redeem/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - no blank invitation available`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of course licenses * @returns PaginatedCourseLicense * @throws ApiError */ public static catalogLicensesCourseRetrieve({ active, courseId, externalId, key, name, org, page, pageSize, platformKey, platformOrg, query, sort = '-id', source, verbose = false, }: { /** * Filter by active status */ active?: boolean, /** * Filter by course ID */ courseId?: string, /** * Filter by external identifier */ externalId?: string, /** * Alternative filter by platform key */ key?: string, /** * Filter by license name (exact match) */ name?: string, /** * Alternative filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search license names (contains) */ query?: string, /** * Field to sort results by */ sort?: string, /** * Filter by license source */ source?: string, /** * Include detailed assignment data in the response */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/course/', query: { 'active': active, 'course_id': courseId, 'external_id': externalId, 'key': key, 'name': name, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, 'source': source, 'verbose': verbose, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of course license assignments * @returns PaginatedCourseLicenseAssignment * @throws ApiError */ public static catalogLicensesCourseAssignmentRetrieve({ licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the course license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/course/assignment/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create or update a course license assignment * @returns CourseLicenseAssignmentDetail * @throws ApiError */ public static catalogLicensesCourseAssignmentCreate({ licenseId, requestBody, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the course license */ licenseId: number, requestBody: CourseLicenseAssignmentCreate, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/course/assignment/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license or user doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a course license assignment * @returns any Assignment successfully deleted * @throws ApiError */ public static catalogLicensesCourseAssignmentDestroy({ assignmentId, licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the assignment to delete */ assignmentId: number, /** * The ID of the course license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/licenses/course/assignment/', query: { 'assignment_id': assignmentId, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - assignment doesn't exist`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of course license group assignments * @returns PaginatedCourseLicenseGroupAssignment * @throws ApiError */ public static catalogLicensesCourseAssignmentGroupRetrieve({ licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the course license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/course/assignment/group/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create or update a course license group assignment * @returns CourseLicenseGroupAssignmentDetail * @throws ApiError */ public static catalogLicensesCourseAssignmentGroupCreate({ licenseId, requestBody, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the course license */ licenseId: number, requestBody: CourseLicenseGroupAssignmentCreate, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/course/assignment/group/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license or group doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a course license group assignment * @returns any Assignment successfully deleted * @throws ApiError */ public static catalogLicensesCourseAssignmentGroupDestroy({ assignmentId, licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the assignment to delete */ assignmentId: number, /** * The ID of the course license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/licenses/course/assignment/group/', query: { 'assignment_id': assignmentId, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - assignment doesn't exist`, 500: `Internal server error`, }, }); } /** * Create a new course license * @returns CourseLicenseDetail * @throws ApiError */ public static catalogLicensesCourseCreateCreate({ requestBody, }: { requestBody: CourseLicenseCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/course/create/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - course or platform doesn't exist`, 500: `Internal server error`, }, }); } /** * Update an existing course license * @returns CourseLicenseDetail * @throws ApiError */ public static catalogLicensesCourseUpdateCreate({ requestBody, }: { requestBody?: CourseLicenseUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/course/update/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license doesn't exist`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of platform licenses * @returns PaginatedPlatformLicense * @throws ApiError */ public static catalogLicensesPlatformRetrieve({ active, externalId, key, name, page, pageSize, platformKey, query, sort = '-id', source, verbose = false, }: { /** * Filter by active status */ active?: boolean, /** * Filter by external identifier */ externalId?: string, /** * Alternative filter by platform key */ key?: string, /** * Filter by license name (exact match) */ name?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * Search license names (contains) */ query?: string, /** * Field to sort results by */ sort?: string, /** * Filter by license source */ source?: string, /** * Include detailed assignment data in the response */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/platform/', query: { 'active': active, 'external_id': externalId, 'key': key, 'name': name, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'query': query, 'sort': sort, 'source': source, 'verbose': verbose, }, errors: { 400: `Bad request - invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create a new platform license * @returns PlatformLicenseDetail * @throws ApiError */ public static catalogLicensesPlatformCreateCreate({ requestBody, }: { requestBody: PlatformLicenseCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/platform/create/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Update an existing platform license * @returns PlatformLicenseDetail * @throws ApiError */ public static catalogLicensesPlatformUpdateCreate({ requestBody, }: { requestBody?: PlatformLicenseUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/platform/update/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license doesn't exist`, 500: `Internal server error`, }, }); } /** * API View for managing program licenses. * * This endpoint allows retrieving program licenses with filtering and pagination support. * * Query Parameters: * platform_key (str, optional): The unique identifier for the platform * name (str, optional): Filter by license name (exact match) * source (str, optional): Filter by license source * active (bool, optional): Filter by active status * program_id (str, optional): Filter by program ID * query (str, optional): Search licenses by name (contains) * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * verbose (bool, optional): Include additional details in response * sort (str, optional): Field to sort results by (default: '-id') * * Methods: * GET: Retrieve a paginated list of program licenses * * Returns: * GET: A paginated JSON response containing program licenses: * { * "count": 10, * "next": "https://example.com/api/catalog/licenses/program/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "expired": null, * "name": "Program License 2023", * "count": 100, * "active": true, * "metadata": {}, * "source": "source", * "external_id": "ext-123", * "platform_key": "platform1", * "program_id": "program-v1:org+program+run", * "assignments": { * "total": 50, * "active": 45, * "pending": 5 * } * }, * ... * ] * } * * Error Responses: * 400 Bad Request: If query parameters are invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin or IsPlatformAdminReadOnly permission * - Available to platform administrators (read-only) and DM admins * @returns PaginatedProgramLicense * @throws ApiError */ public static catalogLicensesProgramRetrieve({ active, externalId, key, name, org, page, pageSize, platformKey, platformOrg, programId, query, sort = '-id', source, verbose = false, }: { /** * Filter by active status */ active?: boolean, /** * Filter by external identifier */ externalId?: string, /** * Alternative filter by platform key */ key?: string, /** * Filter by license name (exact match) */ name?: string, /** * Alternative filter by platform organization */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Filter by program ID */ programId?: string, /** * Search license names (contains) */ query?: string, /** * Field to sort results by (e.g., '-id', 'created', '-created') */ sort?: string, /** * Filter by license source */ source?: string, /** * Include detailed assignment data in the response */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/program/', query: { 'active': active, 'external_id': externalId, 'key': key, 'name': name, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'program_id': programId, 'query': query, 'sort': sort, 'source': source, 'verbose': verbose, }, errors: { 400: `Bad request - invalid parameters`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of program license assignments * @returns PaginatedProgramLicenseAssignment * @throws ApiError */ public static catalogLicensesProgramAssignmentRetrieve({ licenseId, active, email, fulfilled, page, pageSize, platformKey, platformOrg, sort = 'id', userId, }: { /** * The ID of the program license */ licenseId: number, /** * Filter by the active status of assignments */ active?: boolean, /** * Filter assignments for a specific email */ email?: string, /** * Filter by the fulfilled status of assignments */ fulfilled?: boolean, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by (e.g., 'id', '-id', 'created', '-created') */ sort?: string, /** * Filter assignments for a specific user ID */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/program/assignment/', query: { 'active': active, 'email': email, 'fulfilled': fulfilled, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'user_id': userId, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create or update a program license assignment * @returns ProgramLicenseAssignmentDetail * @throws ApiError */ public static catalogLicensesProgramAssignmentCreate({ licenseId, requestBody, active, email, fulfilled, page, pageSize, platformKey, platformOrg, sort = 'id', userId, }: { /** * The ID of the program license */ licenseId: number, requestBody: ProgramLicenseAssignmentCreate, /** * Filter by the active status of assignments */ active?: boolean, /** * Filter assignments for a specific email */ email?: string, /** * Filter by the fulfilled status of assignments */ fulfilled?: boolean, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by (e.g., 'id', '-id', 'created', '-created') */ sort?: string, /** * Filter assignments for a specific user ID */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/program/assignment/', query: { 'active': active, 'email': email, 'fulfilled': fulfilled, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license or user doesn't exist`, 500: `Internal server error`, }, }); } /** * Unassign single user from license * @returns any Assignment successfully deleted * @throws ApiError */ public static catalogLicensesProgramAssignmentDestroy({ assignmentId, licenseId, active, email, fulfilled, page, pageSize, platformKey, platformOrg, sort = 'id', userId, }: { /** * The ID of the assignment to delete */ assignmentId: number, /** * The ID of the program license */ licenseId: number, /** * Filter by the active status of assignments */ active?: boolean, /** * Filter assignments for a specific email */ email?: string, /** * Filter by the fulfilled status of assignments */ fulfilled?: boolean, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform (for permission validation) */ platformKey?: string, /** * The organization identifier for the platform (for permission validation) */ platformOrg?: string, /** * Field to sort results by (e.g., 'id', '-id', 'created', '-created') */ sort?: string, /** * Filter assignments for a specific user ID */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/licenses/program/assignment/', query: { 'active': active, 'assignment_id': assignmentId, 'email': email, 'fulfilled': fulfilled, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'user_id': userId, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - assignment doesn't exist`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of program license group assignments * @returns PaginatedProgramLicenseGroupAssignment * @throws ApiError */ public static catalogLicensesProgramAssignmentGroupRetrieve({ licenseId, active, fulfilled, groupId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the program license */ licenseId: number, /** * Filter by the active status of group assignments */ active?: boolean, /** * Filter by the fulfilled status of group assignments */ fulfilled?: boolean, /** * Filter assignments for a specific user group ID */ groupId?: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by (e.g., 'id', '-id', 'created', '-created') */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/program/assignment/group/', query: { 'active': active, 'fulfilled': fulfilled, 'group_id': groupId, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create or update a program license group assignment * @returns ProgramLicenseGroupAssignmentDetail * @throws ApiError */ public static catalogLicensesProgramAssignmentGroupCreate({ licenseId, requestBody, active, fulfilled, groupId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the program license */ licenseId: number, requestBody: ProgramLicenseGroupAssignmentCreate, /** * Filter by the active status of group assignments */ active?: boolean, /** * Filter by the fulfilled status of group assignments */ fulfilled?: boolean, /** * Filter assignments for a specific user group ID */ groupId?: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by (e.g., 'id', '-id', 'created', '-created') */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/program/assignment/group/', query: { 'active': active, 'fulfilled': fulfilled, 'group_id': groupId, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license or group doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a program license group assignment * @returns any Assignment successfully deleted * @throws ApiError */ public static catalogLicensesProgramAssignmentGroupDestroy({ assignmentId, licenseId, active, fulfilled, groupId, page, pageSize, platformKey, platformOrg, removeUserAssignments = true, sort = 'id', }: { /** * The ID of the assignment to delete */ assignmentId: number, /** * The ID of the program license */ licenseId: number, /** * Filter by the active status of group assignments */ active?: boolean, /** * Filter by the fulfilled status of group assignments */ fulfilled?: boolean, /** * Filter assignments for a specific user group ID */ groupId?: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform (for permission validation) */ platformKey?: string, /** * The organization identifier for the platform (for permission validation) */ platformOrg?: string, /** * Whether to also remove individual user assignments that were created by this group assignment */ removeUserAssignments?: boolean, /** * Field to sort results by (e.g., 'id', '-id', 'created', '-created') */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/licenses/program/assignment/group/', query: { 'active': active, 'assignment_id': assignmentId, 'fulfilled': fulfilled, 'group_id': groupId, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'remove_user_assignments': removeUserAssignments, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - assignment doesn't exist`, 500: `Internal server error`, }, }); } /** * API View for creating program licenses. * * This endpoint allows administrators to create new program licenses with various configurations. * * Methods: * POST: Create a new program license * * Request Body: * A JSON object containing: * - platform_key (str, required): The platform to create a license for * - program_id (str, required): The program ID to create a license for * - name (str, optional): Display name for the license * - count (int, optional): Number of seats purchased (default: 0) * - started (datetime, optional): Date when license should begin * - expired (datetime, optional): Date when license should expire * - active (bool, optional): Whether the license is active (default: true) * - metadata (dict, optional): Additional license metadata * - enrollment_config (dict, optional): Additional enrollment configuration * - source (str, optional): Source identifier * - external_id (str, optional): External identifier (must be unique) * * Returns: * POST: A JSON response containing the created license: * { * "id": 123, * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "expired": null, * "name": "Program License 2023", * "count": 100, * "active": true, * "metadata": {}, * "source": "source", * "external_id": "ext-123", * "platform_key": "platform1", * "program_id": "program-v1:org+program+run" * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to create licenses * 500 Internal Server Error: If an unexpected error occurs during license creation * * Access Control: * - Requires IsDMAdmin permission * - Available only to DM administrators * @returns ProgramLicenseDetail * @throws ApiError */ public static catalogLicensesProgramCreateCreate({ requestBody, }: { requestBody: ProgramLicenseCreateDetail, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/program/create/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for updating existing program licenses. * * This endpoint allows administrators to update the properties of an existing program license. * * Methods: * POST: Update an existing program license * * Request Body: * A JSON object containing: * - license_id (int, optional): The ID of the license to update (required if external_id not provided) * - external_id (str, optional): External identifier of the license to update (required if license_id not provided) * - name (str, optional): Updated display name for the license * - count (int, optional): Updated number of seats purchased * - started (datetime, optional): Updated date when license should begin * - expired (datetime, optional): Updated date when license should expire * - active (bool, optional): Updated active status * - metadata (dict, optional): Updated additional license metadata * - enrollment_config (dict, optional): Updated enrollment configuration * - source (str, optional): Updated source identifier * - change_type (str, optional): Type of change being made (default: "update") * * Returns: * POST: A JSON response containing the updated license: * { * "id": 123, * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "expired": "2024-06-15T14:30:00Z", * "name": "Updated Program License 2023", * "count": 150, * "active": true, * "metadata": {"updated": true}, * "source": "updated-source", * "external_id": "ext-123", * "platform_key": "platform1", * "program_id": "program-v1:org+program+run" * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to update licenses * 404 Not Found: If the specified license doesn't exist * 500 Internal Server Error: If an unexpected error occurs during license update * * Access Control: * - Requires IsDMAdmin permission * - Available only to DM administrators * * Notes: * - Cannot update the platform or program associated with a license * - A license history record is automatically created for each update * @returns ProgramLicenseDetail * @throws ApiError */ public static catalogLicensesProgramUpdateCreate({ requestBody, }: { requestBody?: ProgramLicenseUpdateDetail, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/program/update/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 404: `Not found - license does not exist`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of user licenses * @returns PaginatedUserLicense * @throws ApiError */ public static catalogLicensesUserRetrieve({ active, externalId, key, name, page, pageSize, platformKey, query, sort = '-id', source, verbose = false, }: { /** * Filter by active status */ active?: boolean, /** * Filter by external identifier */ externalId?: string, /** * Alternative filter by platform key */ key?: string, /** * Filter by license name (exact match) */ name?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * Search license names (contains) */ query?: string, /** * Field to sort results by */ sort?: string, /** * Filter by license source */ source?: string, /** * Include detailed assignment data in the response */ verbose?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/user/', query: { 'active': active, 'external_id': externalId, 'key': key, 'name': name, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'query': query, 'sort': sort, 'source': source, 'verbose': verbose, }, errors: { 400: `Bad request - invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Retrieve a paginated list of user license assignments * @returns PaginatedUserLicenseAssignment * @throws ApiError */ public static catalogLicensesUserAssignmentRetrieve({ licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the user license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/user/assignment/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create or update a user license assignment * @returns UserLicenseAssignmentDetail * @throws ApiError */ public static catalogLicensesUserAssignmentCreate({ licenseId, requestBody, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the user license */ licenseId: number, requestBody: UserLicenseAssignmentCreate, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/user/assignment/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license or user doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a user license assignment * @returns any Assignment successfully deleted * @throws ApiError */ public static catalogLicensesUserAssignmentDestroy({ assignmentId, licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the assignment to delete */ assignmentId: number, /** * The ID of the user license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/licenses/user/assignment/', query: { 'assignment_id': assignmentId, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - assignment doesn't exist`, 500: `Internal server error`, }, }); } /** * Check if a user has an active user license assignment * @returns any Active license assignment exists for the email * @throws ApiError */ public static catalogLicensesUserAssignmentCheckRetrieve({ email, }: { /** * The email address to check for active license assignments */ email: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/user/assignment/check/', query: { 'email': email, }, errors: { 400: `Bad request - missing or invalid parameters`, 404: `No active license assignment exists for the email`, }, }); } /** * Retrieve a paginated list of user license group assignments * @returns PaginatedUserLicenseGroupAssignment * @throws ApiError */ public static catalogLicensesUserAssignmentGroupRetrieve({ licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the user license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/licenses/user/assignment/group/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * Create or update a user license group assignment * @returns UserLicenseGroupAssignmentDetail * @throws ApiError */ public static catalogLicensesUserAssignmentGroupCreate({ licenseId, requestBody, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the user license */ licenseId: number, requestBody: UserLicenseGroupAssignmentCreate, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/user/assignment/group/', query: { 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license or group doesn't exist`, 500: `Internal server error`, }, }); } /** * Remove a user license group assignment * @returns any Assignment successfully deleted * @throws ApiError */ public static catalogLicensesUserAssignmentGroupDestroy({ assignmentId, licenseId, page, pageSize, platformKey, platformOrg, sort = 'id', }: { /** * The ID of the assignment to delete */ assignmentId: number, /** * The ID of the user license */ licenseId: number, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * The unique identifier for the platform */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/licenses/user/assignment/group/', query: { 'assignment_id': assignmentId, 'license_id': licenseId, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, }, errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - assignment doesn't exist`, 500: `Internal server error`, }, }); } /** * Create a new user license * @returns UserLicenseDetail * @throws ApiError */ public static catalogLicensesUserCreateCreate({ requestBody, }: { requestBody: UserLicenseCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/user/create/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 500: `Internal server error`, }, }); } /** * API View for updating existing user licenses. * * This endpoint allows administrators to update the properties of an existing user license. * * Methods: * POST: Update an existing user license * * Request Body: * A JSON object containing: * - license_id (int, optional): The ID of the license to update (required if external_id not provided) * - external_id (str, optional): External identifier of the license to update (required if license_id not provided) * - name (str, optional): Updated display name for the license * - count (int, optional): Updated number of seats purchased * - started (datetime, optional): Updated date when license should begin * - expired (datetime, optional): Updated date when license should expire * - active (bool, optional): Updated active status * - metadata (dict, optional): Updated additional license metadata * - enrollment_config (dict, optional): Updated enrollment configuration * - source (str, optional): Updated source identifier * - change_type (str, optional): Type of change being made (default: "update") * * Returns: * POST: A JSON response containing the updated license: * { * "id": 123, * "created": "2023-06-15T14:30:00Z", * "started": "2023-06-15T14:30:00Z", * "expired": "2024-06-15T14:30:00Z", * "name": "Updated User License 2023", * "count": 150, * "active": true, * "metadata": {"updated": true}, * "source": "updated-source", * "external_id": "ext-123", * "platform_key": "platform1" * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to update licenses * 404 Not Found: If the specified license doesn't exist * 500 Internal Server Error: If an unexpected error occurs during license update * * Access Control: * - Requires IsDMAdmin permission * - Available only to DM administrators * * Notes: * - Cannot update the platform associated with a license * - A license history record is automatically created for each update * @returns UserLicenseDetail * @throws ApiError */ public static catalogLicensesUserUpdateCreate({ requestBody, }: { requestBody?: UserLicenseUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/licenses/user/update/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - missing or invalid parameters`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not found - license doesn't exist`, 500: `Internal server error`, }, }); } /** * Query metadata choices based on field_key, scope, and org parameters. * @returns any No response body * @throws ApiError */ public static catalogMetadataChoicesRetrieve({ fieldKey, org, scope, }: { /** * The key of the field for which choices are being queried */ fieldKey?: string, /** * The organization context for the metadata choices */ org?: string, /** * The scope within which to query the metadata choices (course, program, pathway, resource) */ scope?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/choices/', query: { 'field_key': fieldKey, 'org': org, 'scope': scope, }, }); } /** * Retrieve metadata for a course. * @returns any No response body * @throws ApiError */ public static catalogMetadataCourseRetrieve({ courseId, }: { /** * The course ID to get metadata for */ courseId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/course/', query: { 'course_id': courseId, }, errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Update metadata for a course. * @returns any No response body * @throws ApiError */ public static catalogMetadataCourseCreate({ courseId, requestBody, }: { /** * The course ID to get metadata for */ courseId: string, requestBody: CourseMetadataUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/metadata/course/', query: { 'course_id': courseId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Retrieve public metadata for a course. * @returns any No response body * @throws ApiError */ public static catalogMetadataCoursePublicRetrieve({ courseId, }: { /** * The course ID to get metadata for */ courseId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/course-public/', query: { 'course_id': courseId, }, errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Retrieve public metadata for a course. * @returns any No response body * @throws ApiError */ public static catalogMetadataCoursePublicRetrieve2({ courseId, field, }: { /** * The course ID to get metadata for */ courseId: string, field: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/course-public/{field}/', path: { 'field': field, }, query: { 'course_id': courseId, }, errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Search for courses matching specified metadata filters. * @returns any * @throws ApiError */ public static catalogMetadataCourseSearchCreate({ requestBody, }: { requestBody?: CourseMetadataSearchRequest, }): CancelablePromise> { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/metadata/course-search/', body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, 500: `No response body`, }, }); } /** * Retrieve metadata for a course. * @returns any No response body * @throws ApiError */ public static catalogMetadataCourseRetrieve2({ courseId, field, }: { /** * The course ID to get metadata for */ courseId: string, field: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/course/{field}/', path: { 'field': field, }, query: { 'course_id': courseId, }, errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Update metadata for a course. * @returns any No response body * @throws ApiError */ public static catalogMetadataCourseCreate2({ courseId, field, requestBody, }: { /** * The course ID to get metadata for */ courseId: string, field: string, requestBody: CourseMetadataUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/metadata/course/{field}/', path: { 'field': field, }, query: { 'course_id': courseId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Retrieve metadata for a specified program * @returns ProgramMetadataResponse * @throws ApiError */ public static catalogMetadataProgramRetrieve({ programId, org, platformKey, programKey, }: { /** * The unique identifier for the program */ programId: string, /** * The organization associated with the program */ org?: string, /** * Platform key identifier (alternative to org) */ platformKey?: string, /** * Program key (alternative to program_id + org) */ programKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/program/', query: { 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, }, errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Program not found`, }, }); } /** * Update metadata for a specified program * @returns ProgramMetadataResponse * @throws ApiError */ public static catalogMetadataProgramCreate({ programId, requestBody, org, platformKey, programKey, }: { /** * The unique identifier for the program */ programId: string, requestBody: ProgramMetadataRequest, /** * The organization associated with the program */ org?: string, /** * Platform key identifier (alternative to org) */ platformKey?: string, /** * Program key (alternative to program_id + org) */ programKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/metadata/program/', query: { 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Program not found`, }, }); } /** * Retrieve public metadata for a specified program * @returns ProgramMetadataResponse * @throws ApiError */ public static catalogMetadataProgramPublicRetrieve({ programId, org, platformKey, programKey, }: { /** * The unique identifier for the program */ programId: string, /** * The organization associated with the program */ org?: string, /** * Platform key identifier (alternative to org) */ platformKey?: string, /** * Program key (alternative to program_id + org) */ programKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/program-public/', query: { 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, }, errors: { 400: `Missing or invalid parameters`, 404: `Program not found or no public metadata available`, }, }); } /** * Retrieve public metadata for a specified program * @returns ProgramMetadataResponse * @throws ApiError */ public static catalogMetadataProgramPublicRetrieve2({ field, programId, org, platformKey, programKey, }: { field: string, /** * The unique identifier for the program */ programId: string, /** * The organization associated with the program */ org?: string, /** * Platform key identifier (alternative to org) */ platformKey?: string, /** * Program key (alternative to program_id + org) */ programKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/program-public/{field}/', path: { 'field': field, }, query: { 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, }, errors: { 400: `Missing or invalid parameters`, 404: `Program not found or no public metadata available`, }, }); } /** * Retrieve metadata for a specified program * @returns ProgramMetadataResponse * @throws ApiError */ public static catalogMetadataProgramRetrieve2({ field, programId, org, platformKey, programKey, }: { field: string, /** * The unique identifier for the program */ programId: string, /** * The organization associated with the program */ org?: string, /** * Platform key identifier (alternative to org) */ platformKey?: string, /** * Program key (alternative to program_id + org) */ programKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/metadata/program/{field}/', path: { 'field': field, }, query: { 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, }, errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Program not found`, }, }); } /** * Update metadata for a specified program * @returns ProgramMetadataResponse * @throws ApiError */ public static catalogMetadataProgramCreate2({ field, programId, requestBody, org, platformKey, programKey, }: { field: string, /** * The unique identifier for the program */ programId: string, requestBody: ProgramMetadataRequest, /** * The organization associated with the program */ org?: string, /** * Platform key identifier (alternative to org) */ platformKey?: string, /** * Program key (alternative to program_id + org) */ programKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/metadata/program/{field}/', path: { 'field': field, }, query: { 'org': org, 'platform_key': platformKey, 'program_id': programId, 'program_key': programKey, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Program not found`, }, }); } /** * Retrieve catalog-compatible completion info for user * @returns any * @throws ApiError */ public static catalogMilestonesCompletionsCourseCatalogRetrieve({ userId, fieldKey, }: { /** * The user identifier */ userId: number, /** * Specific field to include in the response */ fieldKey?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/completions/course/catalog/', query: { 'field_key': fieldKey, 'user_id': userId, }, errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `User not found or no completions found`, }, }); } /** * Retrieve completion information for a specific user and course * @returns any * @throws ApiError */ public static catalogMilestonesCompletionsCourseManageRetrieve({ courseId, userId, }: { /** * The course identifier (e.g., 'course-v1:org+code+run') */ courseId: string, /** * The user identifier */ userId: number, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/completions/course/manage/', query: { 'course_id': courseId, 'user_id': userId, }, errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `User, course, or completion record not found`, }, }); } /** * Create or update completion information for a specific user and course * @returns any * @throws ApiError */ public static catalogMilestonesCompletionsCourseManageCreate({ courseId, userId, requestBody, }: { /** * The course identifier (e.g., 'course-v1:org+code+run') */ courseId: string, /** * The user identifier */ userId: number, requestBody: CourseCompletion, }): CancelablePromise> { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/milestones/completions/course/manage/', query: { 'course_id': courseId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `User or course not found`, 500: `Server error`, }, }); } /** * Retrieve pathway completion information * @returns PathwayCompletionResponse * @throws ApiError */ public static catalogMilestonesCompletionsPathwayQueryRetrieve({ pathwayUuid, userId, username, }: { /** * The unique identifier for the pathway */ pathwayUuid: string, /** * The user identifier (either user_id or username required) */ userId?: number, /** * The username (either user_id or username required) */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/completions/pathway/query/', query: { 'pathway_uuid': pathwayUuid, 'user_id': userId, 'username': username, }, errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Pathway, user, or completion information not found`, }, }); } /** * Retrieve program completion information * @returns ProgramCompletionResponse * @throws ApiError */ public static catalogMilestonesCompletionsProgramQueryRetrieve({ programKey, userId, username, }: { /** * The unique identifier for the program */ programKey: string, /** * The user identifier (either user_id or username required) */ userId?: number, /** * The username (either user_id or username required) */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/completions/program/query/', query: { 'program_key': programKey, 'user_id': userId, 'username': username, }, errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Program, user, or completion information not found`, }, }); } /** * Retrieve completion info for resource/user * @returns ResourceCompletion * @throws ApiError */ public static catalogMilestonesCompletionsResourceManageRetrieve({ resourceId, userId, }: { /** * The unique identifier for the resource */ resourceId: number, /** * The ID of the user */ userId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/completions/resource/manage/', query: { 'resource_id': resourceId, 'user_id': userId, }, errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Resource, user, or completion record not found`, }, }); } /** * Create or update completion information for a specific resource and user * @returns ResourceCompletion * @throws ApiError */ public static catalogMilestonesCompletionsResourceManageCreate({ resourceId, userId, requestBody, }: { /** * The unique identifier for the resource */ resourceId: number, /** * The ID of the user */ userId: number, requestBody: ResourceCompletionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/milestones/completions/resource/manage/', query: { 'resource_id': resourceId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Missing or invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Resource or user not found`, 500: `Server error during completion creation/update`, }, }); } /** * Retrieve skill point information for a specific block * @returns any * @throws ApiError */ public static catalogMilestonesSkillPointsBlockRetrieve({ blockId, getObj = false, }: { /** * ID of the block to retrieve skill point information for */ blockId: string, /** * If True, returns skill objects instead of skill names as keys */ getObj?: boolean, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/skill_points/block/', query: { 'block_id': blockId, 'get_obj': getObj, }, errors: { 401: `Unauthorized`, 403: `Permission denied`, 404: `Block not found`, }, }); } /** * Update skill point information for a specific block * @returns any Successfully updated skill points * @throws ApiError */ public static catalogMilestonesSkillPointsBlockCreate({ blockId, requestBody, getObj = false, }: { /** * ID of the block to retrieve skill point information for */ blockId: string, requestBody: BlockSkillPointInfoRequest, /** * If True, returns skill objects instead of skill names as keys */ getObj?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/milestones/skill_points/block/', query: { 'block_id': blockId, 'get_obj': getObj, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request data`, 401: `Unauthorized`, 403: `Permission denied`, 404: `Block not found`, 500: `Server error`, }, }); } /** * Retrieve skill point information for a specific course * @returns any * @throws ApiError */ public static catalogMilestonesSkillPointsCourseRetrieve({ courseId, getObj = false, }: { /** * ID of the course to retrieve skill point information for */ courseId: string, /** * If True, returns skill objects instead of skill names as keys */ getObj?: boolean, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/skill_points/course/', query: { 'course_id': courseId, 'get_obj': getObj, }, errors: { 400: `Course not found`, 401: `Unauthorized`, 403: `Permission denied`, 404: `No skill points found`, }, }); } /** * Update skill point information for a specific course * @returns any Successfully updated skill points * @throws ApiError */ public static catalogMilestonesSkillPointsCourseCreate({ courseId, requestBody, getObj = false, }: { /** * ID of the course to retrieve skill point information for */ courseId: string, requestBody: CourseSkillPointInfoRequest, /** * If True, returns skill objects instead of skill names as keys */ getObj?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/milestones/skill_points/course/', query: { 'course_id': courseId, 'get_obj': getObj, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Course not found or invalid request data`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Server error`, }, }); } /** * Retrieve paginated list of platform skill points * @returns PlatformSkillPointResponse * @throws ApiError */ public static catalogMilestonesSkillPointsPlatformRetrieve({ departmentMode, platformKey, platformOrg, query, sort = '-id', }: { /** * If True, filters results by department user permissions */ departmentMode?: boolean, /** * Platform key identifier */ platformKey?: string, /** * Platform organization identifier */ platformOrg?: string, /** * Search query for filtering skill points by user or skill name */ query?: string, /** * Sort field for results. Default: '-id' */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/skill_points/platform/', query: { 'department_mode': departmentMode, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, errors: { 400: `Missing platform parameters or retrieval failed`, 401: `Unauthorized`, 403: `Permission denied`, }, }); } /** * Update platform skill points for a user * @returns any Successfully updated skill points * @throws ApiError */ public static catalogMilestonesSkillPointsPlatformCreate({ requestBody, departmentMode, platformKey, platformOrg, query, sort = '-id', }: { requestBody: PlatformSkillPointRequest, /** * If True, filters results by department user permissions */ departmentMode?: boolean, /** * Platform key identifier */ platformKey?: string, /** * Platform organization identifier */ platformOrg?: string, /** * Search query for filtering skill points by user or skill name */ query?: string, /** * Sort field for results. Default: '-id' */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/milestones/skill_points/platform/', query: { 'department_mode': departmentMode, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request data`, 401: `Unauthorized`, 403: `Permission denied`, }, }); } /** * Delete a platform skill point entry * @returns any Successfully deleted skill point * @throws ApiError */ public static catalogMilestonesSkillPointsPlatformDestroy({ skillPointId, departmentMode, platformKey, platformOrg, query, sort = '-id', }: { /** * ID of the skill point to delete */ skillPointId: number, /** * If True, filters results by department user permissions */ departmentMode?: boolean, /** * Platform key identifier */ platformKey?: string, /** * Platform organization identifier */ platformOrg?: string, /** * Search query for filtering skill points by user or skill name */ query?: string, /** * Sort field for results. Default: '-id' */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/milestones/skill_points/platform/', query: { 'department_mode': departmentMode, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'skill_point_id': skillPointId, 'sort': sort, }, errors: { 400: `Invalid request or deletion failed`, 401: `Unauthorized`, 403: `Permission denied`, }, }); } /** * Bulk create/update platform skill points * @returns PlatformSkillPointBulkResponse * @throws ApiError */ public static catalogMilestonesSkillPointsPlatformBulkCreate({ requestBody, }: { requestBody: PlatformSkillPointBulkRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/milestones/skill_points/platform/bulk/', body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request data`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Server error`, }, }); } /** * Update skill points for all users in a group * @returns any Successfully updated group skill points * @throws ApiError */ public static catalogMilestonesSkillPointsPlatformGroupCreate({ requestBody, }: { requestBody: PlatformSkillPointGroupRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/milestones/skill_points/platform/group/', body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request data`, 401: `Unauthorized`, 403: `Permission denied`, }, }); } /** * Retrieve skill point information for a specific user * @returns any * @throws ApiError */ public static catalogMilestonesSkillPointsUserRetrieve({ userId, username, }: { /** * ID of the user to retrieve skill point information for */ userId?: number, /** * Username to retrieve skill point information for */ username?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/milestones/skill_points/user/', query: { 'user_id': userId, 'username': username, }, errors: { 401: `Unauthorized`, 403: `Permission denied`, 404: `User not found`, }, }); } /** * Retrieve pathways matching query. Limited parameters. * @returns Pathway * @throws ApiError */ public static catalogPathwaysList({ itemId, name, pathwayId, pathwayUuid, platformKey, slug, userId, username, visible, }: { /** * Item ID associated with the pathway */ itemId?: string, /** * Pathway name */ name?: string, /** * Pathway ID */ pathwayId?: string, /** * Pathway UUID */ pathwayUuid?: string, /** * Platform key */ platformKey?: string, /** * Pathway slug (case-insensitive) */ slug?: string, /** * User ID of the pathway owner */ userId?: number, /** * Username of the pathway owner */ username?: string, /** * Whether the pathway is visible */ visible?: boolean, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/pathways/', query: { 'item_id': itemId, 'name': name, 'pathway_id': pathwayId, 'pathway_uuid': pathwayUuid, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, 'visible': visible, }, }); } /** * Add or update a pathway. * @returns Pathway * @throws ApiError */ public static catalogPathwaysCreate({ requestBody, itemId, name, pathwayId, pathwayUuid, platformKey, slug, userId, username, visible, }: { requestBody: PathwayCreateUpdateRequest, /** * Item ID associated with the pathway */ itemId?: string, /** * Pathway name */ name?: string, /** * Pathway ID */ pathwayId?: string, /** * Pathway UUID */ pathwayUuid?: string, /** * Platform key */ platformKey?: string, /** * Pathway slug (case-insensitive) */ slug?: string, /** * User ID of the pathway owner */ userId?: number, /** * Username of the pathway owner */ username?: string, /** * Whether the pathway is visible */ visible?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/pathways/', query: { 'item_id': itemId, 'name': name, 'pathway_id': pathwayId, 'pathway_uuid': pathwayUuid, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, 'visible': visible, }, body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, }, }); } /** * Remove a pathway from the database. * @returns PathwayDeleteResponse * @throws ApiError */ public static catalogPathwaysDestroy({ pathwayId, userId, itemId, name, pathwayUuid, platformKey, slug, username, visible, }: { /** * Pathway ID to delete */ pathwayId: string, /** * User ID of the pathway owner */ userId: number, /** * Item ID associated with the pathway */ itemId?: string, /** * Pathway name */ name?: string, /** * Pathway UUID */ pathwayUuid?: string, /** * Platform key */ platformKey?: string, /** * Pathway slug (case-insensitive) */ slug?: string, /** * Username of the pathway owner */ username?: string, /** * Whether the pathway is visible */ visible?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/pathways/', query: { 'item_id': itemId, 'name': name, 'pathway_id': pathwayId, 'pathway_uuid': pathwayUuid, 'platform_key': platformKey, 'slug': slug, 'user_id': userId, 'username': username, 'visible': visible, }, errors: { 400: `No response body`, }, }); } /** * A platform's placement assessments (#2280): list and create. * @returns any Assessments for the platform * @throws ApiError */ public static catalogPlacementsAssessmentsRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/placements/assessments/', }); } /** * A platform's placement assessments (#2280): list and create. * @returns any Assessment created * @throws ApiError */ public static catalogPlacementsAssessmentsCreate({ requestBody, }: { requestBody: PlacementAssessment, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/placements/assessments/', body: requestBody, mediaType: 'application/json', }); } /** * A single placement assessment: view, edit, or delete. * @returns any Assessment * @throws ApiError */ public static catalogPlacementsAssessmentsRetrieve2({ assessmentId, }: { assessmentId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/placements/assessments/{assessment_id}/', path: { 'assessment_id': assessmentId, }, }); } /** * A single placement assessment: view, edit, or delete. * @returns any Assessment updated * @throws ApiError */ public static catalogPlacementsAssessmentsPartialUpdate({ assessmentId, requestBody, }: { assessmentId: string, requestBody?: PatchedPlacementAssessmentUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/catalog/placements/assessments/{assessment_id}/', path: { 'assessment_id': assessmentId, }, body: requestBody, mediaType: 'application/json', }); } /** * A single placement assessment: view, edit, or delete. * @returns void * @throws ApiError */ public static catalogPlacementsAssessmentsDestroy({ assessmentId, }: { assessmentId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/placements/assessments/{assessment_id}/', path: { 'assessment_id': assessmentId, }, }); } /** * Course assignments on a platform (#2280): list (optionally by user), and * grant a course to a user. Each grant issues a ``CourseInvitation`` the * existing pipeline enrolls. * @returns any Course assignments * @throws ApiError */ public static catalogPlacementsCourseAssignmentsRetrieve({ platformKey, userId, }: { platformKey: string, userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/placements/course-assignments/', query: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Course assignments on a platform (#2280): list (optionally by user), and * grant a course to a user. Each grant issues a ``CourseInvitation`` the * existing pipeline enrolls. * @returns any Course assigned * @throws ApiError */ public static catalogPlacementsCourseAssignmentsCreate({ platformKey, requestBody, userId, }: { platformKey: string, requestBody: PlacementCourseAssignmentCreate, userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/placements/course-assignments/', query: { 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Remove one course assignment: deactivate the record and cancel its * invitation when the student has not yet enrolled through it. * @returns void * @throws ApiError */ public static catalogPlacementsCourseAssignmentsDestroy({ assignmentId, }: { assignmentId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/placements/course-assignments/{assignment_id}/', path: { 'assignment_id': assignmentId, }, }); } /** * Program assignments on a platform (#2280): list (optionally by user), and * grant a program to a user. Each grant issues a ``ProgramInvitation``. * @returns any Program assignments * @throws ApiError */ public static catalogPlacementsProgramAssignmentsRetrieve({ platformKey, userId, }: { platformKey: string, userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/placements/program-assignments/', query: { 'platform_key': platformKey, 'user_id': userId, }, }); } /** * Program assignments on a platform (#2280): list (optionally by user), and * grant a program to a user. Each grant issues a ``ProgramInvitation``. * @returns any Program assigned * @throws ApiError */ public static catalogPlacementsProgramAssignmentsCreate({ platformKey, requestBody, userId, }: { platformKey: string, requestBody: PlacementProgramAssignmentCreate, userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/placements/program-assignments/', query: { 'platform_key': platformKey, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Remove one program assignment: deactivate the record and cancel its * invitation when the student has not yet enrolled through it. * @returns void * @throws ApiError */ public static catalogPlacementsProgramAssignmentsDestroy({ assignmentId, }: { assignmentId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/placements/program-assignments/{assignment_id}/', path: { 'assignment_id': assignmentId, }, }); } /** * Placement records on a platform (#2280): list (filter by user, assessment, * or status), and assign a configured assessment to a user. * @returns any Placement records * @throws ApiError */ public static catalogPlacementsRecordsRetrieve({ platformKey, assessmentId, status, userId, }: { platformKey: string, assessmentId?: number, /** * * `not_assigned` - not_assigned * * `assigned` - assigned * * `started` - started * * `completed` - completed * * `reviewed` - reviewed * * `confirmed` - confirmed */ status?: 'not_assigned' | 'assigned' | 'started' | 'completed' | 'reviewed' | 'confirmed', userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/placements/records/', query: { 'assessment_id': assessmentId, 'platform_key': platformKey, 'status': status, 'user_id': userId, }, }); } /** * Placement records on a platform (#2280): list (filter by user, assessment, * or status), and assign a configured assessment to a user. * @returns any Placement assigned * @throws ApiError */ public static catalogPlacementsRecordsCreate({ platformKey, requestBody, assessmentId, status, userId, }: { platformKey: string, requestBody: PlacementRecordCreate, assessmentId?: number, /** * * `not_assigned` - not_assigned * * `assigned` - assigned * * `started` - started * * `completed` - completed * * `reviewed` - reviewed * * `confirmed` - confirmed */ status?: 'not_assigned' | 'assigned' | 'started' | 'completed' | 'reviewed' | 'confirmed', userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/placements/records/', query: { 'assessment_id': assessmentId, 'platform_key': platformKey, 'status': status, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Advance a single placement record: status, the agent's result, an admin * override, or a note. * @returns any Record updated * @throws ApiError */ public static catalogPlacementsRecordsPartialUpdate({ recordId, requestBody, }: { recordId: string, requestBody?: PatchedPlatformApplicationPlacementUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/catalog/placements/records/{record_id}/', path: { 'record_id': recordId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve programs matching query parameters. Limited parameters include program_id, name, slug, enabled, and org. * @returns Program * @throws ApiError */ public static catalogProgramsList({ courseId, enabled, name, org, programId, slug, }: { /** * Course ID contained in the program */ courseId?: string, /** * Whether the program is enabled */ enabled?: boolean, /** * Program name */ name?: string, /** * Organization of the program */ org?: string, /** * Program ID */ programId?: string, /** * Program slug (case-insensitive) */ slug?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/programs/', query: { 'course_id': courseId, 'enabled': enabled, 'name': name, 'org': org, 'program_id': programId, 'slug': slug, }, }); } /** * Add or update a program. Accepts a list of courses and updates or creates a program. * @returns Program * @throws ApiError */ public static catalogProgramsCreate({ requestBody, }: { requestBody: ProgramCreateUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/programs/', body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, }, }); } /** * Remove a program from the database. Requires program_id and org as parameters. * @returns ProgramDeleteResponse * @throws ApiError */ public static catalogProgramsDestroy({ org, programId, }: { /** * Organization of the program */ org: string, /** * Program ID to delete */ programId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/programs/', query: { 'org': org, 'program_id': programId, }, errors: { 400: `No response body`, }, }); } /** * GET * Get a 'next' course * * This method retrieves the next recommended course for a user based on the provided parameters. * It expects the following parameters in the request query: * - user_id: The ID of the user for whom the next course is being recommended. * - course_id: The ID of the current course. * - org: The organization associated with the course. * * Returns: * - A serialized representation of the next course if found, with a status code of 200. * - A status code of 400 if the course_id is not provided. * - A status code of 200 with a None response if no next course is found. * * Error Conditions: * - Returns a 400 status code if the course_id is missing from the request parameters. * * Side Effects: * - None * @returns Course * @throws ApiError */ public static catalogRecommendationCoursesRetrieve({ courseId, org, userId, }: { /** * Current course ID */ courseId: string, /** * Organization to filter recommendations */ org?: string, /** * User ID for personalized recommendations */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/recommendation/courses/', query: { 'course_id': courseId, 'org': org, 'user_id': userId, }, }); } /** * Retrieve resources matching query. Limited parameters. * @returns Resource * @throws ApiError */ public static catalogResourcesList({ id, itemId, key, name, org, platformKey, platformOrg, resourceType, userId, username, }: { /** * Resource ID */ id?: number, /** * Item ID associated with the resource */ itemId?: string, /** * Platform key */ key?: string, /** * Resource name */ name?: string, /** * Platform organization */ org?: string, /** * Platform key (alternative to key) */ platformKey?: string, /** * Platform organization (alternative to org) */ platformOrg?: string, /** * Type of resource */ resourceType?: string, /** * User ID who owns the resource */ userId?: number, /** * Username who owns the resource */ username?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/resources/', query: { 'id': id, 'item_id': itemId, 'key': key, 'name': name, 'org': org, 'platform_key': platformKey, 'platform_org': platformOrg, 'resource_type': resourceType, 'user_id': userId, 'username': username, }, }); } /** * Create or update a resource with optional image upload * Create or update a resource. For updates, include the resource ID. * @returns Resource * @throws ApiError */ public static catalogResourcesCreate({ formData, id, itemId, key, name, org, platformKey, platformOrg, resourceType, userId, username, }: { formData: ResourceCreateUpdate, /** * Resource ID */ id?: number, /** * Item ID associated with the resource */ itemId?: string, /** * Platform key */ key?: string, /** * Resource name */ name?: string, /** * Platform organization */ org?: string, /** * Platform key (alternative to key) */ platformKey?: string, /** * Platform organization (alternative to org) */ platformOrg?: string, /** * Type of resource */ resourceType?: string, /** * User ID who owns the resource */ userId?: number, /** * Username who owns the resource */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/resources/', query: { 'id': id, 'item_id': itemId, 'key': key, 'name': name, 'org': org, 'platform_key': platformKey, 'platform_org': platformOrg, 'resource_type': resourceType, 'user_id': userId, 'username': username, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Remove a resource from the database. * @returns ResourceDeleteResponse * @throws ApiError */ public static catalogResourcesDestroy({ id, itemId, key, name, org, platformKey, platformOrg, resourceType, userId, username, }: { /** * Resource ID to delete */ id: number, /** * Item ID associated with the resource */ itemId?: string, /** * Platform key */ key?: string, /** * Resource name */ name?: string, /** * Platform organization */ org?: string, /** * Platform key */ platformKey?: string, /** * Platform organization (alternative to org) */ platformOrg?: string, /** * Type of resource */ resourceType?: string, /** * User ID who owns the resource */ userId?: number, /** * Username who owns the resource */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/resources/', query: { 'id': id, 'item_id': itemId, 'key': key, 'name': name, 'org': org, 'platform_key': platformKey, 'platform_org': platformOrg, 'resource_type': resourceType, 'user_id': userId, 'username': username, }, }); } /** * Paginated list of resources matching query parameters. Accepts the same filter parameters as /api/catalog/resources/ and returns the standard paginated envelope (count / next_page / previous_page / results). Default page size is 50; clients can override via ?page_size= and paginate via ?page=. Prefer this endpoint over /api/catalog/resources/ when result counts may be large (e.g. listing Heygen avatars). * @returns PaginatedResource * @throws ApiError */ public static catalogResourcesSearchRetrieve({ id, itemId, key, name, org, page, pageSize, platformKey, platformOrg, query, resourceType, userId, username, }: { /** * Resource ID */ id?: number, /** * Item ID associated with the resource */ itemId?: string, /** * Platform key */ key?: string, /** * Resource name */ name?: string, /** * Platform organization */ org?: string, /** * Page number (1-indexed) */ page?: number, /** * Items per page (default 50) */ pageSize?: number, /** * Platform key (alternative to key) */ platformKey?: string, /** * Platform organization (alternative to org) */ platformOrg?: string, /** * Substring match on resource name (icontains) */ query?: string, /** * Type of resource */ resourceType?: string, /** * User ID who owns the resource */ userId?: number, /** * Username who owns the resource */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/resources/search/', query: { 'id': id, 'item_id': itemId, 'key': key, 'name': name, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'resource_type': resourceType, 'user_id': userId, 'username': username, }, }); } /** * Retrieve a paginated list of course reviews with filtering options * @returns CourseReviewPaginatedResponse * @throws ApiError */ public static catalogReviewsCourseRetrieve({ courseId, org, page, pageSize, platformKey, platformOrg, sort = '-id', userId, }: { /** * Filter reviews by course ID */ courseId?: string, /** * Alias for platform_org */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Filter reviews by platform key */ platformKey?: string, /** * Filter reviews by platform organization */ platformOrg?: string, /** * Field to sort results by (default: '-id') */ sort?: string, /** * Filter reviews by user ID */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/reviews/course/', query: { 'course_id': courseId, 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'user_id': userId, }, errors: { 400: `Invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Internal server error`, }, }); } /** * Retrieve aggregate review information for a course. * @returns CourseReviewInfoResponse * @throws ApiError */ public static catalogReviewsCourseInfoRetrieve({ courseId, }: { /** * The course ID to get review information for */ courseId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/reviews/course/info/', query: { 'course_id': courseId, }, errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Create or update a course review * @returns CourseReviewResponse * @throws ApiError */ public static catalogReviewsCourseUpdateCreate({ requestBody, }: { requestBody: CourseReviewRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/reviews/course/update/', body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Review could not be saved`, }, }); } /** * Delete a course review * @returns any Review successfully deleted * @throws ApiError */ public static catalogReviewsCourseUpdateDestroy({ courseId, username, userId, }: { /** * The course ID of the review to delete */ courseId: string, /** * The username of the reviewer */ username: string, /** * The user ID of the reviewer (alternative to username) */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/reviews/course/update/', query: { 'course_id': courseId, 'user_id': userId, 'username': username, }, errors: { 400: `Invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Review could not be deleted`, }, }); } /** * Retrieve a paginated list of program reviews with filtering options * @returns ProgramReviewPaginatedResponse * @throws ApiError */ public static catalogReviewsProgramRetrieve({ org, page, pageSize, platformKey, platformOrg, programId, sort = '-id', userId, }: { /** * Alias for platform_org */ org?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Filter reviews by platform key */ platformKey?: string, /** * Filter reviews by platform organization */ platformOrg?: string, /** * Filter reviews by program ID */ programId?: string, /** * Field to sort results by (default: '-id') */ sort?: string, /** * Filter reviews by user ID */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/reviews/program/', query: { 'org': org, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'program_id': programId, 'sort': sort, 'user_id': userId, }, errors: { 400: `Invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Internal server error`, }, }); } /** * Retrieve aggregate review information for a program. * @returns ProgramReviewInfoResponse * @throws ApiError */ public static catalogReviewsProgramInfoRetrieve({ programKey, }: { /** * The program key to get review information for */ programKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/reviews/program/info/', query: { 'program_key': programKey, }, errors: { 400: `No response body`, 404: `No response body`, }, }); } /** * Create or update a program review * @returns ProgramReview * @throws ApiError */ public static catalogReviewsProgramUpdateCreate({ requestBody, }: { requestBody: ProgramReviewRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/reviews/program/update/', body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Review could not be saved`, }, }); } /** * Delete a program review * @returns any Review successfully deleted * @throws ApiError */ public static catalogReviewsProgramUpdateDestroy({ programKey, username, userId, }: { /** * The program key of the review to delete */ programKey: string, /** * The username of the reviewer */ username: string, /** * The user ID of the reviewer (alternative to username) */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/reviews/program/update/', query: { 'program_key': programKey, 'user_id': userId, 'username': username, }, errors: { 400: `Invalid parameters`, 401: `Unauthorized`, 403: `Permission denied`, 500: `Review could not be deleted`, }, }); } /** * Retrieve roles matching query parameters. Supports filtering by name, id, and slug. * @returns Role * @throws ApiError */ public static catalogRolesRetrieve({ id, name, nameIexact, page, pageSize, platformKey, slug, sort = 'id', }: { /** * Role ID */ id?: number, /** * Role name */ name?: string, /** * Exact match for role name (case insensitive) */ nameIexact?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Platform key */ platformKey?: string, /** * Role slug */ slug?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/roles/', query: { 'id': id, 'name': name, 'name__iexact': nameIexact, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'slug': slug, 'sort': sort, }, }); } /** * Add a new role or update an existing role based on provided data. * @returns Role * @throws ApiError */ public static catalogRolesCreate({ requestBody, id, name, nameIexact, page, pageSize, platformKey, slug, sort = 'id', }: { requestBody: RoleCreateUpdateRequest, /** * Role ID */ id?: number, /** * Role name */ name?: string, /** * Exact match for role name (case insensitive) */ nameIexact?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Platform key */ platformKey?: string, /** * Role slug */ slug?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/roles/', query: { 'id': id, 'name': name, 'name__iexact': nameIexact, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'slug': slug, 'sort': sort, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve desired roles for a user. * @returns DesiredRole * @throws ApiError */ public static catalogRolesDesiredRetrieve({ userId, username, }: { /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/roles/desired/', query: { 'user_id': userId, 'username': username, }, errors: { 400: `No response body`, }, }); } /** * Add or update desired roles for a user. * @returns DesiredRole * @throws ApiError */ public static catalogRolesDesiredCreate({ requestBody, userId, username, }: { requestBody: DesiredRoleCreateUpdateRequest, /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/roles/desired/', query: { 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, }, }); } /** * Add or update a role through the public API (when enabled). * @returns Role * @throws ApiError */ public static catalogRolesPublicCreate({ requestBody, }: { requestBody: RoleCreateUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/roles/public/', body: requestBody, mediaType: 'application/json', errors: { 404: `No response body`, }, }); } /** * Retrieve reported roles for a user. * @returns ReportedRole * @throws ApiError */ public static catalogRolesReportedRetrieve({ userId, username, }: { /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/roles/reported/', query: { 'user_id': userId, 'username': username, }, errors: { 400: `No response body`, }, }); } /** * Add or update reported roles for a user. * @returns ReportedRole * @throws ApiError */ public static catalogRolesReportedCreate({ requestBody, userId, username, }: { requestBody: ReportedRoleCreateUpdateRequest, /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/roles/reported/', query: { 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', errors: { 400: `No response body`, }, }); } /** * POST * Retrieve programs matching query. * * Params: * query: The search term used to filter programs. * org: The organization to which the programs belong. * * Returns: * A JSON response containing a list of programs that match the search criteria. * * Error Conditions: * - If the request data is malformed or missing required fields, a 400 Bad Request may be returned. * - If there is an issue with the database query, a 500 Internal Server Error may be returned. * * Side Effects: * - None * * Special Return Codes: * - A 200 status code indicates successful retrieval of programs matching the query. * @returns ProgramSearch * @throws ApiError */ public static catalogSearchProgramsCreate({ requestBody, org, query = '', }: { requestBody: ProgramSearch, /** * The organization to which the programs belong */ org?: string, /** * The search term used to filter programs */ query?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/search/programs/', query: { 'org': org, 'query': query, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve skills matching query. Limited parameters. * @returns PaginatedSkill * @throws ApiError */ public static catalogSkillsRetrieve({ id, name, nameIexact, page, pageSize, platformKey, slug, sort = 'id', }: { /** * Skill ID */ id?: number, /** * Skill name */ name?: string, /** * Exact match for skill name (case insensitive) */ nameIexact?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Platform key */ platformKey?: string, /** * Skill slug */ slug?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/skills/', query: { 'id': id, 'name': name, 'name__iexact': nameIexact, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'slug': slug, 'sort': sort, }, }); } /** * Add or update a skill. * @returns PaginatedSkill * @throws ApiError */ public static catalogSkillsCreate({ requestBody, id, name, nameIexact, page, pageSize, platformKey, slug, sort = 'id', }: { requestBody: PaginatedSkill, /** * Skill ID */ id?: number, /** * Skill name */ name?: string, /** * Exact match for skill name (case insensitive) */ nameIexact?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Platform key */ platformKey?: string, /** * Skill slug */ slug?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/skills/', query: { 'id': id, 'name': name, 'name__iexact': nameIexact, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'slug': slug, 'sort': sort, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve desired skills for a user. * @returns DesiredSkill * @throws ApiError */ public static catalogSkillsDesiredRetrieve({ userId, username, }: { /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/skills/desired/', query: { 'user_id': userId, 'username': username, }, }); } /** * Add or update desired skills for a user. * @returns DesiredSkill * @throws ApiError */ public static catalogSkillsDesiredCreate({ requestBody, userId, username, }: { requestBody: DesiredSkillCreateUpdateRequest, /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/skills/desired/', query: { 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * Add or update a skill. * @returns Skill * @throws ApiError */ public static catalogSkillsPublicCreate({ requestBody, }: { requestBody: SkillCreateUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/skills/public/', body: requestBody, mediaType: 'application/json', }); } /** * Retrieve reported skills for a user. * @returns ReportedSkill * @throws ApiError */ public static catalogSkillsReportedRetrieve({ userId, username, }: { /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/skills/reported/', query: { 'user_id': userId, 'username': username, }, }); } /** * Add or update reported skills for a user. * @returns ReportedSkill * @throws ApiError */ public static catalogSkillsReportedCreate({ requestBody, userId, username, }: { requestBody: ReportedSkillCreateUpdateRequest, /** * User ID */ userId?: number, /** * Username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/skills/reported/', query: { 'user_id': userId, 'username': username, }, body: requestBody, mediaType: 'application/json', }); } /** * API View for managing course suggestions. * * This endpoint allows administrators to view, create, update, and delete course suggestions * for users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter suggestions * sort (str, optional): Field to sort results by (default: '-id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of course suggestions for a platform * POST: Create or update a course suggestion * DELETE: Remove a course suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the suggestion * - course_id (str, required): The course ID to suggest * - user_id (str/int, required): The user to suggest the course to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the suggestion to delete * * Returns: * GET: A paginated JSON response containing course suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/course/manage/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming" * }, * ... * ] * } * * POST: A JSON response containing the created/updated suggestion: * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage suggestions for their platform * - Department admins can manage suggestions for their departments * - DM admins can manage all suggestions * @returns PaginatedCourseSuggestion * @throws ApiError */ public static catalogSuggestionsCourseManageRetrieve({ platformKey, departmentMode, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/course/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing course suggestions. * * This endpoint allows administrators to view, create, update, and delete course suggestions * for users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter suggestions * sort (str, optional): Field to sort results by (default: '-id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of course suggestions for a platform * POST: Create or update a course suggestion * DELETE: Remove a course suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the suggestion * - course_id (str, required): The course ID to suggest * - user_id (str/int, required): The user to suggest the course to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the suggestion to delete * * Returns: * GET: A paginated JSON response containing course suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/course/manage/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming" * }, * ... * ] * } * * POST: A JSON response containing the created/updated suggestion: * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage suggestions for their platform * - Department admins can manage suggestions for their departments * - DM admins can manage all suggestions * @returns CourseSuggestionDetail * @throws ApiError */ public static catalogSuggestionsCourseManageCreate({ platformKey, requestBody, departmentMode, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, requestBody: CourseSuggestionCreate, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/course/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * Delete single suggestion * @returns any Success - suggestion deleted * @throws ApiError */ public static catalogSuggestionsCourseManageDestroy({ platformKey, suggestionId, departmentMode = false, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, /** * The ID of the suggestion to delete */ suggestionId: number, /** * Flag to ensure department admins can call the API */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/suggestions/course/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, 'suggestion_id': suggestionId, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 404: `Not found - suggestion does not exist`, 500: `Internal server error`, }, }); } /** * API View for bulk management of course suggestions. * * This endpoint allows administrators to create multiple course suggestions at once. * * Methods: * POST: Create multiple course suggestions in bulk * * Request Body: * A JSON object containing: * - platform_key (str, required): The platform for the suggestions * - suggestion_data (list, required): List of suggestion objects, each containing: * - course_id (str, required): The course ID to suggest * - user_id (str/int, required): The user to suggest the course to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Returns: * POST: A JSON response containing the operation results: * { * "successes": 15, * "error_codes": [] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs during bulk creation * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can create suggestions for their platform * - Department admins can create suggestions for their departments * - DM admins can create suggestions for any platform * @returns BulkSuggestionResponse * @throws ApiError */ public static catalogSuggestionsCourseManageBulkCreate({ requestBody, }: { requestBody: CourseSuggestionBulkCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/course/manage/bulk/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing course group suggestions. * * This endpoint allows administrators to view, create, and delete course suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of course group suggestions for a platform * POST: Create or update a course group suggestion * DELETE: Remove a course group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - course_id (str, required): The course ID to suggest * - group_id (str/int, required): The group to suggest the course to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing course group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/course/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns PaginatedCourseGroupSuggestion * @throws ApiError */ public static catalogSuggestionsCourseManageGroupRetrieve({ platformKey, departmentMode, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/course/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing course group suggestions. * * This endpoint allows administrators to view, create, and delete course suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of course group suggestions for a platform * POST: Create or update a course group suggestion * DELETE: Remove a course group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - course_id (str, required): The course ID to suggest * - group_id (str/int, required): The group to suggest the course to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing course group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/course/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns CourseGroupSuggestionDetail * @throws ApiError */ public static catalogSuggestionsCourseManageGroupCreate({ platformKey, requestBody, departmentMode, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, requestBody: CourseGroupSuggestionCreate, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/course/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing course group suggestions. * * This endpoint allows administrators to view, create, and delete course suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of course group suggestions for a platform * POST: Create or update a course group suggestion * DELETE: Remove a course group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - course_id (str, required): The course ID to suggest * - group_id (str/int, required): The group to suggest the course to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing course group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/course/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns any Success - group suggestion deleted * @throws ApiError */ public static catalogSuggestionsCourseManageGroupDestroy({ platformKey, suggestionId, departmentMode = false, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, /** * The ID of the group suggestion to delete */ suggestionId: number, /** * Flag to ensure department admins can call the API */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/suggestions/course/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, 'suggestion_id': suggestionId, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 404: `Not found - group suggestion does not exist`, 500: `Internal server error`, }, }); } /** * API View for retrieving course suggestions for a specific user. * * This endpoint allows users to view course suggestions that have been made for them, * with support for filtering by platform and pagination. * * Query Parameters: * user (str, required): Username or user ID to retrieve suggestions for * platform_key (str, optional): Filter suggestions by platform key * platform_org (str, optional): Filter suggestions by platform organization * sort (str, optional): Field to sort results by (default: '-id') * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of course suggestions for a user * * Returns: * GET: A paginated JSON response containing course suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/course/user/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "course_id": "course-v1:org+course+run", * "course_name": "Introduction to Programming" * }, * ... * ] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion retrieval fails * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsEdxUserReadOnly permission * - Users can view their own suggestions * - Platform admins can view suggestions for users in their platform (read-only) * - DM admins can view all suggestions * @returns PaginatedCourseSuggestion * @throws ApiError */ public static catalogSuggestionsCourseUserRetrieve({ user, email, page, pageSize, platformKey, platformOrg, sort = '-id', userId, }: { /** * Username or user ID to retrieve suggestions for */ user: string, /** * Email to retrieve suggestions for */ email?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Filter suggestions by platform key */ platformKey?: string, /** * Filter suggestions by platform organization */ platformOrg?: string, /** * Field to sort results by */ sort?: string, /** * User ID to retrieve suggestions for */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/course/user/', query: { 'email': email, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'user': user, 'user_id': userId, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing pathway suggestions. * * This endpoint allows administrators to view, create, update, and delete pathway suggestions * for users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter suggestions * sort (str, optional): Field to sort results by (default: '-id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of pathway suggestions for a platform * POST: Create or update a pathway suggestion * DELETE: Remove a pathway suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the suggestion * - pathway_id (str, required): The pathway ID to suggest * - user_id (str/int, required): The user to suggest the pathway to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the suggestion to delete * * Returns: * GET: A paginated JSON response containing pathway suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/pathway/manage/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1" * }, * ... * ] * } * * POST: A JSON response containing the created/updated suggestion: * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage suggestions for their platform * - Department admins can manage suggestions for their departments * - DM admins can manage all suggestions * @returns PaginatedPathwaySuggestion * @throws ApiError */ public static catalogSuggestionsPathwayManageRetrieve({ platformKey, departmentMode, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/pathway/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing pathway suggestions. * * This endpoint allows administrators to view, create, update, and delete pathway suggestions * for users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter suggestions * sort (str, optional): Field to sort results by (default: '-id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of pathway suggestions for a platform * POST: Create or update a pathway suggestion * DELETE: Remove a pathway suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the suggestion * - pathway_id (str, required): The pathway ID to suggest * - user_id (str/int, required): The user to suggest the pathway to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the suggestion to delete * * Returns: * GET: A paginated JSON response containing pathway suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/pathway/manage/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1" * }, * ... * ] * } * * POST: A JSON response containing the created/updated suggestion: * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage suggestions for their platform * - Department admins can manage suggestions for their departments * - DM admins can manage all suggestions * @returns PathwaySuggestionDetail * @throws ApiError */ public static catalogSuggestionsPathwayManageCreate({ platformKey, requestBody, departmentMode, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, requestBody: PathwaySuggestionCreate, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/pathway/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * Delete single suggestion * @returns any Success - suggestion deleted * @throws ApiError */ public static catalogSuggestionsPathwayManageDestroy({ platformKey, suggestionId, departmentMode = false, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, /** * The ID of the suggestion to delete */ suggestionId: number, /** * Flag to ensure department admins can call the API */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/suggestions/pathway/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, 'suggestion_id': suggestionId, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 404: `Not found - suggestion does not exist`, 500: `Internal server error`, }, }); } /** * API View for bulk creation of pathway suggestions. * * This endpoint allows administrators to create multiple pathway suggestions at once. * * Methods: * POST: Create multiple pathway suggestions in a single request * * Request Body: * A JSON object containing: * - platform_key (str, required): The platform for the suggestions * - suggestion_data (list, required): List of suggestion objects, each containing: * - pathway_id (str, required): The pathway ID to suggest * - user_id (str/int, required): The user to suggest the pathway to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Returns: * POST: A JSON response containing the operation results: * { * "successes": 15, * "error_codes": [] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs during bulk creation * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can create suggestions for their platform * - Department admins can create suggestions for their departments * - DM admins can create suggestions for any platform * @returns BulkSuggestionResponse * @throws ApiError */ public static catalogSuggestionsPathwayManageBulkCreate({ requestBody, }: { requestBody: PathwaySuggestionBulkCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/pathway/manage/bulk/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing pathway group suggestions. * * This endpoint allows administrators to view, create, and delete pathway suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of pathway group suggestions for a platform * POST: Create or update a pathway group suggestion * DELETE: Remove a pathway group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - pathway_id (str, required): The pathway ID to suggest * - group_id (str/int, required): The group to suggest the pathway to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing pathway group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/pathway/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns PaginatedPathwayGroupSuggestion * @throws ApiError */ public static catalogSuggestionsPathwayManageGroupRetrieve({ platformKey, departmentMode, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/pathway/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing pathway group suggestions. * * This endpoint allows administrators to view, create, and delete pathway suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of pathway group suggestions for a platform * POST: Create or update a pathway group suggestion * DELETE: Remove a pathway group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - pathway_id (str, required): The pathway ID to suggest * - group_id (str/int, required): The group to suggest the pathway to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing pathway group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/pathway/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns PathwayGroupSuggestionDetail * @throws ApiError */ public static catalogSuggestionsPathwayManageGroupCreate({ platformKey, requestBody, departmentMode, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, requestBody: PathwayGroupSuggestionCreate, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/pathway/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing pathway group suggestions. * * This endpoint allows administrators to view, create, and delete pathway suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of pathway group suggestions for a platform * POST: Create or update a pathway group suggestion * DELETE: Remove a pathway group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - pathway_id (str, required): The pathway ID to suggest * - group_id (str/int, required): The group to suggest the pathway to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing pathway group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/pathway/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns any Success - group suggestion deleted * @throws ApiError */ public static catalogSuggestionsPathwayManageGroupDestroy({ platformKey, suggestionId, departmentMode = false, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, /** * The ID of the group suggestion to delete */ suggestionId: number, /** * Flag to ensure department admins can call the API */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/suggestions/pathway/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, 'suggestion_id': suggestionId, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 404: `Not found - group suggestion does not exist`, 500: `Internal server error`, }, }); } /** * API View for retrieving pathway suggestions for a specific user. * * This endpoint allows users to view pathway suggestions that have been made for them, * with support for filtering by platform and pagination. * * Query Parameters: * user (str, required): Username or user ID to retrieve suggestions for * platform_key (str, optional): Filter suggestions by platform key * platform_org (str, optional): Filter suggestions by platform organization * sort (str, optional): Field to sort results by (default: '-id') * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of pathway suggestions for a user * * Returns: * GET: A paginated JSON response containing pathway suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/pathway/user/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "pathway_id": "pathway-v1:org+pathway+run", * "pathway_uuid": "12345678-1234-5678-1234-567812345678", * "pathway_name": "Data Science Pathway", * "pathway_platform_key": "platform1" * }, * ... * ] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion retrieval fails * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsEdxUserReadOnly permission * - Users can view their own suggestions * - Platform admins can view suggestions for users in their platform (read-only) * - DM admins can view all suggestions * @returns PaginatedPathwaySuggestion * @throws ApiError */ public static catalogSuggestionsPathwayUserRetrieve({ username, email, page, pageSize, platformKey, platformOrg, sort = '-id', userId, }: { /** * Username or user ID to retrieve suggestions for */ username: string, /** * Email to retrieve suggestions for */ email?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Filter suggestions by platform key */ platformKey?: string, /** * Filter suggestions by platform organization */ platformOrg?: string, /** * Field to sort results by */ sort?: string, /** * User ID to retrieve suggestions for */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/pathway/user/', query: { 'email': email, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'user_id': userId, 'username': username, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing program suggestions. * * This endpoint allows administrators to view, create, update, and delete program suggestions * for users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter suggestions * sort (str, optional): Field to sort results by (default: '-id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of program suggestions for a platform * POST: Create or update a program suggestion * DELETE: Remove a program suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the suggestion * - program_key (str, required): The program key to suggest * - user_id (str/int, required): The user to suggest the program to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the suggestion to delete * * Returns: * GET: A paginated JSON response containing program suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/program/manage/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program" * }, * ... * ] * } * * POST: A JSON response containing the created/updated suggestion: * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage suggestions for their platform * - Department admins can manage suggestions for their departments * - DM admins can manage all suggestions * @returns PaginatedProgramSuggestion * @throws ApiError */ public static catalogSuggestionsProgramManageRetrieve({ platformKey, departmentMode, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/program/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing program suggestions. * * This endpoint allows administrators to view, create, update, and delete program suggestions * for users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter suggestions * sort (str, optional): Field to sort results by (default: '-id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of program suggestions for a platform * POST: Create or update a program suggestion * DELETE: Remove a program suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the suggestion * - program_key (str, required): The program key to suggest * - user_id (str/int, required): The user to suggest the program to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the suggestion to delete * * Returns: * GET: A paginated JSON response containing program suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/program/manage/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program" * }, * ... * ] * } * * POST: A JSON response containing the created/updated suggestion: * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage suggestions for their platform * - Department admins can manage suggestions for their departments * - DM admins can manage all suggestions * @returns ProgramSuggestionDetail * @throws ApiError */ public static catalogSuggestionsProgramManageCreate({ platformKey, requestBody, departmentMode, page, pageSize, platformOrg, query, sort = '-id', }: { /** * The platform to retrieve suggestions for */ platformKey: string, requestBody: ProgramSuggestionCreate, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/program/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing program suggestions. * * This endpoint allows administrators to view, create, update, and delete program suggestions * for users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter suggestions * sort (str, optional): Field to sort results by (default: '-id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of program suggestions for a platform * POST: Create or update a program suggestion * DELETE: Remove a program suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the suggestion * - program_key (str, required): The program key to suggest * - user_id (str/int, required): The user to suggest the program to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the suggestion to delete * * Returns: * GET: A paginated JSON response containing program suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/program/manage/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program" * }, * ... * ] * } * * POST: A JSON response containing the created/updated suggestion: * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program" * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage suggestions for their platform * - Department admins can manage suggestions for their departments * - DM admins can manage all suggestions * @returns any Success - suggestion deleted * @throws ApiError */ public static catalogSuggestionsProgramManageDestroy({ suggestionId, departmentMode, page, pageSize, platformKey, platformOrg, query, sort = '-id', }: { /** * The ID of the suggestion to delete */ suggestionId: number, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The platform to delete the suggestion from */ platformKey?: string, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/suggestions/program/manage/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, 'suggestion_id': suggestionId, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 404: `Not found - suggestion does not exist`, 500: `Internal server error`, }, }); } /** * API View for bulk creation of program suggestions. * * This endpoint allows administrators to create multiple program suggestions at once. * * Methods: * POST: Create multiple program suggestions in bulk * * Request Body: * A JSON object containing: * - platform_key (str, required): The platform for the suggestions * - suggestion_data (array, required): Array of suggestion objects with: * - program_key (str, required): The program key to suggest * - user_id (str/int, required): The user to suggest the program to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Returns: * POST: A JSON response containing the results of the bulk operation: * { * "successes": 15, * "error_codes": [] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to create suggestions * 500 Internal Server Error: If an unexpected error occurs during bulk creation * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can create suggestions for their platform * - Department admins can create suggestions for their departments * - DM admins can create suggestions for all platforms * @returns BulkSuggestionResponse * @throws ApiError */ public static catalogSuggestionsProgramManageBulkCreate({ requestBody, }: { requestBody: ProgramSuggestionBulkCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/program/manage/bulk/', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing program group suggestions. * * This endpoint allows administrators to view, create, and delete program suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of program group suggestions for a platform * POST: Create or update a program group suggestion * DELETE: Remove a program group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - program_key (str, required): The program key to suggest * - group_id (str/int, required): The group to suggest the program to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing program group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/program/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns PaginatedProgramGroupSuggestion * @throws ApiError */ public static catalogSuggestionsProgramManageGroupRetrieve({ platformKey, departmentMode, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/program/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing program group suggestions. * * This endpoint allows administrators to view, create, and delete program suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of program group suggestions for a platform * POST: Create or update a program group suggestion * DELETE: Remove a program group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - program_key (str, required): The program key to suggest * - group_id (str/int, required): The group to suggest the program to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing program group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/program/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns ProgramGroupSuggestionDetail * @throws ApiError */ public static catalogSuggestionsProgramManageGroupCreate({ platformKey, requestBody, departmentMode, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, requestBody: ProgramGroupSuggestionCreate, /** * Filter suggestions by department admin access */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/catalog/suggestions/program/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } /** * API View for managing program group suggestions. * * This endpoint allows administrators to view, create, and delete program suggestions * for groups of users within a platform. * * Query Parameters (GET): * platform_key (str, required): The platform to retrieve group suggestions for * platform_org (str, optional): The organization identifier for the platform * query (str, optional): Search term to filter group suggestions * sort (str, optional): Field to sort results by (default: 'id') * department_mode (bool, optional): Filter suggestions by department admin access * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of program group suggestions for a platform * POST: Create or update a program group suggestion * DELETE: Remove a program group suggestion * * Request Body (POST): * A JSON object containing: * - platform_key (str, required): The platform for the group suggestion * - program_key (str, required): The program key to suggest * - group_id (str/int, required): The group to suggest the program to * - accepted (bool, optional): Whether the suggestion is accepted * - visible (bool, optional): Whether the suggestion is visible * - metadata (dict, optional): Additional suggestion metadata * * Query Parameters (DELETE): * suggestion_id (int, required): The ID of the group suggestion to delete * * Returns: * GET: A paginated JSON response containing program group suggestions: * { * "count": 5, * "next": "https://example.com/api/catalog/suggestions/program/group/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program", * "user_count": 25 * }, * ... * ] * } * * POST: A JSON response containing the created/updated group suggestion: * { * "id": 123, * "group_id": 789, * "group_name": "Engineering Team", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program", * "user_count": 25 * } * * DELETE: A success response with status 200 * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to manage group suggestions * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission * - Platform admins can manage group suggestions for their platform * - Department admins can manage group suggestions for their departments * - DM admins can manage all group suggestions * @returns any Success - group suggestion deleted * @throws ApiError */ public static catalogSuggestionsProgramManageGroupDestroy({ platformKey, suggestionId, departmentMode = false, page, pageSize, platformOrg, query, sort = 'id', }: { /** * The platform to retrieve group suggestions for */ platformKey: string, /** * The ID of the group suggestion to delete */ suggestionId: number, /** * Flag to ensure department admins can call the API */ departmentMode?: boolean, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * The organization identifier for the platform */ platformOrg?: string, /** * Search term to filter group suggestions */ query?: string, /** * Field to sort results by */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/catalog/suggestions/program/manage/group/', query: { 'department_mode': departmentMode, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'query': query, 'sort': sort, 'suggestion_id': suggestionId, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 404: `Not found - group suggestion does not exist`, 500: `Internal server error`, }, }); } /** * API View for retrieving program suggestions for a specific user. * * This endpoint allows users to view program suggestions that have been made for them, * with support for filtering by platform and pagination. * * Query Parameters: * user (str, required): Username or user ID to retrieve suggestions for * platform_key (str, optional): Filter suggestions by platform key * platform_org (str, optional): Filter suggestions by platform organization * sort (str, optional): Field to sort results by (default: '-id') * page (int, optional): Page number for pagination * page_size (int, optional): Number of items per page * * Methods: * GET: Retrieve a paginated list of program suggestions for a user * * Returns: * GET: A paginated JSON response containing program suggestions: * { * "count": 10, * "next": "https://example.com/api/catalog/suggestions/program/user/?page=2", * "previous": null, * "results": [ * { * "id": 123, * "user_id": 456, * "username": "student1", * "name": "Student Name", * "platform_key": "platform1", * "accepted": false, * "visible": true, * "created": "2023-06-15T14:30:00Z", * "modified": "2023-06-15T14:30:00Z", * "metadata": {}, * "program_key": "program-v1:org+program+run", * "program_name": "Data Science Program" * }, * ... * ] * } * * Error Responses: * 400 Bad Request: If required parameters are missing or invalid, or if suggestion retrieval fails * 401 Unauthorized: If the user is not authenticated * 403 Forbidden: If the user does not have permission to access this resource * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsEdxUserReadOnly permission * - Users can view their own suggestions * - Platform admins can view suggestions for users in their platform (read-only) * - DM admins can view all suggestions * @returns PaginatedProgramSuggestion * @throws ApiError */ public static catalogSuggestionsProgramUserRetrieve({ username, email, page, pageSize, platformKey, platformOrg, sort = '-id', userId, }: { /** * Username or user ID to retrieve suggestions for */ username: string, /** * Email to retrieve suggestions for */ email?: string, /** * Page number for pagination */ page?: number, /** * Number of items per page */ pageSize?: number, /** * Filter suggestions by platform key */ platformKey?: string, /** * Filter suggestions by platform organization */ platformOrg?: string, /** * Field to sort results by */ sort?: string, /** * User ID to retrieve suggestions for */ userId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/catalog/suggestions/program/user/', query: { 'email': email, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'platform_org': platformOrg, 'sort': sort, 'user_id': userId, 'username': username, }, errors: { 400: `Bad request - required parameters missing or invalid`, 401: `Unauthorized - authentication required`, 403: `Forbidden - insufficient permissions`, 500: `Internal server error`, }, }); } }