diff --git a/RELEASE.rst b/RELEASE.rst index de6b04f579..31be702767 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -1,6 +1,14 @@ Release Notes ============= +Version 1.149.0 +--------------- + +- Define typed serializers for course outline response (#3525) +- feat: enhance certificate admin (#3502) +- Add pytest.mark.django_db to image test (#3523) +- Fixes 500 errors when viewing an Organization in the Django Admin (#3519) + Version 1.147.6 (Released April 27, 2026) --------------- diff --git a/b2b/admin.py b/b2b/admin.py index a7a548d297..4a6a36762e 100644 --- a/b2b/admin.py +++ b/b2b/admin.py @@ -20,11 +20,47 @@ class UserOrganizationAdminInline(admin.TabularInline): model = UserOrganization extra = 0 verbose_name = "Organization Admin" + list_display = [ + "user_email", + "keep_until_seen", + "is_manager", + ] + readonly_fields = [ + "user_email", + "keep_until_seen", + "is_manager", + ] def get_queryset(self, request): """Filter the queryset to just users with Manager access.""" - return super().get_queryset(request).filter(is_manager=True) + return ( + super() + .get_queryset(request) + .prefetch_related("user") + .filter(is_manager=True) + ) + + def has_add_permission(self, request, obj): # noqa: ARG002 + """Determine if the user can add new ones from here (no, they cannot)""" + + return False + + def has_change_permission(self, request, obj=None): # noqa: ARG002 + """Determine if the user can add new ones from here (no, they cannot)""" + + return False + + def has_delete_permission(self, request, obj=None): # noqa: ARG002 + """Determine if the user can add new ones from here (no, they cannot)""" + + return False + + @admin.display(description="User Email") + def user_email(self, obj): + """Return the user's email address.""" + + return obj.user.email class ReadOnlyModelAdmin(admin.ModelAdmin): diff --git a/cms/api_test.py b/cms/api_test.py index 7217341e9b..8035e2f46c 100644 --- a/cms/api_test.py +++ b/cms/api_test.py @@ -90,6 +90,7 @@ def test_ensure_home_page_and_site(): assert home_page_qset.count() == 1 +@pytest.mark.django_db def test_get_wagtail_img_src(settings): """get_wagtail_img_src should return the correct image URL""" settings.MEDIA_URL = "/mediatest/" diff --git a/courses/admin.py b/courses/admin.py index 039d843393..ad2b44753f 100644 --- a/courses/admin.py +++ b/courses/admin.py @@ -598,6 +598,25 @@ def get_order_state(self, obj): return obj.order.state +class HasCertificateRevisionFilter(admin.SimpleListFilter): + title = "Has Certificate Revision" + parameter_name = "has_certificate_revision" + + def lookups(self, request, model_admin): # noqa: ARG002 + return ( + ("yes", "Yes"), + ("no", "No"), + ) + + def queryset(self, request, queryset): # noqa: ARG002 + value = self.value() + if value == "yes": + return queryset.filter(certificate_page_revision__isnull=False) + if value == "no": + return queryset.filter(certificate_page_revision__isnull=True) + return queryset + + @admin.register(CourseRunCertificate) class CourseRunCertificateAdmin(TimestampedModelAdmin): """Admin for CourseRunCertificate""" @@ -610,14 +629,16 @@ class CourseRunCertificateAdmin(TimestampedModelAdmin): "course_run", "get_certificate_page_title", "get_revoked_state", + "get_has_certificate_revision", ] search_fields = [ + "uuid", "course_run__courseware_id", "course_run__title", "user__username", "user__email", ] - list_filter = ["is_revoked", "course_run__course"] + list_filter = ["is_revoked", HasCertificateRevisionFilter, "course_run__course"] raw_id_fields = ("user", "course_run", "verifiable_credential") autocomplete_fields = ("certificate_page_revision",) @@ -648,6 +669,14 @@ def get_revoked_state(self, obj): """Return the revoked state""" return obj.is_revoked is not True + @admin.display( + description="Has Certificate Revision", + boolean=True, + ) + def get_has_certificate_revision(self, obj): + """Return whether a certificate page revision is associated""" + return obj.certificate_page_revision is not None + def get_queryset(self, request): # noqa: ARG002 return self.model.all_objects.get_queryset().select_related( "user", "course_run" @@ -665,15 +694,18 @@ class ProgramCertificateAdmin(TimestampedModelAdmin): "user", "program", "get_revoked_state", + "get_has_certificate_revision", ] search_fields = [ "program__readable_id", "program__title", "user__username", "user__email", + "uuid", ] - list_filter = ["program__title", "is_revoked"] - raw_id_fields = ("user", "verifiable_credential") + list_filter = ["program__title", HasCertificateRevisionFilter, "is_revoked"] + raw_id_fields = ("user", "verifiable_credential", "program") + autocomplete_fields = ("certificate_page_revision",) @admin.display( description="Active", @@ -683,6 +715,14 @@ def get_revoked_state(self, obj): """Return the revoked state""" return obj.is_revoked is not True + @admin.display( + description="Has Certificate Revision", + boolean=True, + ) + def get_has_certificate_revision(self, obj): + """Return whether a certificate page revision is associated""" + return obj.certificate_page_revision is not None + def get_queryset(self, request): # noqa: ARG002 return self.model.all_objects.get_queryset().select_related("user", "program") diff --git a/courses/serializers/v3/courses.py b/courses/serializers/v3/courses.py index 6ac6e76c98..9f9dd2e28d 100644 --- a/courses/serializers/v3/courses.py +++ b/courses/serializers/v3/courses.py @@ -135,3 +135,34 @@ class Meta(BaseCourseRunEnrollmentSerializer.Meta): "b2b_contract_id", "certificate", ] + + +@extend_schema_serializer(component_name="CourseOutlineModuleCounts") +class CourseOutlineModuleCountsSerializer(serializers.Serializer): + """Activity counts within a course outline module.""" + + videos = serializers.IntegerField() + readings = serializers.IntegerField() + problems = serializers.IntegerField() + assignments = serializers.IntegerField() + app_items = serializers.IntegerField() + + +@extend_schema_serializer(component_name="CourseOutlineModule") +class CourseOutlineModuleSerializer(serializers.Serializer): + """A single module within a course outline.""" + + id = serializers.CharField() + title = serializers.CharField() + effort_time = serializers.IntegerField() + effort_activities = serializers.IntegerField() + counts = CourseOutlineModuleCountsSerializer() + + +@extend_schema_serializer(component_name="CourseOutlineResponse") +class CourseOutlineResponseSerializer(serializers.Serializer): + """Course outline data fetched from Open edX.""" + + course_id = serializers.CharField() + generated_at = serializers.DateTimeField() + modules = CourseOutlineModuleSerializer(many=True) diff --git a/courses/views/v3/__init__.py b/courses/views/v3/__init__.py index 1016a9e239..37760744f7 100644 --- a/courses/views/v3/__init__.py +++ b/courses/views/v3/__init__.py @@ -34,7 +34,10 @@ Program, ProgramEnrollment, ) -from courses.serializers.v3.courses import CourseRunEnrollmentSerializer +from courses.serializers.v3.courses import ( + CourseOutlineResponseSerializer, + CourseRunEnrollmentSerializer, +) from courses.serializers.v3.programs import ( ProgramEnrollmentCreateSerializer, ProgramEnrollmentSerializer, @@ -274,14 +277,7 @@ def destroy(self, request, *args, **kwargs): # noqa: ARG002 ) ], responses={ - 200: inline_serializer( - name="CourseOutlineResponse", - fields={ - "course_id": serializers.CharField(), - "generated_at": serializers.CharField(), - "modules": serializers.ListField(child=serializers.DictField()), - }, - ), + 200: CourseOutlineResponseSerializer, 400: inline_serializer( name="CourseOutlineBadRequestResponse", fields={"detail": serializers.CharField()}, diff --git a/main/settings.py b/main/settings.py index 79c1c544d1..7d84529321 100644 --- a/main/settings.py +++ b/main/settings.py @@ -37,7 +37,7 @@ from main.sentry import init_sentry from openapi.settings_spectacular import open_spectacular_settings -VERSION = "1.147.6" +VERSION = "1.149.0" log = logging.getLogger() diff --git a/openapi/specs/v0.yaml b/openapi/specs/v0.yaml index abc0060756..bb5da2d508 100644 --- a/openapi/specs/v0.yaml +++ b/openapi/specs/v0.yaml @@ -4091,18 +4091,59 @@ components: type: string required: - detail + CourseOutlineModule: + type: object + description: A single module within a course outline. + properties: + id: + type: string + title: + type: string + effort_time: + type: integer + effort_activities: + type: integer + counts: + $ref: '#/components/schemas/CourseOutlineModuleCounts' + required: + - counts + - effort_activities + - effort_time + - id + - title + CourseOutlineModuleCounts: + type: object + description: Activity counts within a course outline module. + properties: + videos: + type: integer + readings: + type: integer + problems: + type: integer + assignments: + type: integer + app_items: + type: integer + required: + - app_items + - assignments + - problems + - readings + - videos CourseOutlineResponse: type: object + description: Course outline data fetched from Open edX. properties: course_id: type: string generated_at: type: string + format: date-time modules: type: array items: - type: object - additionalProperties: {} + $ref: '#/components/schemas/CourseOutlineModule' required: - course_id - generated_at diff --git a/openapi/specs/v1.yaml b/openapi/specs/v1.yaml index bbdff327b9..26a8a5a872 100644 --- a/openapi/specs/v1.yaml +++ b/openapi/specs/v1.yaml @@ -4091,18 +4091,59 @@ components: type: string required: - detail + CourseOutlineModule: + type: object + description: A single module within a course outline. + properties: + id: + type: string + title: + type: string + effort_time: + type: integer + effort_activities: + type: integer + counts: + $ref: '#/components/schemas/CourseOutlineModuleCounts' + required: + - counts + - effort_activities + - effort_time + - id + - title + CourseOutlineModuleCounts: + type: object + description: Activity counts within a course outline module. + properties: + videos: + type: integer + readings: + type: integer + problems: + type: integer + assignments: + type: integer + app_items: + type: integer + required: + - app_items + - assignments + - problems + - readings + - videos CourseOutlineResponse: type: object + description: Course outline data fetched from Open edX. properties: course_id: type: string generated_at: type: string + format: date-time modules: type: array items: - type: object - additionalProperties: {} + $ref: '#/components/schemas/CourseOutlineModule' required: - course_id - generated_at diff --git a/openapi/specs/v2.yaml b/openapi/specs/v2.yaml index 39362f5332..a2694e2379 100644 --- a/openapi/specs/v2.yaml +++ b/openapi/specs/v2.yaml @@ -4091,18 +4091,59 @@ components: type: string required: - detail + CourseOutlineModule: + type: object + description: A single module within a course outline. + properties: + id: + type: string + title: + type: string + effort_time: + type: integer + effort_activities: + type: integer + counts: + $ref: '#/components/schemas/CourseOutlineModuleCounts' + required: + - counts + - effort_activities + - effort_time + - id + - title + CourseOutlineModuleCounts: + type: object + description: Activity counts within a course outline module. + properties: + videos: + type: integer + readings: + type: integer + problems: + type: integer + assignments: + type: integer + app_items: + type: integer + required: + - app_items + - assignments + - problems + - readings + - videos CourseOutlineResponse: type: object + description: Course outline data fetched from Open edX. properties: course_id: type: string generated_at: type: string + format: date-time modules: type: array items: - type: object - additionalProperties: {} + $ref: '#/components/schemas/CourseOutlineModule' required: - course_id - generated_at diff --git a/schema.yml b/schema.yml deleted file mode 100644 index 57844098cb..0000000000 --- a/schema.yml +++ /dev/null @@ -1,4947 +0,0 @@ -openapi: 3.0.3 -info: - title: MITx Online API - version: 0.0.1 - description: MIT public API -paths: - /api/records/program/{id}/: - get: - operationId: learner_record_retrieve_by_id - description: Get learner record using program ID - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/revoke/: - post: - operationId: api_records_program_revoke_create - description: |- - Disables sharing links for the learner's record. This only applies to the - anonymous ones; shares sent to partner schools are always allowed once they - are sent. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/share/: - post: - operationId: api_records_program_share_create - description: |- - Sets up a sharing link for the learner's record. Returns back the entire - learner record. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/shared/{uuid}/: - get: - operationId: learner_record_retrieve_by_uuid - description: Get learner record using share UUID - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/v0/b2b/attach/{enrollment_code}/: - post: - operationId: b2b_attach_create - description: |- - Use the provided enrollment code to attach the user to a B2B contract. - - This will not create an order, nor will it enroll the user. It will - attach the user to the contract and log that the code was used for this - purpose (but will _not_ invalidate the code, since we're not actually - using it at this point). - - This will respect the activation and expiration dates (of both the contract - and the discount), and will make sure there's sufficient available seats - in the contract. - - If the user is already in the contract, then we skip it. - - Returns: - - list of ContractPageSerializer - the contracts for the user - parameters: - - in: path - name: enrollment_code - schema: - type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/: - get: - operationId: b2b_contracts_list - description: Viewset for the ContractPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/{contract_slug}/: - get: - operationId: b2b_contracts_retrieve - description: Viewset for the ContractPage model. - parameters: - - in: path - name: contract_slug - schema: - type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/enroll/{readable_id}/: - post: - operationId: b2b_enroll_create - description: Create an enrollment for the given course run. - parameters: - - in: path - name: readable_id - schema: - type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CreateB2BEnrollment' - description: '' - /api/v0/b2b/organizations/: - get: - operationId: b2b_organizations_list - description: Viewset for the OrganizationPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/b2b/organizations/{organization_slug}/: - get: - operationId: b2b_organizations_retrieve - description: Viewset for the OrganizationPage model. - parameters: - - in: path - name: organization_slug - schema: - type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/change-emails/: - post: - operationId: change_emails_create - description: Viewset for creating and updating email change requests - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreate' - description: '' - /api/v0/change-emails/{code}/: - put: - operationId: change_emails_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - patch: - operationId: change_emails_partial_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - /api/v0/countries/: - get: - operationId: countries_list - description: Get generator for countries/states list - tags: - - countries - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Country' - description: '' - /api/v0/user_search/: - get: - operationId: user_search_list - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - name: l - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: o - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - name: search - required: false - in: query - description: A search term. - schema: - type: string - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedStaffDashboardUserList' - description: '' - /api/v0/user_search/{id}/: - get: - operationId: user_search_retrieve - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/StaffDashboardUser' - description: '' - /api/v0/userinfo/: - get: - operationId: userinfo_retrieve - description: |- - Retrieve the current user's info only if they have an edx_username, otherwise return 409 - - This is to prevent issues with Open edX OAuth client that expect an edx_username to be present - tags: - - userinfo - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/{id}/: - get: - operationId: users_retrieve - description: User retrieve viewsets - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PublicUser' - description: '' - /api/v0/users/current_user/: - get: - operationId: users_current_user_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_current_user_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/me: - get: - operationId: users_me_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_me_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v1/course_runs/: - get: - operationId: course_runs_list - description: API view set for CourseRuns - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/course_runs/{id}/: - get: - operationId: course_runs_retrieve - description: API view set for CourseRuns - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run. - required: true - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/courses/: - get: - operationId: api_v1_courses_list - description: List all courses - API v1 - parameters: - - in: query - name: courserun_is_enrollable - schema: - type: boolean - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1CourseWithCourseRunsList' - description: '' - /api/v1/courses/{id}/: - get: - operationId: api_v1_courses_retrieve - description: Retrieve a specific course - API v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - description: '' - /api/v1/departments/: - get: - operationId: departments_list_v1 - description: List departments - v1 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/departments/{id}/: - get: - operationId: departments_retrieve_v1 - description: Get department details - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/enrollments/: - get: - operationId: enrollments_list - description: API view set for user enrollments - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - post: - operationId: enrollments_create - description: API view set for user enrollments - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - /api/v1/enrollments/{id}/: - put: - operationId: enrollments_update - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - patch: - operationId: enrollments_partial_update - description: Update enrollment email preferences - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - delete: - operationId: enrollments_destroy - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v1/program_enrollments/: - get: - operationId: program_enrollments_list - description: |- - Returns a unified set of program and course enrollments for the current - user. - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/program_enrollments/{id}/: - get: - operationId: program_enrollments_retrieve - description: Retrieve a specific program enrollment. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - delete: - operationId: program_enrollments_destroy - description: |- - Unenroll the user from this program. This is simpler than the corresponding - function for CourseRunEnrollments; edX doesn't really know what programs - are so there's nothing to process there. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/programs/: - get: - operationId: programs_list_v1 - description: List Programs - v1 - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1ProgramList' - description: '' - /api/v1/programs/{id}/: - get: - operationId: programs_retrieve_v1 - description: API view set for Programs - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1Program' - description: '' - /api/v2/course_certificates/{cert_uuid}/: - get: - operationId: course_certificates_retrieve - description: Get a course certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - course_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2CourseRunCertificate' - description: '' - /api/v2/courses/: - get: - operationId: api_v2_courses_list - description: List all courses - API v2 - parameters: - - in: query - name: courserun_is_enrollable - schema: - type: boolean - description: Course Run Is Enrollable - - in: query - name: id - schema: - type: array - items: - type: integer - description: Multiple values may be separated by commas. - explode: false - style: form - - in: query - name: include_approved_financial_aid - schema: - type: boolean - description: Include approved financial assistance information - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - description: Only show courses belonging to this B2B/UAI organization - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCourseWithCourseRunsSerializerV2List' - description: '' - /api/v2/courses/{id}/: - get: - operationId: api_v2_courses_retrieve - description: Retrieve a specific course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - description: '' - /api/v2/departments/: - get: - operationId: departments_list_v2 - description: List departments - v2 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/departments/{id}/: - get: - operationId: departments_retrieve_v2 - description: Get department details - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/enrollments/: - get: - operationId: user_enrollments_list_v2 - description: List user enrollments with B2B organization and contract information - - API v2. Use ?exclude_b2b=true to filter out enrollments linked to course - runs with B2B contracts. Use ?org_id= to filter enrollments by specific - B2B organization. - parameters: - - in: query - name: exclude_b2b - schema: - type: boolean - description: Exclude B2B enrollments (enrollments linked to course runs with - B2B contracts) - - in: query - name: org_id - schema: - type: number - description: Filter by B2B organization ID - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - post: - operationId: user_enrollments_create_v2 - description: Create a new user enrollment - API v2 - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - /api/v2/enrollments/{id}/: - delete: - operationId: user_enrollments_destroy_v2 - description: Unenroll from a course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v2/pages/: - get: - operationId: pages_list - description: Returns pages of all types - summary: List all Wagtail Pages - parameters: - - in: query - name: fields - schema: - type: string - description: Specify fields (e.g. `*`) - - in: query - name: type - schema: - type: string - description: Filter by Wagtail page type - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PageList' - description: '' - /api/v2/pages/{id}/: - get: - operationId: pages_retrieve - description: Returns details of a specific Wagtail page by ID - summary: Get Wagtail Page Details - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the Wagtail page - required: true - - in: query - name: revision_id - schema: - type: integer - description: Optional certificate revision ID to retrieve a specific revision - of the certificate page - tags: - - pages - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/CoursePageItem' - - $ref: '#/components/schemas/ProgramPageItem' - - $ref: '#/components/schemas/CertificatePage' - - $ref: '#/components/schemas/Page' - description: Returns a page of any known Wagtail page type - /api/v2/pages/?fields=*&type=cms.certificatepage: - get: - operationId: pages_?fields=*&type=cms.certificatepage_retrieve - description: Returns pages of type cms.CertificatePage - summary: List all Certificate Pages - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CertificatePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.coursepage: - get: - operationId: pages_?fields=*&type=cms.coursepage_retrieve - description: Returns pages of type cms.CoursePage - summary: List all Course Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by course readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CoursePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.programpage: - get: - operationId: pages_?fields=*&type=cms.programpage_retrieve - description: Returns pages of type cms.ProgramPage - summary: List all Program Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by program readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProgramPageList' - description: '' - /api/v2/program-collections/: - get: - operationId: program_collections_list - description: Readonly viewset for ProgramCollection objects. - parameters: - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramCollectionList' - description: '' - /api/v2/program-collections/{id}/: - get: - operationId: program_collections_retrieve - description: Readonly viewset for ProgramCollection objects. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this Program Collection. - required: true - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCollection' - description: '' - /api/v2/program_certificates/{cert_uuid}/: - get: - operationId: program_certificates_retrieve - description: Get a program certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - program_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCertificate' - description: '' - /api/v2/programs/: - get: - operationId: programs_list_v2 - description: List Programs - v2 - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramList' - description: '' - /api/v2/programs/{id}/: - get: - operationId: programs_retrieve_v2 - description: API view set for Programs - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2Program' - description: '' - /enrollments/: - post: - operationId: api_enrollments_create - description: View to handle direct POST requests to enroll in a course run. - tags: - - enrollments - responses: - '200': - description: No response body - '302': - description: No response body -components: - schemas: - AvailabilityEnum: - enum: - - anytime - - dated - type: string - description: |- - * `anytime` - anytime - * `dated` - dated - x-enum-descriptions: - - anytime - - dated - BlankEnum: - enum: - - '' - CertificatePage: - type: object - description: Serializer for certificate pages, including overrides and signatory - items. - properties: - id: - type: integer - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - CertificatePageList: - type: object - description: Serializer for a list of certificate pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CertificatePage' - required: - - items - - meta - CertificatePageModel: - type: object - description: Extends the CertificatePageSerializer to work with a model object. - properties: - id: - type: integer - meta: - allOf: - - $ref: '#/components/schemas/PageMetaModel' - readOnly: true - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - ChangeEmailRequestCreate: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - required: - - new_email - ChangeEmailRequestCreateRequest: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - required: - - new_email - - password - ChangeEmailRequestUpdate: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - ChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - CompanySizeEnum: - enum: - - 1 - - 9 - - 99 - - 999 - - 9999 - - 10000 - - 0 - description: |- - * `None` - ---- - * `1` - Small/Start-up (1+ employees) - * `9` - Small/Home office (1-9 employees) - * `99` - Small (10-99 employees) - * `999` - Small to medium-sized (100-999 employees) - * `9999` - Medium-sized (1000-9999 employees) - * `10000` - Large Enterprise (10,000+ employees) - * `0` - Other (N/A or Don't know) - x-enum-descriptions: - - Small/Start-up (1+ employees) - - Small/Home office (1-9 employees) - - Small (10-99 employees) - - Small to medium-sized (100-999 employees) - - Medium-sized (1000-9999 employees) - - Large Enterprise (10,000+ employees) - - Other (N/A or Don't know) - ContractPage: - type: object - description: Serializer for the ContractPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the contract. - description: - type: string - readOnly: true - description: Any useful extra information about the contract. - integration_type: - allOf: - - $ref: '#/components/schemas/IntegrationTypeEnum' - readOnly: true - description: |- - The type of integration for this contract. - - * `sso` - SSO - * `non-sso` - Non-SSO - organization: - type: integer - readOnly: true - description: The organization this contract is with. - contract_start: - type: string - format: date - readOnly: true - nullable: true - description: The start date of the contract. - contract_end: - type: string - format: date - readOnly: true - nullable: true - description: The end date of the contract. - active: - type: boolean - readOnly: true - description: Whether this contract is active or not. Date rules still apply. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - required: - - active - - contract_end - - contract_start - - description - - id - - integration_type - - name - - organization - - slug - Country: - type: object - description: Serializer for pycountry countries, with states for US/CA - properties: - code: - type: string - description: Get the country alpha_2 code - readOnly: true - name: - type: string - description: Get the country name (common name preferred if available) - readOnly: true - states: - type: array - items: - type: object - additionalProperties: {} - description: Get a list of states/provinces if USA or Canada - readOnly: true - required: - - code - - name - - states - Course: - type: object - description: Course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' - nullable: true - readOnly: true - required: - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - CoursePage: - type: object - description: Course page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - description: - type: string - description: Get cleaned description text. - readOnly: true - live: - type: boolean - readOnly: true - length: - type: string - description: Get cleaned length text. - readOnly: true - effort: - type: string - nullable: true - description: Get cleaned effort text. - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - current_price: - type: integer - nullable: true - description: Get the current price of the course product. - readOnly: true - instructors: - type: array - items: {} - description: Get instructor information - readOnly: true - required: - - current_price - - description - - effort - - feature_image_src - - financial_assistance_form_url - - instructors - - length - - live - - page_url - CoursePageItem: - type: object - description: Serializer for individual course page items, including all relevant - fields. - properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - description: The page title as you'd like it to be seen by the public - maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: What you will learn from this course. - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: - type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. - maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePage' - nullable: true - course_details: - $ref: '#/components/schemas/V2Course' - topic_list: - type: array - items: - $ref: '#/components/schemas/Topic' - include_in_learn_catalog: - type: boolean - nullable: true - description: If true, Learn should include this in its catalog. - ingest_content_files_for_ai: - type: boolean - nullable: true - description: If true, allow the AI chatbots to ingest the course's content - files. - required: - - about - - certificate_page - - course_details - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - title - - topic_list - - video_url - - what_you_learn - CoursePageList: - type: object - description: Serializer for a list of course pages, including metadata and items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CoursePageItem' - required: - - items - - meta - CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - CourseRunCertificate: - type: object - description: CourseRunCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate// - Example: /certificate/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - CourseRunEnrollment: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V1CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - required: - - approved_flexible_price_exists - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequest: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunEnrollmentRequestV2: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V2CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - b2b_organization_id: - type: integer - nullable: true - readOnly: true - b2b_contract_id: - type: integer - nullable: true - readOnly: true - required: - - approved_flexible_price_exists - - b2b_contract_id - - b2b_organization_id - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequestV2Request: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunGrade: - type: object - description: CourseRunGrade serializer - properties: - grade: - type: number - format: double - maximum: 1.0 - minimum: 0.0 - letter_grade: - type: string - nullable: true - maxLength: 6 - passed: - type: boolean - set_by_admin: - type: boolean - grade_percent: - type: number - format: double - description: Returns the grade field value as a number out of 100 (or None - if the value is None) - readOnly: true - required: - - grade - - grade_percent - CourseRunV2: - type: object - description: CourseRun model serializer - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - CourseWithCourseRunsSerializerV2: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - type: array - items: - type: object - additionalProperties: {} - nullable: true - readOnly: true - topics: - type: array - items: - type: object - additionalProperties: {} - description: List topics of a course - readOnly: true - certificate_type: - type: string - readOnly: true - required_prerequisites: - type: boolean - description: |- - Check if the prerequisites field is populated in the course page CMS. - Returns: - bool: True when the prerequisites field is populated in the course page CMS. False otherwise. - readOnly: true - duration: - type: string - description: Get the duration of the course from the course page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the course from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the course from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the time commitment of the course from the course page - CMS. - readOnly: true - availability: - type: string - description: Get course availability - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - include_in_learn_catalog: - type: boolean - readOnly: true - ingest_content_files_for_ai: - type: boolean - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/CourseRunV2' - readOnly: true - required: - - availability - - certificate_type - - courseruns - - departments - - duration - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - next_run_id - - page - - programs - - readable_id - - required_prerequisites - - time_commitment - - title - - topics - CreateB2BEnrollment: - type: object - description: |- - Serializer for the result from create_b2b_enrollment. - - There's always a result, and it should be one of the B2B messages that are - defined in main.constants. The other fields appear or not depending on the - result type. - properties: - result: - allOf: - - $ref: '#/components/schemas/ResultEnum' - readOnly: true - order: - type: integer - readOnly: true - price: - type: string - format: decimal - readOnly: true - checkout_result: - $ref: '#/components/schemas/GenerateCheckoutPayload' - required: - - order - - price - - result - Department: - type: object - description: Department model serializer - properties: - name: - type: string - maxLength: 128 - required: - - name - DepartmentRequest: - type: object - description: Department model serializer - properties: - name: - type: string - minLength: 1 - maxLength: 128 - required: - - name - DepartmentWithCount: - type: object - description: CourseRun model serializer that includes the number of courses - and programs associated with each departments - properties: - name: - type: string - maxLength: 128 - courses: - type: integer - programs: - type: integer - required: - - courses - - name - - programs - DepartmentWithCoursesAndPrograms: - type: object - description: Department model serializer that includes the number of courses - and programs associated with each - properties: - id: - type: integer - readOnly: true - name: - type: string - maxLength: 128 - slug: - type: string - maxLength: 128 - pattern: ^[-a-zA-Z0-9_]+$ - course_ids: - type: array - items: {} - readOnly: true - program_ids: - type: array - items: {} - readOnly: true - required: - - course_ids - - id - - name - - program_ids - - slug - Discount: - type: object - properties: - id: - type: integer - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - is_redeemed: - type: boolean - description: Returns True if the discount has been redeemed - readOnly: true - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - id - - is_redeemed - - redemption_type - DiscountTypeEnum: - enum: - - percent-off - - dollars-off - - fixed-price - type: string - description: |- - * `percent-off` - percent-off - * `dollars-off` - dollars-off - * `fixed-price` - fixed-price - x-enum-descriptions: - - percent-off - - dollars-off - - fixed-price - EnrollmentModeEnum: - enum: - - audit - - verified - type: string - description: |- - * `audit` - audit - * `verified` - verified - x-enum-descriptions: - - audit - - verified - Faculty: - type: object - description: Serializer for faculty details used in course pages. - properties: - id: - type: integer - instructor_name: - type: string - instructor_title: - type: string - instructor_bio_short: - type: string - instructor_bio_long: - type: string - feature_image_src: - type: string - required: - - feature_image_src - - id - - instructor_bio_long - - instructor_bio_short - - instructor_name - - instructor_title - FeatureImage: - type: object - description: Serializer for feature images used in course pages. - properties: - title: - type: string - image_url: - type: string - format: uri - height: - type: integer - width: - type: integer - required: - - height - - image_url - - title - - width - GenderEnum: - enum: - - m - - f - - t - - nb - - o - type: string - description: |- - * `m` - Male - * `f` - Female - * `t` - Transgender - * `nb` - Non-binary/non-conforming - * `o` - Other/Prefer Not to Say - x-enum-descriptions: - - Male - - Female - - Transgender - - Non-binary/non-conforming - - Other/Prefer Not to Say - GenerateCheckoutPayload: - type: object - description: |- - Serializer for the result from ecommerce.api.generate_checkout_payload. - - The B2B enrollment API will return the result of the checkout call if the - user needs to pay for the cart because of an error creating the checkout - payload. In that case, we really just need the error states; it will also - include a HttpResponseRedirect that we don't really care about for the API's - purposes. - properties: - country_blocked: - type: boolean - nullable: true - default: false - purchased_same_courserun: - type: boolean - nullable: true - default: false - purchased_non_upgradeable_courserun: - type: boolean - nullable: true - default: false - invalid_discounts: - type: boolean - nullable: true - default: false - no_checkout: - type: boolean - nullable: true - default: false - HighestEducationEnum: - enum: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - description: |- - * `None` - ---- - * `Doctorate` - Doctorate - * `Master's or professional degree` - Master's or professional degree - * `Bachelor's degree` - Bachelor's degree - * `Associate degree` - Associate degree - * `Secondary/high school` - Secondary/high school - * `Junior secondary/junior high/middle school` - Junior secondary/junior high/middle school - * `Elementary/primary school` - Elementary/primary school - * `No formal education` - No formal education - * `Other education` - Other education - x-enum-descriptions: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - IntegrationTypeEnum: - enum: - - sso - - non-sso - type: string - description: |- - * `sso` - SSO - * `non-sso` - Non-SSO - x-enum-descriptions: - - SSO - - Non-SSO - LearnerProgramRecordShare: - type: object - properties: - share_uuid: - type: string - format: uuid - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - is_active: - type: boolean - user: - type: integer - program: - type: integer - partner_school: - type: integer - nullable: true - required: - - created_on - - program - - share_uuid - - updated_on - - user - LearnerRecord: - type: object - description: |- - Gathers the various data needed to display the learner's program record. - Pass the program you want the record for and attach the learner via context - object. - properties: - user: - type: object - additionalProperties: - type: string - description: User information including name, email, and username - program: - type: object - additionalProperties: - type: object - additionalProperties: {} - description: Program details including title, readable_id, courses, and - requirements - sharing: - type: array - items: - $ref: '#/components/schemas/LearnerProgramRecordShare' - description: Active program record shares for this user - partner_schools: - type: array - items: - $ref: '#/components/schemas/PartnerSchool' - description: List of partner schools - required: - - partner_schools - - program - - sharing - - user - LegalAddress: - type: object - description: Serializer for legal address - properties: - first_name: - type: string - maxLength: 60 - last_name: - type: string - maxLength: 60 - country: - type: string - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - LegalAddressRequest: - type: object - description: Serializer for legal address - properties: - first_name: - type: string - maxLength: 60 - last_name: - type: string - maxLength: 60 - country: - type: string - minLength: 1 - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - NullEnum: - enum: - - null - OrganizationPage: - type: object - description: Serializer for the OrganizationPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the organization - description: - type: string - readOnly: true - description: Any useful extra information about the organization - logo: - type: string - format: uri - readOnly: true - description: The organization's logo. Will be displayed in the app in various - places. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - contracts: - type: array - items: - $ref: '#/components/schemas/ContractPage' - readOnly: true - required: - - contracts - - description - - id - - logo - - name - - slug - Override: - type: object - description: Serializer for overrides used in certificate pages. - properties: - type: - type: string - value: - $ref: '#/components/schemas/OverrideValue' - id: - type: string - required: - - id - - type - - value - OverrideValue: - type: object - description: Serializer for override values used in certificate pages. - properties: - readable_id: - type: string - CEUs: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - required: - - CEUs - - readable_id - Page: - type: object - description: Serializer for individual Wagtail pages. - properties: - id: - type: integer - title: - type: string - meta: - $ref: '#/components/schemas/PageMeta' - required: - - id - - meta - - title - PageList: - type: object - description: Serializer for a list of Wagtail pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/Page' - required: - - items - - meta - PageListMeta: - type: object - description: Serializer for metadata of a list of Wagtail pages. - properties: - total_count: - type: integer - required: - - total_count - PageMeta: - type: object - description: Serializer for page metadata used in various Wagtail pages. - properties: - type: - type: string - detail_url: - type: string - format: uri - html_url: - type: string - format: uri - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PageMetaModel: - type: object - description: Extends the PageMetaSerializer to work with a Page object - properties: - type: - type: string - description: |- - Get the page type, in a more simple manner than Wagtail. - - The Wagtail version of this is PageTypeField, and it tries to modify the - context, which we neither need nor is in the correct format for it. - readOnly: true - detail_url: - type: string - description: |- - Get the detail URL, which should be the API call for this page. - - The Wagtail version of this is DetailUrlField and it also tries to make - changes to the context that we don't need. - readOnly: true - html_url: - type: string - description: Return PageHtmlUrlField. This is wrapped for OpenAPI schema - generation. - readOnly: true - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - description: Return PageLocaleField. This is wrapped for OpenAPI schema - generation. - readOnly: true - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PaginatedCourseWithCourseRunsSerializerV2List: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - PaginatedStaffDashboardUserList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=400&l=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=200&l=100 - results: - type: array - items: - $ref: '#/components/schemas/StaffDashboardUser' - PaginatedV1CourseWithCourseRunsList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - PaginatedV1ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1Program' - PaginatedV2ProgramCollectionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2ProgramCollection' - PaginatedV2ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2Program' - PartnerSchool: - type: object - properties: - id: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - name: - type: string - maxLength: 255 - email: - type: string - required: - - created_on - - email - - id - - name - - updated_on - PartnerSchoolRequest: - type: object - properties: - name: - type: string - minLength: 1 - maxLength: 255 - email: - type: string - minLength: 1 - required: - - email - - name - PatchedChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - PatchedUpdateCourseRunEnrollmentRequest: - type: object - properties: - receive_emails: - type: boolean - description: Whether to receive course emails - PatchedUserRequest: - type: object - description: Serializer for users - properties: - username: - type: string - nullable: true - minLength: 1 - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddressRequest' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfileRequest' - nullable: true - is_active: - type: boolean - default: true - PaymentTypeEnum: - enum: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - type: string - description: |- - * `marketing` - marketing - * `sales` - sales - * `financial-assistance` - financial-assistance - * `customer-support` - customer-support - * `staff` - staff - * `legacy` - legacy - x-enum-descriptions: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - PriceItem: - type: object - description: Serializer for price items used in course pages. - properties: - type: - type: string - value: - type: object - additionalProperties: {} - id: - type: string - format: uuid - required: - - id - - type - - value - ProductFlexibilePrice: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - product_flexible_price: - allOf: - - $ref: '#/components/schemas/Discount' - nullable: true - readOnly: true - required: - - description - - id - - price - - product_flexible_price - ProductFlexibilePriceRequest: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - required: - - description - - price - Program: - type: object - properties: - id: - type: integer - title: - type: string - readable_id: - type: string - required: - - id - - readable_id - - title - ProgramCertificate: - type: object - description: ProgramCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate/program// - Example: /certificate/program/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - ProgramPage: - type: object - description: Program page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - description: - type: string - description: The description shown on the home page and product page. - live: - type: boolean - readOnly: true - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - price: - type: string - description: Get the price text from the program page. - readOnly: true - required: - - description - - feature_image_src - - financial_assistance_form_url - - live - - page_url - - price - ProgramPageItem: - type: object - description: Serializer for individual program page items, including all relevant - fields. - properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - description: The page title as you'd like it to be seen by the public - maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: What you will learn from this course. - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: - type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. - maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - $ref: '#/components/schemas/CertificatePage' - program_details: - $ref: '#/components/schemas/V2Program' - required: - - about - - certificate_page - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - program_details - - title - - video_url - - what_you_learn - ProgramPageList: - type: object - description: Serializer for a list of program pages, including metadata and - items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/ProgramPageItem' - required: - - items - - meta - PublicUser: - type: object - description: Serializer for public user data - properties: - id: - type: integer - readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - id - - updated_on - RedemptionTypeEnum: - enum: - - one-time - - one-time-per-user - - unlimited - type: string - description: |- - * `one-time` - one-time - * `one-time-per-user` - one-time-per-user - * `unlimited` - unlimited - x-enum-descriptions: - - one-time - - one-time-per-user - - unlimited - ResultEnum: - enum: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - type: string - description: |- - * `b2b-disallowed` - b2b-disallowed - * `b2b-error-no-contract` - b2b-error-no-contract - * `b2b-error-no-product` - b2b-error-no-product - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-error-invalid-enrollment-code` - b2b-error-invalid-enrollment-code - * `b2b-error-requires-checkout` - b2b-error-requires-checkout - * `b2b-enroll-success` - b2b-enroll-success - x-enum-descriptions: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - SignatoryItem: - type: object - description: Serializer for signatory items used in certificate pages. - properties: - name: - type: string - title_1: - type: string - title_2: - type: string - title_3: - type: string - organization: - type: string - signature_image: - type: string - required: - - name - - organization - - signature_image - - title_1 - - title_2 - - title_3 - StaffDashboardUser: - type: object - description: Serializer for data we care about in the staff dashboard - properties: - id: - type: integer - readOnly: true - username: - type: string - maxLength: 500 - name: - type: string - maxLength: 255 - email: - type: string - format: email - maxLength: 254 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - is_staff: - type: boolean - description: The user can access the admin site - is_superuser: - type: boolean - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - required: - - email - - id - - legal_address - - username - Topic: - type: object - description: Serializer for topics used in course pages. - properties: - name: - type: string - parent: - type: string - required: - - name - User: - type: object - description: Serializer for users - properties: - id: - type: integer - readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfile' - nullable: true - is_anonymous: - type: boolean - readOnly: true - is_authenticated: - type: boolean - readOnly: true - is_editor: - type: boolean - description: Returns True if the user has editor permissions for the CMS - readOnly: true - is_staff: - type: boolean - readOnly: true - description: The user can access the admin site - is_superuser: - type: boolean - readOnly: true - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - grants: - type: array - items: - type: string - readOnly: true - is_active: - type: boolean - default: true - b2b_organizations: - type: array - items: - $ref: '#/components/schemas/UserOrganization' - readOnly: true - required: - - b2b_organizations - - created_on - - grants - - id - - is_anonymous - - is_authenticated - - is_editor - - is_staff - - is_superuser - - legal_address - - updated_on - UserOrganization: - type: object - description: |- - Serializer for user organization data. - - Slightly different from the OrganizationPageSerializer; we only need - the user's orgs and contracts. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the organization - description: - type: string - readOnly: true - description: Any useful extra information about the organization - logo: - type: string - format: uri - readOnly: true - description: The organization's logo. Will be displayed in the app in various - places. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - contracts: - type: array - items: - $ref: '#/components/schemas/ContractPage' - readOnly: true - required: - - contracts - - description - - id - - logo - - name - - slug - UserProfile: - type: object - description: Serializer for profile - properties: - gender: - nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: - type: string - nullable: true - maxLength: 128 - job_title: - type: string - nullable: true - maxLength: 128 - industry: - type: string - nullable: true - maxLength: 60 - job_function: - type: string - nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: - type: string - nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean - nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean - nullable: true - description: The learner identifies as type Professional - type_is_educator: - type: boolean - nullable: true - description: The learner identifies as type Educator - type_is_other: - type: boolean - nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProfileRequest: - type: object - description: Serializer for profile - properties: - gender: - nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: - type: string - nullable: true - maxLength: 128 - job_title: - type: string - nullable: true - maxLength: 128 - industry: - type: string - nullable: true - maxLength: 60 - job_function: - type: string - nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: - type: string - nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean - nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean - nullable: true - description: The learner identifies as type Professional - type_is_educator: - type: boolean - nullable: true - description: The learner identifies as type Educator - type_is_other: - type: boolean - nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProgramEnrollmentDetail: - type: object - properties: - program: - $ref: '#/components/schemas/V1Program' - enrollments: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollment' - certificate: - allOf: - - $ref: '#/components/schemas/ProgramCertificate' - nullable: true - readOnly: true - required: - - certificate - - enrollments - - program - V1BaseCourseRun: - type: object - description: CourseRun model serializer - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V1CourseRunWithCourse: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - description: List of products associated with this course run - approved_flexible_price_exists: - type: boolean - readOnly: true - course: - allOf: - - $ref: '#/components/schemas/Course' - readOnly: true - required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V1CourseRunWithCourseRequest: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - required: - - courseware_id - - run_tag - - title - V1CourseWithCourseRuns: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' - nullable: true - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/V1BaseCourseRun' - readOnly: true - required: - - courseruns - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - V1Program: - type: object - description: Program model serializer - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - courses: - allOf: - - $ref: '#/components/schemas/V1CourseWithCourseRuns' - readOnly: true - requirements: - type: object - properties: - required: - type: array - items: - oneOf: - - type: integer - description: List of required course IDs - electives: - type: array - items: - oneOf: - - type: integer - description: List of elective course IDs - readOnly: true - req_tree: - type: array - items: - $ref: '#/components/schemas/V1ProgramRequirement' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/ProgramPage' - readOnly: true - program_type: - type: string - nullable: true - maxLength: 255 - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - live: - type: boolean - required: - - courses - - departments - - id - - page - - readable_id - - req_tree - - requirements - - title - V1ProgramRequirement: - type: object - description: Serializer for a ProgramRequirement - properties: - id: - type: integer - nullable: true - data: - $ref: '#/components/schemas/V1ProgramRequirementData' - children: - type: array - items: - $ref: '#/components/schemas/V1ProgramRequirement' - default: [] - required: - - data - V1ProgramRequirementData: - type: object - description: Serializer for ProgramRequirement data - properties: - node_type: - $ref: '#/components/schemas/V1ProgramRequirementDataNodeTypeEnum' - course: - type: string - nullable: true - required_program: - type: string - nullable: true - program: - type: string - title: - type: string - nullable: true - operator: - type: string - nullable: true - operator_value: - type: string - nullable: true - elective_flag: - type: boolean - nullable: true - default: false - required: - - node_type - V1ProgramRequirementDataNodeTypeEnum: - enum: - - operator - - course - - program - type: string - description: |- - * `operator` - operator - * `course` - course - * `program` - program - x-enum-descriptions: - - operator - - course - - program - V2Course: - type: object - description: Course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - type: array - items: - type: object - additionalProperties: {} - nullable: true - readOnly: true - topics: - type: array - items: - type: object - additionalProperties: {} - description: List topics of a course - readOnly: true - certificate_type: - type: string - readOnly: true - required_prerequisites: - type: boolean - description: |- - Check if the prerequisites field is populated in the course page CMS. - Returns: - bool: True when the prerequisites field is populated in the course page CMS. False otherwise. - readOnly: true - duration: - type: string - description: Get the duration of the course from the course page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the course from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the course from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the time commitment of the course from the course page - CMS. - readOnly: true - availability: - type: string - description: Get course availability - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - include_in_learn_catalog: - type: boolean - readOnly: true - ingest_content_files_for_ai: - type: boolean - readOnly: true - required: - - availability - - certificate_type - - departments - - duration - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - next_run_id - - page - - programs - - readable_id - - required_prerequisites - - time_commitment - - title - - topics - V2CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - V2CourseRunCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - course_run: - $ref: '#/components/schemas/V2CourseRunWithCourse' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - course_run - - is_revoked - - user - - uuid - V2CourseRunWithCourse: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - course: - allOf: - - $ref: '#/components/schemas/V2Course' - readOnly: true - required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V2CourseRunWithCourseRequest: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - b2b_contract: - type: integer - nullable: true - required: - - courseware_id - - run_tag - - title - V2Program: - type: object - description: Program Model Serializer v2 - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - courses: - type: array - items: - type: integer - readOnly: true - collections: - type: array - items: - type: integer - readOnly: true - requirements: - type: object - properties: - courses: - type: object - properties: - required: - type: array - items: - type: integer - description: List of required course IDs - electives: - type: array - items: - type: integer - description: List of elective course IDs - programs: - type: object - properties: - required: - type: array - items: - type: integer - description: List of required program IDs - electives: - type: array - items: - type: integer - description: List of elective program IDs - readOnly: true - req_tree: - type: array - items: - $ref: '#/components/schemas/V2ProgramRequirement' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/ProgramPage' - readOnly: true - program_type: - type: string - nullable: true - maxLength: 255 - certificate_type: - type: string - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - live: - type: boolean - topics: - type: array - items: - type: object - properties: - name: - type: string - readOnly: true - availability: - $ref: '#/components/schemas/AvailabilityEnum' - start_date: - type: string - nullable: true - description: Get the start date of the program by finding the first available - run. - readOnly: true - end_date: - type: string - format: date-time - nullable: true - enrollment_start: - type: string - format: date-time - nullable: true - enrollment_end: - type: string - format: date-time - nullable: true - required_prerequisites: - type: boolean - description: Check if the prerequisites field is populated in the program - page CMS. - readOnly: true - duration: - type: string - nullable: true - description: Get the length/duration field from the program page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the program from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the program from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the effort/time_commitment field from the program page - CMS. - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - required: - - certificate_type - - collections - - courses - - departments - - duration - - id - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - page - - readable_id - - req_tree - - required_prerequisites - - requirements - - start_date - - time_commitment - - title - - topics - V2ProgramCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - program: - $ref: '#/components/schemas/V2Program' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - is_revoked - - program - - user - - uuid - V2ProgramCollection: - type: object - description: Serializer for ProgramCollection - properties: - id: - type: integer - readOnly: true - title: - type: string - description: - type: string - programs: - type: array - items: - type: object - properties: - id: - type: integer - title: - type: string - order: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - description - - id - - programs - - title - - updated_on - V2ProgramRequirement: - type: object - description: Serializer for a ProgramRequirement - properties: - id: - type: integer - nullable: true - data: - $ref: '#/components/schemas/V2ProgramRequirementData' - children: - type: array - items: - $ref: '#/components/schemas/V2ProgramRequirement' - default: [] - required: - - data - V2ProgramRequirementData: - type: object - description: Serializer for ProgramRequirement data - properties: - node_type: - $ref: '#/components/schemas/V2ProgramRequirementDataNodeTypeEnum' - course: - type: string - nullable: true - program: - type: string - title: - type: string - nullable: true - operator: - type: string - nullable: true - operator_value: - type: string - nullable: true - elective_flag: - type: boolean - nullable: true - default: false - required: - - node_type - V2ProgramRequirementDataNodeTypeEnum: - enum: - - operator - - course - type: string - description: |- - * `operator` - operator - * `course` - course - x-enum-descriptions: - - operator - - course - YearsExperienceEnum: - enum: - - 2 - - 5 - - 10 - - 15 - - 20 - - 21 - - 0 - description: |- - * `None` - ---- - * `2` - Less than 2 years - * `5` - 2-5 years - * `10` - 6 - 10 years - * `15` - 11 - 15 years - * `20` - 16 - 20 years - * `21` - More than 20 years - * `0` - Prefer not to say - x-enum-descriptions: - - Less than 2 years - - 2-5 years - - 6 - 10 years - - 11 - 15 years - - 16 - 20 years - - More than 20 years - - Prefer not to say