diff --git a/articles/serializers.py b/articles/serializers.py index 959fa8d1c1..0fbd369f10 100644 --- a/articles/serializers.py +++ b/articles/serializers.py @@ -1,5 +1,6 @@ from django.contrib.auth import get_user_model from drf_spectacular.utils import extend_schema_field +from mitol.api_versioning.mixins import VersionedSerializerMixin from rest_framework import serializers from articles import models @@ -18,13 +19,15 @@ def to_internal_value(self, data): return clean_html(data) -class UserSerializer(serializers.ModelSerializer): +class UserSerializer(VersionedSerializerMixin, serializers.ModelSerializer): + """Serializer for article author user fields.""" + class Meta: model = User fields = ["first_name", "last_name"] -class RichTextArticleSerializer(serializers.ModelSerializer): +class RichTextArticleSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Serializer for LearningResourceInstructor model """ diff --git a/channels/serializers.py b/channels/serializers.py index 072bb4a36e..cc1a231b8a 100644 --- a/channels/serializers.py +++ b/channels/serializers.py @@ -6,6 +6,7 @@ from django.contrib.auth import get_user_model from django.db import transaction from drf_spectacular.utils import extend_schema_field, inline_serializer +from mitol.api_versioning.mixins import VersionedSerializerMixin from rest_framework import serializers from rest_framework.exceptions import ValidationError @@ -58,7 +59,9 @@ def to_internal_value(self, data): return data -class LearningPathPreviewSerializer(serializers.ModelSerializer): +class LearningPathPreviewSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for a minimal preview of Learning Paths""" class Meta: @@ -114,7 +117,7 @@ def validate_banner(self, value): return {"banner": value} -class SubChannelSerializer(serializers.ModelSerializer): +class SubChannelSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for SubChannels""" parent_channel = serializers.SlugRelatedField( @@ -160,7 +163,7 @@ class Meta: exclude = ["published"] -class ChannelCountsSerializer(serializers.ModelSerializer): +class ChannelCountsSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Serializer for resource counts associated with Channel """ @@ -207,7 +210,9 @@ class Meta: ] -class ChannelTopicDetailSerializer(serializers.ModelSerializer): +class ChannelTopicDetailSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for the ChannelTopicDetail model""" class Meta: @@ -222,7 +227,9 @@ class TopicChannelSerializer(ChannelBaseSerializer): topic_detail = ChannelTopicDetailSerializer() -class ChannelDepartmentDetailSerializer(serializers.ModelSerializer): +class ChannelDepartmentDetailSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for the ChannelDepartmentDetail model""" class Meta: @@ -238,7 +245,9 @@ class DepartmentChannelSerializer(ChannelBaseSerializer): department_detail = ChannelDepartmentDetailSerializer() -class ChannelUnitDetailSerializer(serializers.ModelSerializer): +class ChannelUnitDetailSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for the ChannelOfferorDetail model""" unit = LearningResourceOfferorDetailSerializer(read_only=True) @@ -256,7 +265,9 @@ class UnitChannelSerializer(ChannelBaseSerializer): unit_detail = ChannelUnitDetailSerializer() -class ChannelPathwayDetailSerializer(serializers.ModelSerializer): +class ChannelPathwayDetailSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for the ChannelPathwayDetail model""" class Meta: @@ -292,7 +303,7 @@ def to_representation(self, instance): return serializer_cls(instance=instance, context=self.context).data -class ChannelCreateSerializer(serializers.ModelSerializer): +class ChannelCreateSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Write serializer for Channel. Uses primary keys for referenced objects during requests, and delegates to ChannelSerializer for responses. diff --git a/drf_lint_baseline.json b/drf_lint_baseline.json index 5698b9b76d..8d587a5988 100644 --- a/drf_lint_baseline.json +++ b/drf_lint_baseline.json @@ -1,20 +1,20 @@ [ - "channels/serializers.py:151:32:ORM002", - "channels/serializers.py:186:24:ORM002", - "channels/serializers.py:188:24:ORM002", - "channels/serializers.py:190:24:ORM002", - "channels/serializers.py:372:28:ORM002", - "channels/serializers.py:374:30:ORM001", - "channels/serializers.py:385:12:ORM002", - "channels/serializers.py:394:12:ORM002", - "channels/serializers.py:400:29:ORM001", - "channels/serializers.py:412:12:ORM002", - "channels/serializers.py:429:16:ORM001", - "channels/serializers.py:433:16:ORM001", - "channels/serializers.py:501:12:ORM001", - "channels/serializers.py:509:12:ORM001", - "profiles/serializers.py:132:31:ORM002", - "profiles/serializers.py:169:16:ORM002", - "profiles/serializers.py:391:15:ORM001", - "profiles/serializers.py:392:27:ORM001" + "channels/serializers.py:154:32:ORM002", + "channels/serializers.py:189:24:ORM002", + "channels/serializers.py:191:24:ORM002", + "channels/serializers.py:193:24:ORM002", + "channels/serializers.py:383:28:ORM002", + "channels/serializers.py:385:30:ORM001", + "channels/serializers.py:396:12:ORM002", + "channels/serializers.py:405:12:ORM002", + "channels/serializers.py:411:29:ORM001", + "channels/serializers.py:423:12:ORM002", + "channels/serializers.py:440:16:ORM001", + "channels/serializers.py:444:16:ORM001", + "channels/serializers.py:512:12:ORM001", + "channels/serializers.py:520:12:ORM001", + "profiles/serializers.py:133:31:ORM002", + "profiles/serializers.py:170:16:ORM002", + "profiles/serializers.py:394:15:ORM001", + "profiles/serializers.py:395:27:ORM001" ] diff --git a/frontends/api/src/generated/v1/api.ts b/frontends/api/src/generated/v1/api.ts index e3efd78ad0..29663b4e29 100644 --- a/frontends/api/src/generated/v1/api.ts +++ b/frontends/api/src/generated/v1/api.ts @@ -8879,7 +8879,7 @@ export type SourceTypeEnum = (typeof SourceTypeEnum)[keyof typeof SourceTypeEnum] /** - * + * Serializer for article author user fields. * @export * @interface User */ @@ -9048,7 +9048,7 @@ export interface UserListRequest { } /** - * + * Serializer for article author user fields. * @export * @interface UserRequest */ diff --git a/frontends/api/src/generated/v2/.openapi-generator/FILES b/frontends/api/src/generated/v2/.openapi-generator/FILES new file mode 100644 index 0000000000..53250c0269 --- /dev/null +++ b/frontends/api/src/generated/v2/.openapi-generator/FILES @@ -0,0 +1,5 @@ +api.ts +base.ts +common.ts +configuration.ts +index.ts diff --git a/frontends/api/src/generated/v2/.openapi-generator/VERSION b/frontends/api/src/generated/v2/.openapi-generator/VERSION new file mode 100644 index 0000000000..0ee843cc60 --- /dev/null +++ b/frontends/api/src/generated/v2/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 diff --git a/frontends/api/src/generated/v2/api.ts b/frontends/api/src/generated/v2/api.ts new file mode 100644 index 0000000000..14e7386f78 --- /dev/null +++ b/frontends/api/src/generated/v2/api.ts @@ -0,0 +1,29518 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * MIT Learn API + * MIT public API + * + * The version of the OpenAPI document: 0.0.1 (v2) + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from "./configuration" +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios" +import globalAxios from "axios" +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "./common" +import type { RequestArgs } from "./base" +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + BaseAPI, + RequiredError, + operationServerMap, +} from "./base" + +/** + * * `resource_type` - resource_type * `certification` - certification * `certification_type` - certification_type * `offered_by` - offered_by * `platform` - platform * `topic` - topic * `department` - department * `level` - level * `course_feature` - course_feature * `professional` - professional * `free` - free * `delivery` - delivery * `resource_type_group` - resource_type_group * `resource_category` - resource_category + * @export + * @enum {string} + */ + +export const AggregationsEnumDescriptions = { + resource_type: "resource_type", + certification: "certification", + certification_type: "certification_type", + offered_by: "offered_by", + platform: "platform", + topic: "topic", + department: "department", + level: "level", + course_feature: "course_feature", + professional: "professional", + free: "free", + delivery: "delivery", + resource_type_group: "resource_type_group", + resource_category: "resource_category", +} as const + +export const AggregationsEnum = { + /** + * resource_type + */ + ResourceType: "resource_type", + /** + * certification + */ + Certification: "certification", + /** + * certification_type + */ + CertificationType: "certification_type", + /** + * offered_by + */ + OfferedBy: "offered_by", + /** + * platform + */ + Platform: "platform", + /** + * topic + */ + Topic: "topic", + /** + * department + */ + Department: "department", + /** + * level + */ + Level: "level", + /** + * course_feature + */ + CourseFeature: "course_feature", + /** + * professional + */ + Professional: "professional", + /** + * free + */ + Free: "free", + /** + * delivery + */ + Delivery: "delivery", + /** + * resource_type_group + */ + ResourceTypeGroup: "resource_type_group", + /** + * resource_category + */ + ResourceCategory: "resource_category", +} as const + +export type AggregationsEnum = + (typeof AggregationsEnum)[keyof typeof AggregationsEnum] + +/** + * * `dated` - Dated * `anytime` - Anytime + * @export + * @enum {string} + */ + +export const AvailabilityEnumDescriptions = { + dated: "Dated", + anytime: "Anytime", +} as const + +export const AvailabilityEnum = { + /** + * Dated + */ + Dated: "dated", + /** + * Anytime + */ + Anytime: "anytime", +} as const + +export type AvailabilityEnum = + (typeof AvailabilityEnum)[keyof typeof AvailabilityEnum] + +/** + * Serializer for caption URL entries + * @export + * @interface CaptionUrl + */ +export interface CaptionUrl { + /** + * + * @type {string} + * @memberof CaptionUrl + */ + language: string + /** + * + * @type {string} + * @memberof CaptionUrl + */ + language_name: string + /** + * + * @type {string} + * @memberof CaptionUrl + */ + url: string + /** + * + * @type {number} + * @memberof CaptionUrl + */ + word_count: number +} +/** + * Serializer for caption URL entries + * @export + * @interface CaptionUrlRequest + */ +export interface CaptionUrlRequest { + /** + * + * @type {string} + * @memberof CaptionUrlRequest + */ + language: string + /** + * + * @type {string} + * @memberof CaptionUrlRequest + */ + language_name: string + /** + * + * @type {string} + * @memberof CaptionUrlRequest + */ + url: string +} +/** + * * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @export + * @enum {string} + */ + +export const CertificationTypeEnumDescriptions = { + micromasters: "MicroMasters Credential", + professional: "Professional Certificate", + completion: "Certificate of Completion", + none: "No Certificate", +} as const + +export const CertificationTypeEnum = { + /** + * MicroMasters Credential + */ + Micromasters: "micromasters", + /** + * Professional Certificate + */ + Professional: "professional", + /** + * Certificate of Completion + */ + Completion: "completion", + /** + * No Certificate + */ + None: "none", +} as const + +export type CertificationTypeEnum = + (typeof CertificationTypeEnum)[keyof typeof CertificationTypeEnum] + +/** + * Serializer class for course run ContentFiles + * @export + * @interface ContentFile + */ +export interface ContentFile { + /** + * + * @type {number} + * @memberof ContentFile + */ + id: number + /** + * + * @type {number} + * @memberof ContentFile + */ + run_id?: number + /** + * + * @type {number} + * @memberof ContentFile + */ + direct_learning_resource_id?: number | null + /** + * + * @type {string} + * @memberof ContentFile + */ + run_title?: string + /** + * + * @type {string} + * @memberof ContentFile + */ + run_slug?: string + /** + * + * @type {Array} + * @memberof ContentFile + */ + departments: Array + /** + * + * @type {string} + * @memberof ContentFile + */ + semester?: string + /** + * + * @type {number} + * @memberof ContentFile + */ + year?: number + /** + * + * @type {Array} + * @memberof ContentFile + */ + topics: Array + /** + * + * @type {string} + * @memberof ContentFile + */ + key?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + uid?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + title?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + description?: string | null + /** + * + * @type {boolean} + * @memberof ContentFile + */ + require_summaries: boolean + /** + * + * @type {string} + * @memberof ContentFile + */ + url?: string | null + /** + * + * @type {Array} + * @memberof ContentFile + */ + content_feature_type: Array + /** + * + * @type {ContentTypeEnum} + * @memberof ContentFile + */ + content_type?: ContentTypeEnum + /** + * + * @type {string} + * @memberof ContentFile + */ + content?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + content_title?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + content_author?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + content_language?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + checksum?: string + /** + * + * @type {string} + * @memberof ContentFile + */ + image_src?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + resource_id: string + /** + * + * @type {string} + * @memberof ContentFile + */ + resource_readable_id: string + /** + * + * @type {string} + * @memberof ContentFile + */ + source_path?: string + /** + * Extract the course number(s) from the associated course + * @type {Array} + * @memberof ContentFile + */ + course_number: Array + /** + * + * @type {string} + * @memberof ContentFile + */ + file_type?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + file_extension?: string | null + /** + * + * @type {LearningResourceOfferor} + * @memberof ContentFile + */ + offered_by: LearningResourceOfferor + /** + * + * @type {LearningResourcePlatform} + * @memberof ContentFile + */ + platform: LearningResourcePlatform + /** + * + * @type {string} + * @memberof ContentFile + */ + run_readable_id?: string + /** + * + * @type {string} + * @memberof ContentFile + */ + edx_module_id?: string | null + /** + * + * @type {string} + * @memberof ContentFile + */ + summary?: string + /** + * + * @type {any} + * @memberof ContentFile + */ + flashcards?: any + /** + * + * @type {string} + * @memberof ContentFile + */ + youtube_id?: string | null +} + +/** + * SearchResponseSerializer with OpenAPI annotations for Content Files search + * @export + * @interface ContentFileSearchResponse + */ +export interface ContentFileSearchResponse { + /** + * + * @type {number} + * @memberof ContentFileSearchResponse + */ + count: number + /** + * + * @type {string} + * @memberof ContentFileSearchResponse + */ + next: string | null + /** + * + * @type {string} + * @memberof ContentFileSearchResponse + */ + previous: string | null + /** + * + * @type {Array} + * @memberof ContentFileSearchResponse + */ + results: Array + /** + * + * @type {ContentFileSearchResponseMetadata} + * @memberof ContentFileSearchResponse + */ + metadata: ContentFileSearchResponseMetadata +} +/** + * + * @export + * @interface ContentFileSearchResponseMetadata + */ +export interface ContentFileSearchResponseMetadata { + /** + * + * @type {{ [key: string]: Array; }} + * @memberof ContentFileSearchResponseMetadata + */ + aggregations: { + [ + key: string + ]: Array + } + /** + * + * @type {Array} + * @memberof ContentFileSearchResponseMetadata + */ + suggestions: Array +} +/** + * + * @export + * @interface ContentFileSearchResponseMetadataAggregationsValueInner + */ +export interface ContentFileSearchResponseMetadataAggregationsValueInner { + /** + * + * @type {string} + * @memberof ContentFileSearchResponseMetadataAggregationsValueInner + */ + key: string + /** + * + * @type {number} + * @memberof ContentFileSearchResponseMetadataAggregationsValueInner + */ + doc_count: number +} +/** + * * `page` - page * `file` - file * `video` - video * `pdf` - pdf + * @export + * @enum {string} + */ + +export const ContentTypeEnumDescriptions = { + page: "page", + file: "file", + video: "video", + pdf: "pdf", +} as const + +export const ContentTypeEnum = { + /** + * page + */ + Page: "page", + /** + * file + */ + File: "file", + /** + * video + */ + Video: "video", + /** + * pdf + */ + Pdf: "pdf", +} as const + +export type ContentTypeEnum = + (typeof ContentTypeEnum)[keyof typeof ContentTypeEnum] + +/** + * Serializer for the Course model + * @export + * @interface Course + */ +export interface Course { + /** + * + * @type {Array} + * @memberof Course + */ + course_numbers: Array | null + /** + * + * @type {number} + * @memberof Course + */ + credits_earned?: number | null +} +/** + * Serializer for CourseNumber + * @export + * @interface CourseNumber + */ +export interface CourseNumber { + /** + * + * @type {string} + * @memberof CourseNumber + */ + value: string + /** + * + * @type {LearningResourceDepartment} + * @memberof CourseNumber + */ + department: LearningResourceDepartment + /** + * + * @type {string} + * @memberof CourseNumber + */ + listing_type: string +} +/** + * Serializer for CourseNumber + * @export + * @interface CourseNumberRequest + */ +export interface CourseNumberRequest { + /** + * + * @type {string} + * @memberof CourseNumberRequest + */ + value: string + /** + * + * @type {LearningResourceDepartmentRequest} + * @memberof CourseNumberRequest + */ + department: LearningResourceDepartmentRequest + /** + * + * @type {string} + * @memberof CourseNumberRequest + */ + listing_type: string +} +/** + * Serializer for the Course model + * @export + * @interface CourseRequest + */ +export interface CourseRequest { + /** + * + * @type {Array} + * @memberof CourseRequest + */ + course_numbers: Array | null + /** + * + * @type {number} + * @memberof CourseRequest + */ + credits_earned?: number | null +} +/** + * Serializer for course resources + * @export + * @interface CourseResource + */ +export interface CourseResource { + /** + * + * @type {number} + * @memberof CourseResource + */ + id: number + /** + * + * @type {Array} + * @memberof CourseResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof CourseResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof CourseResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof CourseResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof CourseResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof CourseResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof CourseResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof CourseResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof CourseResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof CourseResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof CourseResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof CourseResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof CourseResource + */ + views: number + /** + * + * @type {Array} + * @memberof CourseResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof CourseResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof CourseResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof CourseResource + */ + format: Array + /** + * + * @type {Array} + * @memberof CourseResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof CourseResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof CourseResource + */ + best_run_id: number | null + /** + * + * @type {CourseResourceResourceTypeEnum} + * @memberof CourseResource + */ + resource_type: CourseResourceResourceTypeEnum + /** + * + * @type {Course} + * @memberof CourseResource + */ + course: Course + /** + * + * @type {string} + * @memberof CourseResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof CourseResource + */ + title: string + /** + * + * @type {string} + * @memberof CourseResource + */ + description?: string | null + /** + * + * @type {string} + * @memberof CourseResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof CourseResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof CourseResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof CourseResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof CourseResource + */ + url?: string | null + /** + * The display category for this resource. + * @type {string} + * @memberof CourseResource + */ + resource_category: string + /** + * + * @type {Array} + * @memberof CourseResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof CourseResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof CourseResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof CourseResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof CourseResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof CourseResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof CourseResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof CourseResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof CourseResource + */ + location?: string + /** + * + * @type {string} + * @memberof CourseResource + */ + duration?: string + /** + * + * @type {number} + * @memberof CourseResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof CourseResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof CourseResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof CourseResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof CourseResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof CourseResource + */ + require_summaries: boolean +} + +/** + * + * @export + * @interface CourseResourceCertificationType + */ +export interface CourseResourceCertificationType { + /** + * + * @type {string} + * @memberof CourseResourceCertificationType + */ + code: CourseResourceCertificationTypeCodeEnum + /** + * + * @type {string} + * @memberof CourseResourceCertificationType + */ + name: string +} + +export const CourseResourceCertificationTypeCodeEnum = { + Micromasters: "micromasters", + Professional: "professional", + Completion: "completion", + None: "none", +} as const + +export type CourseResourceCertificationTypeCodeEnum = + (typeof CourseResourceCertificationTypeCodeEnum)[keyof typeof CourseResourceCertificationTypeCodeEnum] + +/** + * + * @export + * @interface CourseResourceDeliveryInner + */ +export interface CourseResourceDeliveryInner { + /** + * + * @type {string} + * @memberof CourseResourceDeliveryInner + */ + code: CourseResourceDeliveryInnerCodeEnum + /** + * + * @type {string} + * @memberof CourseResourceDeliveryInner + */ + name: string +} + +export const CourseResourceDeliveryInnerCodeEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const + +export type CourseResourceDeliveryInnerCodeEnum = + (typeof CourseResourceDeliveryInnerCodeEnum)[keyof typeof CourseResourceDeliveryInnerCodeEnum] + +/** + * + * @export + * @interface CourseResourceFormatInner + */ +export interface CourseResourceFormatInner { + /** + * + * @type {string} + * @memberof CourseResourceFormatInner + */ + code: CourseResourceFormatInnerCodeEnum + /** + * + * @type {string} + * @memberof CourseResourceFormatInner + */ + name: string +} + +export const CourseResourceFormatInnerCodeEnum = { + Synchronous: "synchronous", + Asynchronous: "asynchronous", +} as const + +export type CourseResourceFormatInnerCodeEnum = + (typeof CourseResourceFormatInnerCodeEnum)[keyof typeof CourseResourceFormatInnerCodeEnum] + +/** + * + * @export + * @interface CourseResourcePaceInner + */ +export interface CourseResourcePaceInner { + /** + * + * @type {string} + * @memberof CourseResourcePaceInner + */ + code: CourseResourcePaceInnerCodeEnum + /** + * + * @type {string} + * @memberof CourseResourcePaceInner + */ + name: string +} + +export const CourseResourcePaceInnerCodeEnum = { + SelfPaced: "self_paced", + InstructorPaced: "instructor_paced", +} as const + +export type CourseResourcePaceInnerCodeEnum = + (typeof CourseResourcePaceInnerCodeEnum)[keyof typeof CourseResourcePaceInnerCodeEnum] + +/** + * Serializer for course resources + * @export + * @interface CourseResourceRequest + */ +export interface CourseResourceRequest { + /** + * + * @type {Array} + * @memberof CourseResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof CourseResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof CourseResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof CourseResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof CourseResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof CourseResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof CourseResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof CourseResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof CourseResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof CourseResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof CourseResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof CourseResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof CourseResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const CourseResourceResourceTypeEnumDescriptions = { + course: "", +} as const + +export const CourseResourceResourceTypeEnum = { + Course: "course", +} as const + +export type CourseResourceResourceTypeEnum = + (typeof CourseResourceResourceTypeEnum)[keyof typeof CourseResourceResourceTypeEnum] + +/** + * * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @export + * @enum {string} + */ + +export const DeliveryEnumDescriptions = { + online: "Online", + hybrid: "Hybrid", + in_person: "In person", + offline: "Offline", +} as const + +export const DeliveryEnum = { + /** + * Online + */ + Online: "online", + /** + * Hybrid + */ + Hybrid: "hybrid", + /** + * In person + */ + InPerson: "in_person", + /** + * Offline + */ + Offline: "offline", +} as const + +export type DeliveryEnum = (typeof DeliveryEnum)[keyof typeof DeliveryEnum] + +/** + * * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @export + * @enum {string} + */ + +export const DepartmentEnumDescriptions = { + "1": "Civil and Environmental Engineering", + "2": "Mechanical Engineering", + "3": "Materials Science and Engineering", + "4": "Architecture", + "5": "Chemistry", + "6": "Electrical Engineering and Computer Science", + "7": "Biology", + "8": "Physics", + "9": "Brain and Cognitive Sciences", + "10": "Chemical Engineering", + "11": "Urban Studies and Planning", + "12": "Earth, Atmospheric, and Planetary Sciences", + "14": "Economics", + "15": "Management", + "16": "Aeronautics and Astronautics", + "17": "Political Science", + "18": "Mathematics", + "20": "Biological Engineering", + "21A": "Anthropology", + "21G": "Global Languages", + "21H": "History", + "21L": "Literature", + "21M": "Music and Theater Arts", + "22": "Nuclear Science and Engineering", + "24": "Linguistics and Philosophy", + CC: "Concourse", + "CMS-W": "Comparative Media Studies/Writing", + EC: "Edgerton Center", + ES: "Experimental Study Group", + ESD: "Engineering Systems Division", + HST: "Medical Engineering and Science", + IDS: "Data, Systems, and Society", + MAS: "Media Arts and Sciences", + PE: "Athletics, Physical Education and Recreation", + SP: "Special Programs", + STS: "Science, Technology, and Society", + WGS: "Women's and Gender Studies", +} as const + +export const DepartmentEnum = { + /** + * Civil and Environmental Engineering + */ + _1: "1", + /** + * Mechanical Engineering + */ + _2: "2", + /** + * Materials Science and Engineering + */ + _3: "3", + /** + * Architecture + */ + _4: "4", + /** + * Chemistry + */ + _5: "5", + /** + * Electrical Engineering and Computer Science + */ + _6: "6", + /** + * Biology + */ + _7: "7", + /** + * Physics + */ + _8: "8", + /** + * Brain and Cognitive Sciences + */ + _9: "9", + /** + * Chemical Engineering + */ + _10: "10", + /** + * Urban Studies and Planning + */ + _11: "11", + /** + * Earth, Atmospheric, and Planetary Sciences + */ + _12: "12", + /** + * Economics + */ + _14: "14", + /** + * Management + */ + _15: "15", + /** + * Aeronautics and Astronautics + */ + _16: "16", + /** + * Political Science + */ + _17: "17", + /** + * Mathematics + */ + _18: "18", + /** + * Biological Engineering + */ + _20: "20", + /** + * Anthropology + */ + _21A: "21A", + /** + * Global Languages + */ + _21G: "21G", + /** + * History + */ + _21H: "21H", + /** + * Literature + */ + _21L: "21L", + /** + * Music and Theater Arts + */ + _21M: "21M", + /** + * Nuclear Science and Engineering + */ + _22: "22", + /** + * Linguistics and Philosophy + */ + _24: "24", + /** + * Concourse + */ + Cc: "CC", + /** + * Comparative Media Studies/Writing + */ + CmsW: "CMS-W", + /** + * Edgerton Center + */ + Ec: "EC", + /** + * Experimental Study Group + */ + Es: "ES", + /** + * Engineering Systems Division + */ + Esd: "ESD", + /** + * Medical Engineering and Science + */ + Hst: "HST", + /** + * Data, Systems, and Society + */ + Ids: "IDS", + /** + * Media Arts and Sciences + */ + Mas: "MAS", + /** + * Athletics, Physical Education and Recreation + */ + Pe: "PE", + /** + * Special Programs + */ + Sp: "SP", + /** + * Science, Technology, and Society + */ + Sts: "STS", + /** + * Women's and Gender Studies + */ + Wgs: "WGS", +} as const + +export type DepartmentEnum = + (typeof DepartmentEnum)[keyof typeof DepartmentEnum] + +/** + * Serializer for document resources + * @export + * @interface DocumentResource + */ +export interface DocumentResource { + /** + * + * @type {number} + * @memberof DocumentResource + */ + id: number + /** + * + * @type {Array} + * @memberof DocumentResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof DocumentResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof DocumentResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof DocumentResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof DocumentResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof DocumentResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof DocumentResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof DocumentResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof DocumentResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof DocumentResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof DocumentResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof DocumentResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof DocumentResource + */ + views: number + /** + * + * @type {Array} + * @memberof DocumentResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof DocumentResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof DocumentResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof DocumentResource + */ + format: Array + /** + * + * @type {Array} + * @memberof DocumentResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof DocumentResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof DocumentResource + */ + best_run_id: number | null + /** + * + * @type {DocumentResourceResourceTypeEnum} + * @memberof DocumentResource + */ + resource_type: DocumentResourceResourceTypeEnum + /** + * + * @type {Array} + * @memberof DocumentResource + */ + content_files: Array | null + /** + * + * @type {string} + * @memberof DocumentResource + */ + description: string | null + /** + * + * @type {string} + * @memberof DocumentResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof DocumentResource + */ + title: string + /** + * + * @type {string} + * @memberof DocumentResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof DocumentResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof DocumentResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof DocumentResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof DocumentResource + */ + url?: string | null + /** + * The display category for this resource. + * @type {string} + * @memberof DocumentResource + */ + resource_category: string + /** + * + * @type {Array} + * @memberof DocumentResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof DocumentResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof DocumentResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof DocumentResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof DocumentResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof DocumentResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof DocumentResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof DocumentResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof DocumentResource + */ + location?: string + /** + * + * @type {string} + * @memberof DocumentResource + */ + duration?: string + /** + * + * @type {number} + * @memberof DocumentResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof DocumentResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof DocumentResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof DocumentResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof DocumentResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof DocumentResource + */ + require_summaries: boolean +} + +/** + * Serializer for document resources + * @export + * @interface DocumentResourceRequest + */ +export interface DocumentResourceRequest { + /** + * + * @type {Array} + * @memberof DocumentResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof DocumentResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof DocumentResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof DocumentResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof DocumentResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof DocumentResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof DocumentResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof DocumentResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof DocumentResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof DocumentResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof DocumentResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof DocumentResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof DocumentResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const DocumentResourceResourceTypeEnumDescriptions = { + document: "", +} as const + +export const DocumentResourceResourceTypeEnum = { + Document: "document", +} as const + +export type DocumentResourceResourceTypeEnum = + (typeof DocumentResourceResourceTypeEnum)[keyof typeof DocumentResourceResourceTypeEnum] + +/** + * Serializer for the LearningPath model + * @export + * @interface LearningPath + */ +export interface LearningPath { + /** + * + * @type {number} + * @memberof LearningPath + */ + id: number + /** + * Return the number of items in the list + * @type {number} + * @memberof LearningPath + */ + item_count: number +} +/** + * Specialized serializer for a LearningPath relationship + * @export + * @interface LearningPathRelationship + */ +export interface LearningPathRelationship { + /** + * + * @type {number} + * @memberof LearningPathRelationship + */ + id: number + /** + * + * @type {LearningResource} + * @memberof LearningPathRelationship + */ + resource: LearningResource + /** + * + * @type {number} + * @memberof LearningPathRelationship + */ + position?: number + /** + * + * @type {number} + * @memberof LearningPathRelationship + */ + parent: number + /** + * + * @type {number} + * @memberof LearningPathRelationship + */ + child: number +} +/** + * Create serializer for nested learning path items. The parent is derived from the nested route and must not be client-supplied. + * @export + * @interface LearningPathRelationshipCreate + */ +export interface LearningPathRelationshipCreate { + /** + * + * @type {number} + * @memberof LearningPathRelationshipCreate + */ + id: number + /** + * + * @type {LearningResource} + * @memberof LearningPathRelationshipCreate + */ + resource: LearningResource + /** + * + * @type {number} + * @memberof LearningPathRelationshipCreate + */ + position?: number + /** + * + * @type {number} + * @memberof LearningPathRelationshipCreate + */ + parent: number + /** + * + * @type {number} + * @memberof LearningPathRelationshipCreate + */ + child: number +} +/** + * Create serializer for nested learning path items. The parent is derived from the nested route and must not be client-supplied. + * @export + * @interface LearningPathRelationshipCreateRequest + */ +export interface LearningPathRelationshipCreateRequest { + /** + * + * @type {number} + * @memberof LearningPathRelationshipCreateRequest + */ + position?: number + /** + * + * @type {number} + * @memberof LearningPathRelationshipCreateRequest + */ + child: number +} +/** + * CRUD serializer for LearningPath resources + * @export + * @interface LearningPathResource + */ +export interface LearningPathResource { + /** + * + * @type {number} + * @memberof LearningPathResource + */ + id: number + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof LearningPathResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof LearningPathResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof LearningPathResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof LearningPathResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof LearningPathResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof LearningPathResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof LearningPathResource + */ + views: number + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof LearningPathResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof LearningPathResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + format: Array + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof LearningPathResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof LearningPathResource + */ + best_run_id: number | null + /** + * + * @type {LearningPathResourceResourceTypeEnum} + * @memberof LearningPathResource + */ + resource_type: LearningPathResourceResourceTypeEnum + /** + * The display category for this resource. + * @type {string} + * @memberof LearningPathResource + */ + resource_category: string + /** + * + * @type {LearningPath} + * @memberof LearningPathResource + */ + learning_path: LearningPath + /** + * + * @type {string} + * @memberof LearningPathResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof LearningPathResource + */ + title: string + /** + * + * @type {string} + * @memberof LearningPathResource + */ + description?: string | null + /** + * + * @type {string} + * @memberof LearningPathResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof LearningPathResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof LearningPathResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof LearningPathResource + */ + url?: string | null + /** + * + * @type {Array} + * @memberof LearningPathResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof LearningPathResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof LearningPathResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof LearningPathResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof LearningPathResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof LearningPathResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof LearningPathResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof LearningPathResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof LearningPathResource + */ + location?: string + /** + * + * @type {string} + * @memberof LearningPathResource + */ + duration?: string + /** + * + * @type {number} + * @memberof LearningPathResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof LearningPathResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof LearningPathResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof LearningPathResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof LearningPathResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof LearningPathResource + */ + require_summaries: boolean +} + +/** + * CRUD serializer for LearningPath resources + * @export + * @interface LearningPathResourceRequest + */ +export interface LearningPathResourceRequest { + /** + * + * @type {Array} + * @memberof LearningPathResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof LearningPathResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof LearningPathResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof LearningPathResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof LearningPathResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof LearningPathResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof LearningPathResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof LearningPathResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof LearningPathResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof LearningPathResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof LearningPathResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof LearningPathResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof LearningPathResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const LearningPathResourceResourceTypeEnumDescriptions = { + learning_path: "", +} as const + +export const LearningPathResourceResourceTypeEnum = { + LearningPath: "learning_path", +} as const + +export type LearningPathResourceResourceTypeEnum = + (typeof LearningPathResourceResourceTypeEnum)[keyof typeof LearningPathResourceResourceTypeEnum] + +/** + * @type LearningResource + * @export + */ +export type LearningResource = + | ({ resource_type: "course" } & CourseResource) + | ({ resource_type: "document" } & DocumentResource) + | ({ resource_type: "learning_path" } & LearningPathResource) + | ({ resource_type: "podcast" } & PodcastResource) + | ({ resource_type: "podcast_episode" } & PodcastEpisodeResource) + | ({ resource_type: "program" } & ProgramResource) + | ({ resource_type: "video" } & VideoResource) + | ({ resource_type: "video_playlist" } & VideoPlaylistResource) + +/** + * Serializer for LearningResourceDepartment, minus school The absence of the departments list is to avoid a circular serialization structure. + * @export + * @interface LearningResourceBaseDepartment + */ +export interface LearningResourceBaseDepartment { + /** + * + * @type {string} + * @memberof LearningResourceBaseDepartment + */ + department_id: string + /** + * + * @type {string} + * @memberof LearningResourceBaseDepartment + */ + name: string + /** + * + * @type {string} + * @memberof LearningResourceBaseDepartment + */ + url: string | null +} +/** + * Base serializer for LearningResourceSchool model, minus departments list The absence of the departments list is to avoid a circular serialization structure. + * @export + * @interface LearningResourceBaseSchool + */ +export interface LearningResourceBaseSchool { + /** + * + * @type {number} + * @memberof LearningResourceBaseSchool + */ + id: number + /** + * + * @type {string} + * @memberof LearningResourceBaseSchool + */ + name: string + /** + * + * @type {string} + * @memberof LearningResourceBaseSchool + */ + url: string +} +/** + * Base serializer for LearningResourceSchool model, minus departments list The absence of the departments list is to avoid a circular serialization structure. + * @export + * @interface LearningResourceBaseSchoolRequest + */ +export interface LearningResourceBaseSchoolRequest { + /** + * + * @type {string} + * @memberof LearningResourceBaseSchoolRequest + */ + name: string + /** + * + * @type {string} + * @memberof LearningResourceBaseSchoolRequest + */ + url: string +} +/** + * Serializer for LearningResourceContentTag + * @export + * @interface LearningResourceContentTag + */ +export interface LearningResourceContentTag { + /** + * + * @type {number} + * @memberof LearningResourceContentTag + */ + id: number + /** + * + * @type {string} + * @memberof LearningResourceContentTag + */ + name: string +} +/** + * Full serializer for LearningResourceDepartment, including school + * @export + * @interface LearningResourceDepartment + */ +export interface LearningResourceDepartment { + /** + * + * @type {string} + * @memberof LearningResourceDepartment + */ + department_id: string + /** + * + * @type {string} + * @memberof LearningResourceDepartment + */ + name: string + /** + * + * @type {string} + * @memberof LearningResourceDepartment + */ + url: string | null + /** + * + * @type {LearningResourceBaseSchool} + * @memberof LearningResourceDepartment + */ + school: LearningResourceBaseSchool | null +} +/** + * Full serializer for LearningResourceDepartment, including school + * @export + * @interface LearningResourceDepartmentRequest + */ +export interface LearningResourceDepartmentRequest { + /** + * + * @type {string} + * @memberof LearningResourceDepartmentRequest + */ + department_id: string + /** + * + * @type {string} + * @memberof LearningResourceDepartmentRequest + */ + name: string +} +/** + * Serializer for the response of the display info endpoint + * @export + * @interface LearningResourceDisplayInfoResponse + */ +export interface LearningResourceDisplayInfoResponse { + /** + * Title + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + title: string + /** + * Description + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + description: string + /** + * Full Description + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + full_description: string | null + /** + * Website + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + url: string + /** + * Free + * @type {boolean} + * @memberof LearningResourceDisplayInfoResponse + */ + free: boolean | null + /** + * Topics + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + topics: Array + /** + * Price + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + price: string | null + /** + * Extra Price Information + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + extra_price_info: string | null + /** + * Certificate + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + certification: string | null + /** + * Instructors + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + instructors: Array | null + /** + * Runs/Sessions + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + runs: Array | null + /** + * Offered By + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + offered_by: string | null + /** + * Languages + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + languages: Array | null + /** + * Levels + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + levels: Array | null + /** + * Departments + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + departments: Array + /** + * Platform + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + platform: string | null + /** + * Number of Courses + * @type {number} + * @memberof LearningResourceDisplayInfoResponse + */ + number_of_courses: number | null + /** + * Number of Programs + * @type {number} + * @memberof LearningResourceDisplayInfoResponse + */ + number_of_programs: number | null + /** + * Child courses and programs included in this learning resource + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + program_courses: Array | null + /** + * Location + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + location: string | null + /** + * Starts + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + starts: Array | null + /** + * Format + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + format_type: Array | null + /** + * As Taught In + * @type {Array} + * @memberof LearningResourceDisplayInfoResponse + */ + as_taught_in: Array | null + /** + * Duration + * @type {string} + * @memberof LearningResourceDisplayInfoResponse + */ + duration: string | null + /** + * + * @type {number} + * @memberof LearningResourceDisplayInfoResponse + */ + id: number +} +/** + * + * @export + * @interface LearningResourceDisplayInfoResponseRunsInner + */ +export interface LearningResourceDisplayInfoResponseRunsInner { + /** + * + * @type {string} + * @memberof LearningResourceDisplayInfoResponseRunsInner + */ + location?: string + /** + * + * @type {string} + * @memberof LearningResourceDisplayInfoResponseRunsInner + */ + start_date?: string + /** + * + * @type {Array} + * @memberof LearningResourceDisplayInfoResponseRunsInner + */ + instructors?: Array + /** + * + * @type {string} + * @memberof LearningResourceDisplayInfoResponseRunsInner + */ + duration?: string + /** + * + * @type {string} + * @memberof LearningResourceDisplayInfoResponseRunsInner + */ + price?: string + /** + * + * @type {Array} + * @memberof LearningResourceDisplayInfoResponseRunsInner + */ + format?: Array +} +/** + * Serializer for LearningResourceImage + * @export + * @interface LearningResourceImage + */ +export interface LearningResourceImage { + /** + * + * @type {number} + * @memberof LearningResourceImage + */ + id: number + /** + * + * @type {string} + * @memberof LearningResourceImage + */ + url: string + /** + * + * @type {string} + * @memberof LearningResourceImage + */ + description?: string | null + /** + * + * @type {string} + * @memberof LearningResourceImage + */ + alt?: string | null +} +/** + * Serializer for LearningResourceImage + * @export + * @interface LearningResourceImageRequest + */ +export interface LearningResourceImageRequest { + /** + * + * @type {string} + * @memberof LearningResourceImageRequest + */ + url: string + /** + * + * @type {string} + * @memberof LearningResourceImageRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof LearningResourceImageRequest + */ + alt?: string | null +} +/** + * Serializer for LearningResourceInstructor model + * @export + * @interface LearningResourceInstructor + */ +export interface LearningResourceInstructor { + /** + * + * @type {number} + * @memberof LearningResourceInstructor + */ + id: number + /** + * + * @type {string} + * @memberof LearningResourceInstructor + */ + first_name?: string | null + /** + * + * @type {string} + * @memberof LearningResourceInstructor + */ + last_name?: string | null + /** + * + * @type {string} + * @memberof LearningResourceInstructor + */ + full_name?: string | null +} +/** + * Serializer for LearningResourceInstructor model + * @export + * @interface LearningResourceInstructorRequest + */ +export interface LearningResourceInstructorRequest { + /** + * + * @type {string} + * @memberof LearningResourceInstructorRequest + */ + first_name?: string | null + /** + * + * @type {string} + * @memberof LearningResourceInstructorRequest + */ + last_name?: string | null + /** + * + * @type {string} + * @memberof LearningResourceInstructorRequest + */ + full_name?: string | null +} +/** + * Serializer for LearningResourceOfferor with basic details + * @export + * @interface LearningResourceOfferor + */ +export interface LearningResourceOfferor { + /** + * + * @type {string} + * @memberof LearningResourceOfferor + */ + code: string + /** + * + * @type {string} + * @memberof LearningResourceOfferor + */ + name: string + /** + * + * @type {string} + * @memberof LearningResourceOfferor + */ + channel_url: string | null + /** + * + * @type {boolean} + * @memberof LearningResourceOfferor + */ + display_facet?: boolean +} +/** + * Serializer for LearningResourceOfferor with all details + * @export + * @interface LearningResourceOfferorDetail + */ +export interface LearningResourceOfferorDetail { + /** + * + * @type {string} + * @memberof LearningResourceOfferorDetail + */ + code: string + /** + * + * @type {string} + * @memberof LearningResourceOfferorDetail + */ + channel_url: string | null + /** + * + * @type {string} + * @memberof LearningResourceOfferorDetail + */ + name: string + /** + * + * @type {boolean} + * @memberof LearningResourceOfferorDetail + */ + professional?: boolean + /** + * + * @type {Array} + * @memberof LearningResourceOfferorDetail + */ + offerings?: Array + /** + * + * @type {Array} + * @memberof LearningResourceOfferorDetail + */ + audience?: Array + /** + * + * @type {Array} + * @memberof LearningResourceOfferorDetail + */ + formats?: Array + /** + * + * @type {Array} + * @memberof LearningResourceOfferorDetail + */ + fee?: Array + /** + * + * @type {Array} + * @memberof LearningResourceOfferorDetail + */ + certifications?: Array + /** + * + * @type {Array} + * @memberof LearningResourceOfferorDetail + */ + content_types?: Array + /** + * + * @type {string} + * @memberof LearningResourceOfferorDetail + */ + more_information?: string + /** + * + * @type {string} + * @memberof LearningResourceOfferorDetail + */ + value_prop?: string + /** + * + * @type {boolean} + * @memberof LearningResourceOfferorDetail + */ + display_facet?: boolean +} +/** + * Serializer for LearningResourceOfferor with basic details + * @export + * @interface LearningResourceOfferorRequest + */ +export interface LearningResourceOfferorRequest { + /** + * + * @type {string} + * @memberof LearningResourceOfferorRequest + */ + code: string + /** + * + * @type {string} + * @memberof LearningResourceOfferorRequest + */ + name: string + /** + * + * @type {boolean} + * @memberof LearningResourceOfferorRequest + */ + display_facet?: boolean +} +/** + * Serializer for LearningResourcePlatform + * @export + * @interface LearningResourcePlatform + */ +export interface LearningResourcePlatform { + /** + * + * @type {string} + * @memberof LearningResourcePlatform + */ + code: string + /** + * + * @type {string} + * @memberof LearningResourcePlatform + */ + name?: string +} +/** + * Serializer for LearningResourcePlatform + * @export + * @interface LearningResourcePlatformRequest + */ +export interface LearningResourcePlatformRequest { + /** + * + * @type {string} + * @memberof LearningResourcePlatformRequest + */ + code: string + /** + * + * @type {string} + * @memberof LearningResourcePlatformRequest + */ + name?: string +} +/** + * Serializer for LearningResourcePrice model + * @export + * @interface LearningResourcePrice + */ +export interface LearningResourcePrice { + /** + * + * @type {string} + * @memberof LearningResourcePrice + */ + amount: string + /** + * + * @type {string} + * @memberof LearningResourcePrice + */ + currency: string +} +/** + * Serializer for LearningResourcePrice model + * @export + * @interface LearningResourcePriceRequest + */ +export interface LearningResourcePriceRequest { + /** + * + * @type {string} + * @memberof LearningResourcePriceRequest + */ + amount: string + /** + * + * @type {string} + * @memberof LearningResourcePriceRequest + */ + currency: string +} +/** + * CRUD serializer for LearningResourceRelationship + * @export + * @interface LearningResourceRelationship + */ +export interface LearningResourceRelationship { + /** + * + * @type {number} + * @memberof LearningResourceRelationship + */ + id: number + /** + * + * @type {LearningResource} + * @memberof LearningResourceRelationship + */ + resource: LearningResource + /** + * + * @type {number} + * @memberof LearningResourceRelationship + */ + position?: number + /** + * + * @type {RelationTypeEnum} + * @memberof LearningResourceRelationship + */ + relation_type?: RelationTypeEnum + /** + * + * @type {number} + * @memberof LearningResourceRelationship + */ + parent: number + /** + * + * @type {number} + * @memberof LearningResourceRelationship + */ + child: number +} + +/** + * Serializer field for the LearningResourceRelationship model that uses the LearningResourceSerializer to serialize the child resources + * @export + * @interface LearningResourceRelationshipChildField + */ +export interface LearningResourceRelationshipChildField { + /** + * + * @type {number} + * @memberof LearningResourceRelationshipChildField + */ + child: number + /** + * + * @type {number} + * @memberof LearningResourceRelationshipChildField + */ + position?: number + /** + * + * @type {RelationTypeEnum} + * @memberof LearningResourceRelationshipChildField + */ + relation_type?: RelationTypeEnum + /** + * + * @type {string} + * @memberof LearningResourceRelationshipChildField + */ + title: string + /** + * + * @type {string} + * @memberof LearningResourceRelationshipChildField + */ + readable_id: string +} + +/** + * @type LearningResourceRequest + * @export + */ +export type LearningResourceRequest = + | ({ resource_type: "course" } & CourseResourceRequest) + | ({ resource_type: "document" } & DocumentResourceRequest) + | ({ resource_type: "learning_path" } & LearningPathResourceRequest) + | ({ resource_type: "podcast" } & PodcastResourceRequest) + | ({ resource_type: "podcast_episode" } & PodcastEpisodeResourceRequest) + | ({ resource_type: "program" } & ProgramResourceRequest) + | ({ resource_type: "video" } & VideoResourceRequest) + | ({ resource_type: "video_playlist" } & VideoPlaylistResourceRequest) + +/** + * Serializer for the LearningResourceRun model + * @export + * @interface LearningResourceRun + */ +export interface LearningResourceRun { + /** + * + * @type {number} + * @memberof LearningResourceRun + */ + id: number + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + instructors: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof LearningResourceRun + */ + image: LearningResourceImage | null + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + level: Array + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + delivery: Array + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + format: Array + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + pace: Array + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + resource_prices: Array + /** + * Return a URL for enrollment, derived from the run URL. + * @type {string} + * @memberof LearningResourceRun + */ + enrollment_url: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + run_id: string + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + title: string + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + description?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof LearningResourceRun + */ + published?: boolean + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + url?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + slug?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + semester?: string | null + /** + * + * @type {number} + * @memberof LearningResourceRun + */ + year?: number | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + start_date?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + end_date?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + enrollment_start?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + enrollment_end?: string | null + /** + * + * @type {Array} + * @memberof LearningResourceRun + */ + prices?: Array | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + checksum?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof LearningResourceRun + */ + availability?: AvailabilityEnum | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + location?: string + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + duration?: string + /** + * + * @type {number} + * @memberof LearningResourceRun + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof LearningResourceRun + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof LearningResourceRun + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof LearningResourceRun + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof LearningResourceRun + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @interface LearningResourceRunLevelInner + */ +export interface LearningResourceRunLevelInner { + /** + * + * @type {string} + * @memberof LearningResourceRunLevelInner + */ + code: LearningResourceRunLevelInnerCodeEnum + /** + * + * @type {string} + * @memberof LearningResourceRunLevelInner + */ + name: string +} + +export const LearningResourceRunLevelInnerCodeEnum = { + Undergraduate: "undergraduate", + Graduate: "graduate", + HighSchool: "high_school", + Noncredit: "noncredit", + Advanced: "advanced", + Intermediate: "intermediate", + Introductory: "introductory", +} as const + +export type LearningResourceRunLevelInnerCodeEnum = + (typeof LearningResourceRunLevelInnerCodeEnum)[keyof typeof LearningResourceRunLevelInnerCodeEnum] + +/** + * Serializer for the LearningResourceRun model + * @export + * @interface LearningResourceRunRequest + */ +export interface LearningResourceRunRequest { + /** + * + * @type {Array} + * @memberof LearningResourceRunRequest + */ + level: Array + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + run_id: string + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + title: string + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof LearningResourceRunRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof LearningResourceRunRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + url?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + slug?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + semester?: string | null + /** + * + * @type {number} + * @memberof LearningResourceRunRequest + */ + year?: number | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + start_date?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + end_date?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + enrollment_start?: string | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + enrollment_end?: string | null + /** + * + * @type {Array} + * @memberof LearningResourceRunRequest + */ + prices?: Array | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + checksum?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof LearningResourceRunRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + location?: string + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof LearningResourceRunRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof LearningResourceRunRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof LearningResourceRunRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof LearningResourceRunRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof LearningResourceRunRequest + */ + max_weekly_hours?: number | null +} + +/** + * Serializer for LearningResourceSchool model, including list of departments + * @export + * @interface LearningResourceSchool + */ +export interface LearningResourceSchool { + /** + * + * @type {number} + * @memberof LearningResourceSchool + */ + id: number + /** + * + * @type {string} + * @memberof LearningResourceSchool + */ + name: string + /** + * + * @type {string} + * @memberof LearningResourceSchool + */ + url: string + /** + * + * @type {Array} + * @memberof LearningResourceSchool + */ + departments: Array +} +/** + * Minimal serializer for LearningResource - returns only essential fields for sitemap generation and other use cases requiring minimal data transfer. + * @export + * @interface LearningResourceSummary + */ +export interface LearningResourceSummary { + /** + * + * @type {number} + * @memberof LearningResourceSummary + */ + id: number + /** + * + * @type {string} + * @memberof LearningResourceSummary + */ + last_modified?: string | null + /** + * + * @type {string} + * @memberof LearningResourceSummary + */ + url?: string | null +} +/** + * Serializer for LearningResourceTopic model + * @export + * @interface LearningResourceTopic + */ +export interface LearningResourceTopic { + /** + * + * @type {number} + * @memberof LearningResourceTopic + */ + id: number + /** + * + * @type {string} + * @memberof LearningResourceTopic + */ + name: string + /** + * The icon to display for the topic. + * @type {string} + * @memberof LearningResourceTopic + */ + icon?: string + /** + * + * @type {number} + * @memberof LearningResourceTopic + */ + parent?: number | null + /** + * + * @type {string} + * @memberof LearningResourceTopic + */ + channel_url: string | null +} +/** + * SearchResponseSerializer with OpenAPI annotations for Learning Resources search + * @export + * @interface LearningResourcesSearchResponse + */ +export interface LearningResourcesSearchResponse { + /** + * + * @type {number} + * @memberof LearningResourcesSearchResponse + */ + count: number + /** + * + * @type {string} + * @memberof LearningResourcesSearchResponse + */ + next: string | null + /** + * + * @type {string} + * @memberof LearningResourcesSearchResponse + */ + previous: string | null + /** + * + * @type {Array} + * @memberof LearningResourcesSearchResponse + */ + results: Array + /** + * + * @type {ContentFileSearchResponseMetadata} + * @memberof LearningResourcesSearchResponse + */ + metadata: ContentFileSearchResponseMetadata +} +/** + * * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @export + * @enum {string} + */ + +export const LevelEnumDescriptions = { + undergraduate: "Undergraduate", + graduate: "Graduate", + high_school: "High School", + noncredit: "Non-Credit", + advanced: "Advanced", + intermediate: "Intermediate", + introductory: "Introductory", +} as const + +export const LevelEnum = { + /** + * Undergraduate + */ + Undergraduate: "undergraduate", + /** + * Graduate + */ + Graduate: "graduate", + /** + * High School + */ + HighSchool: "high_school", + /** + * Non-Credit + */ + Noncredit: "noncredit", + /** + * Advanced + */ + Advanced: "advanced", + /** + * Intermediate + */ + Intermediate: "intermediate", + /** + * Introductory + */ + Introductory: "introductory", +} as const + +export type LevelEnum = (typeof LevelEnum)[keyof typeof LevelEnum] + +/** + * Serializer containing only parent and child ids for a learning path relationship + * @export + * @interface MicroLearningPathRelationship + */ +export interface MicroLearningPathRelationship { + /** + * + * @type {number} + * @memberof MicroLearningPathRelationship + */ + id: number + /** + * The id of the parent learning resource + * @type {number} + * @memberof MicroLearningPathRelationship + */ + parent: number + /** + * + * @type {number} + * @memberof MicroLearningPathRelationship + */ + child: number +} +/** + * Serializer containing only parent and child ids for a user list relationship + * @export + * @interface MicroUserListRelationship + */ +export interface MicroUserListRelationship { + /** + * + * @type {number} + * @memberof MicroUserListRelationship + */ + id: number + /** + * The id of the parent learning resource + * @type {number} + * @memberof MicroUserListRelationship + */ + parent: number + /** + * + * @type {number} + * @memberof MicroUserListRelationship + */ + child: number +} +/** + * + * @export + * @enum {string} + */ + +export const NullEnumDescriptions = { + null: "", +} as const + +export const NullEnum = { + Null: "null", +} as const + +export type NullEnum = (typeof NullEnum)[keyof typeof NullEnum] + +/** + * * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @export + * @enum {string} + */ + +export const OfferedByEnumDescriptions = { + mitx: "MITx", + ocw: "MIT OpenCourseWare", + bootcamps: "Bootcamps", + xpro: "MIT xPRO", + mitpe: "MIT Professional Education", + see: "MIT Sloan Executive Education", + climate: "MIT Climate", +} as const + +export const OfferedByEnum = { + /** + * MITx + */ + Mitx: "mitx", + /** + * MIT OpenCourseWare + */ + Ocw: "ocw", + /** + * Bootcamps + */ + Bootcamps: "bootcamps", + /** + * MIT xPRO + */ + Xpro: "xpro", + /** + * MIT Professional Education + */ + Mitpe: "mitpe", + /** + * MIT Sloan Executive Education + */ + See: "see", + /** + * MIT Climate + */ + Climate: "climate", +} as const + +export type OfferedByEnum = (typeof OfferedByEnum)[keyof typeof OfferedByEnum] + +/** + * + * @export + * @interface PaginatedContentFileList + */ +export interface PaginatedContentFileList { + /** + * + * @type {number} + * @memberof PaginatedContentFileList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedContentFileList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedContentFileList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedContentFileList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedCourseResourceList + */ +export interface PaginatedCourseResourceList { + /** + * + * @type {number} + * @memberof PaginatedCourseResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedCourseResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedCourseResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedCourseResourceList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningPathRelationshipList + */ +export interface PaginatedLearningPathRelationshipList { + /** + * + * @type {number} + * @memberof PaginatedLearningPathRelationshipList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningPathRelationshipList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningPathRelationshipList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningPathRelationshipList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningPathResourceList + */ +export interface PaginatedLearningPathResourceList { + /** + * + * @type {number} + * @memberof PaginatedLearningPathResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningPathResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningPathResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningPathResourceList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceContentTagList + */ +export interface PaginatedLearningResourceContentTagList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceContentTagList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceContentTagList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceContentTagList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceContentTagList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceDepartmentList + */ +export interface PaginatedLearningResourceDepartmentList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceDepartmentList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceDepartmentList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceDepartmentList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceDepartmentList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceDisplayInfoResponseList + */ +export interface PaginatedLearningResourceDisplayInfoResponseList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceDisplayInfoResponseList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceDisplayInfoResponseList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceDisplayInfoResponseList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceDisplayInfoResponseList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceList + */ +export interface PaginatedLearningResourceList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceOfferorDetailList + */ +export interface PaginatedLearningResourceOfferorDetailList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceOfferorDetailList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceOfferorDetailList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceOfferorDetailList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceOfferorDetailList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourcePlatformList + */ +export interface PaginatedLearningResourcePlatformList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourcePlatformList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourcePlatformList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourcePlatformList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourcePlatformList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceRelationshipList + */ +export interface PaginatedLearningResourceRelationshipList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceRelationshipList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceRelationshipList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceRelationshipList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceRelationshipList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceSchoolList + */ +export interface PaginatedLearningResourceSchoolList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceSchoolList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceSchoolList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceSchoolList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceSchoolList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceSummaryList + */ +export interface PaginatedLearningResourceSummaryList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceSummaryList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceSummaryList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceSummaryList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceSummaryList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedLearningResourceTopicList + */ +export interface PaginatedLearningResourceTopicList { + /** + * + * @type {number} + * @memberof PaginatedLearningResourceTopicList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedLearningResourceTopicList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedLearningResourceTopicList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedLearningResourceTopicList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedPodcastEpisodeResourceList + */ +export interface PaginatedPodcastEpisodeResourceList { + /** + * + * @type {number} + * @memberof PaginatedPodcastEpisodeResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedPodcastEpisodeResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedPodcastEpisodeResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedPodcastEpisodeResourceList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedPodcastResourceList + */ +export interface PaginatedPodcastResourceList { + /** + * + * @type {number} + * @memberof PaginatedPodcastResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedPodcastResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedPodcastResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedPodcastResourceList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedProgramResourceList + */ +export interface PaginatedProgramResourceList { + /** + * + * @type {number} + * @memberof PaginatedProgramResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedProgramResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedProgramResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedProgramResourceList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedUserListList + */ +export interface PaginatedUserListList { + /** + * + * @type {number} + * @memberof PaginatedUserListList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedUserListList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedUserListList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedUserListList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedUserListRelationshipList + */ +export interface PaginatedUserListRelationshipList { + /** + * + * @type {number} + * @memberof PaginatedUserListRelationshipList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedUserListRelationshipList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedUserListRelationshipList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedUserListRelationshipList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedVideoPlaylistResourceList + */ +export interface PaginatedVideoPlaylistResourceList { + /** + * + * @type {number} + * @memberof PaginatedVideoPlaylistResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedVideoPlaylistResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedVideoPlaylistResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedVideoPlaylistResourceList + */ + results: Array +} +/** + * + * @export + * @interface PaginatedVideoResourceList + */ +export interface PaginatedVideoResourceList { + /** + * + * @type {number} + * @memberof PaginatedVideoResourceList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedVideoResourceList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedVideoResourceList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedVideoResourceList + */ + results: Array +} +/** + * Create serializer for nested learning path items. The parent is derived from the nested route and must not be client-supplied. + * @export + * @interface PatchedLearningPathRelationshipCreateRequest + */ +export interface PatchedLearningPathRelationshipCreateRequest { + /** + * + * @type {number} + * @memberof PatchedLearningPathRelationshipCreateRequest + */ + position?: number + /** + * + * @type {number} + * @memberof PatchedLearningPathRelationshipCreateRequest + */ + child?: number +} +/** + * CRUD serializer for LearningPath resources + * @export + * @interface PatchedLearningPathResourceRequest + */ +export interface PatchedLearningPathResourceRequest { + /** + * + * @type {Array} + * @memberof PatchedLearningPathResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + title?: string + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof PatchedLearningPathResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof PatchedLearningPathResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof PatchedLearningPathResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof PatchedLearningPathResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof PatchedLearningPathResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof PatchedLearningPathResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof PatchedLearningPathResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof PatchedLearningPathResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof PatchedLearningPathResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof PatchedLearningPathResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof PatchedLearningPathResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof PatchedLearningPathResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * CRUD serializer for LearningResourceRelationship + * @export + * @interface PatchedLearningResourceRelationshipRequest + */ +export interface PatchedLearningResourceRelationshipRequest { + /** + * + * @type {number} + * @memberof PatchedLearningResourceRelationshipRequest + */ + position?: number + /** + * + * @type {RelationTypeEnum} + * @memberof PatchedLearningResourceRelationshipRequest + */ + relation_type?: RelationTypeEnum + /** + * + * @type {number} + * @memberof PatchedLearningResourceRelationshipRequest + */ + parent?: number + /** + * + * @type {number} + * @memberof PatchedLearningResourceRelationshipRequest + */ + child?: number +} + +/** + * Serializer for UserListRelationship model + * @export + * @interface PatchedUserListRelationshipRequest + */ +export interface PatchedUserListRelationshipRequest { + /** + * + * @type {number} + * @memberof PatchedUserListRelationshipRequest + */ + position?: number + /** + * + * @type {number} + * @memberof PatchedUserListRelationshipRequest + */ + parent?: number + /** + * + * @type {number} + * @memberof PatchedUserListRelationshipRequest + */ + child?: number +} +/** + * Simplified serializer for UserList model. + * @export + * @interface PatchedUserListRequest + */ +export interface PatchedUserListRequest { + /** + * + * @type {Array} + * @memberof PatchedUserListRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof PatchedUserListRequest + */ + title?: string + /** + * + * @type {string} + * @memberof PatchedUserListRequest + */ + description?: string + /** + * + * @type {PrivacyLevelEnum} + * @memberof PatchedUserListRequest + */ + privacy_level?: PrivacyLevelEnum +} + +/** + * Serializer for PercolateQuery objects + * @export + * @interface PercolateQuery + */ +export interface PercolateQuery { + /** + * + * @type {number} + * @memberof PercolateQuery + */ + id: number + /** + * + * @type {string} + * @memberof PercolateQuery + */ + source_description: string + /** + * + * @type {string} + * @memberof PercolateQuery + */ + source_label: string + /** + * + * @type {any} + * @memberof PercolateQuery + */ + original_query: any + /** + * + * @type {any} + * @memberof PercolateQuery + */ + query: any + /** + * + * @type {SourceTypeEnum} + * @memberof PercolateQuery + */ + source_type: SourceTypeEnum + /** + * Friendly display label for the query + * @type {string} + * @memberof PercolateQuery + */ + display_label?: string +} + +/** + * PercolateQuerySubscriptionRequestSerializer with OpenAPI annotations for Percolate Subscription requests + * @export + * @interface PercolateQuerySubscriptionRequestRequest + */ +export interface PercolateQuerySubscriptionRequestRequest { + /** + * The search text + * @type {string} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + q?: string + /** + * The initial index from which to return the results + * @type {number} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + offset?: number + /** + * Number of results to return per page + * @type {number} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + limit?: number + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + offered_by?: Array + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + platform?: Array + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + topic?: Array + /** + * The ocw topic name. + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + ocw_topic?: Array + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + dev_mode?: boolean | null + /** + * The id value for the learning resource + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + id?: Array + /** + * + * @type {SortbyEnum} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + sortby?: SortbyEnum + /** + * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + resource_type?: Array + /** + * + * @type {boolean} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + free?: boolean | null + /** + * + * @type {boolean} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + professional?: boolean | null + /** + * Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @type {number} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + yearly_decay_percent?: number | null + /** + * True if the learning resource offers a certificate + * @type {boolean} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + certification?: boolean | null + /** + * The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + certification_type?: Array + /** + * The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + department?: Array + /** + * + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + level?: Array + /** + * The course feature. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + course_feature?: Array + /** + * Show resource counts by category + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + aggregations?: Array + /** + * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + delivery?: Array + /** + * + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + resource_type_group?: Array + /** + * The resource category for the resource + * @type {Array} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + resource_category?: Array + /** + * + * @type {SearchModeEnum} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + search_mode?: SearchModeEnum + /** + * Allowed distance for phrase search + * @type {number} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + slop?: number | null + /** + * Minimum score value a text query result needs to have to be displayed + * @type {number} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + min_score?: number | null + /** + * Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @type {number} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + max_incompleteness_penalty?: number | null + /** + * Score weight for content file data. 1 is the default. 0 means content files are ignored + * @type {number} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + content_file_score_weight?: number | null + /** + * Whether to include select OCW content files in search results. + * @type {boolean} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + show_ocw_files?: boolean | null + /** + * + * @type {SourceTypeEnum} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + source_type?: SourceTypeEnum +} + +/** + * * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @export + * @enum {string} + */ + +export const PercolateQuerySubscriptionRequestResourceTypeEnumDescriptions = { + course: "course", + program: "program", + learning_path: "learning path", + podcast: "podcast", + podcast_episode: "podcast episode", + video: "video", + video_playlist: "video playlist", + document: "document", +} as const + +export const PercolateQuerySubscriptionRequestResourceTypeEnum = { + /** + * course + */ + Course: "course", + /** + * program + */ + Program: "program", + /** + * learning path + */ + LearningPath: "learning_path", + /** + * podcast + */ + Podcast: "podcast", + /** + * podcast episode + */ + PodcastEpisode: "podcast_episode", + /** + * video + */ + Video: "video", + /** + * video playlist + */ + VideoPlaylist: "video_playlist", + /** + * document + */ + Document: "document", +} as const + +export type PercolateQuerySubscriptionRequestResourceTypeEnum = + (typeof PercolateQuerySubscriptionRequestResourceTypeEnum)[keyof typeof PercolateQuerySubscriptionRequestResourceTypeEnum] + +/** + * * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @export + * @enum {string} + */ + +export const PlatformEnumDescriptions = { + edx: "edX", + ocw: "MIT OpenCourseWare", + oll: "Open Learning Library", + mitxonline: "MITx Online", + bootcamps: "Bootcamps", + xpro: "MIT xPRO", + csail: "CSAIL", + mitpe: "MIT Professional Education", + see: "MIT Sloan Executive Education", + scc: "Schwarzman College of Computing", + ctl: "Center for Transportation & Logistics", + whu: "WHU", + susskind: "Susskind", + globalalumni: "Global Alumni", + simplilearn: "Simplilearn", + emeritus: "Emeritus", + podcast: "Podcast", + youtube: "YouTube", + canvas: "Canvas", + climate: "MIT Climate", + ovs: "ODL Video Service", +} as const + +export const PlatformEnum = { + /** + * edX + */ + Edx: "edx", + /** + * MIT OpenCourseWare + */ + Ocw: "ocw", + /** + * Open Learning Library + */ + Oll: "oll", + /** + * MITx Online + */ + Mitxonline: "mitxonline", + /** + * Bootcamps + */ + Bootcamps: "bootcamps", + /** + * MIT xPRO + */ + Xpro: "xpro", + /** + * CSAIL + */ + Csail: "csail", + /** + * MIT Professional Education + */ + Mitpe: "mitpe", + /** + * MIT Sloan Executive Education + */ + See: "see", + /** + * Schwarzman College of Computing + */ + Scc: "scc", + /** + * Center for Transportation & Logistics + */ + Ctl: "ctl", + /** + * WHU + */ + Whu: "whu", + /** + * Susskind + */ + Susskind: "susskind", + /** + * Global Alumni + */ + Globalalumni: "globalalumni", + /** + * Simplilearn + */ + Simplilearn: "simplilearn", + /** + * Emeritus + */ + Emeritus: "emeritus", + /** + * Podcast + */ + Podcast: "podcast", + /** + * YouTube + */ + Youtube: "youtube", + /** + * Canvas + */ + Canvas: "canvas", + /** + * MIT Climate + */ + Climate: "climate", + /** + * ODL Video Service + */ + Ovs: "ovs", +} as const + +export type PlatformEnum = (typeof PlatformEnum)[keyof typeof PlatformEnum] + +/** + * Serializer for Podcasts + * @export + * @interface Podcast + */ +export interface Podcast { + /** + * + * @type {number} + * @memberof Podcast + */ + id: number + /** + * + * @type {number} + * @memberof Podcast + */ + episode_count: number + /** + * + * @type {string} + * @memberof Podcast + */ + apple_podcasts_url?: string | null + /** + * + * @type {string} + * @memberof Podcast + */ + google_podcasts_url?: string | null + /** + * + * @type {string} + * @memberof Podcast + */ + rss_url?: string | null +} +/** + * Serializer for PodcastEpisode + * @export + * @interface PodcastEpisode + */ +export interface PodcastEpisode { + /** + * + * @type {number} + * @memberof PodcastEpisode + */ + id: number + /** + * Get the podcast id(s) the episode belongs to + * @type {Array} + * @memberof PodcastEpisode + */ + podcasts: Array + /** + * + * @type {string} + * @memberof PodcastEpisode + */ + transcript?: string + /** + * + * @type {string} + * @memberof PodcastEpisode + */ + audio_url: string + /** + * + * @type {string} + * @memberof PodcastEpisode + */ + episode_link?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisode + */ + duration?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisode + */ + rss?: string | null +} +/** + * Serializer for PodcastEpisode + * @export + * @interface PodcastEpisodeRequest + */ +export interface PodcastEpisodeRequest { + /** + * + * @type {string} + * @memberof PodcastEpisodeRequest + */ + transcript?: string + /** + * + * @type {string} + * @memberof PodcastEpisodeRequest + */ + audio_url: string + /** + * + * @type {string} + * @memberof PodcastEpisodeRequest + */ + episode_link?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeRequest + */ + duration?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeRequest + */ + rss?: string | null +} +/** + * Serializer for podcast episode resources + * @export + * @interface PodcastEpisodeResource + */ +export interface PodcastEpisodeResource { + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + id: number + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof PodcastEpisodeResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof PodcastEpisodeResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof PodcastEpisodeResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof PodcastEpisodeResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + views: number + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof PodcastEpisodeResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof PodcastEpisodeResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + format: Array + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof PodcastEpisodeResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof PodcastEpisodeResource + */ + best_run_id: number | null + /** + * + * @type {PodcastEpisodeResourceResourceTypeEnum} + * @memberof PodcastEpisodeResource + */ + resource_type: PodcastEpisodeResourceResourceTypeEnum + /** + * + * @type {PodcastEpisode} + * @memberof PodcastEpisodeResource + */ + podcast_episode: PodcastEpisode + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + title: string + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + description?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + url?: string | null + /** + * The display category for this resource. + * @type {string} + * @memberof PodcastEpisodeResource + */ + resource_category: string + /** + * + * @type {Array} + * @memberof PodcastEpisodeResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof PodcastEpisodeResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + location?: string + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + duration?: string + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof PodcastEpisodeResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResource + */ + require_summaries: boolean +} + +/** + * Serializer for podcast episode resources + * @export + * @interface PodcastEpisodeResourceRequest + */ +export interface PodcastEpisodeResourceRequest { + /** + * + * @type {Array} + * @memberof PodcastEpisodeResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof PodcastEpisodeResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof PodcastEpisodeResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof PodcastEpisodeResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof PodcastEpisodeResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof PodcastEpisodeResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof PodcastEpisodeResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof PodcastEpisodeResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof PodcastEpisodeResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof PodcastEpisodeResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof PodcastEpisodeResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const PodcastEpisodeResourceResourceTypeEnumDescriptions = { + podcast_episode: "", +} as const + +export const PodcastEpisodeResourceResourceTypeEnum = { + PodcastEpisode: "podcast_episode", +} as const + +export type PodcastEpisodeResourceResourceTypeEnum = + (typeof PodcastEpisodeResourceResourceTypeEnum)[keyof typeof PodcastEpisodeResourceResourceTypeEnum] + +/** + * Serializer for Podcasts + * @export + * @interface PodcastRequest + */ +export interface PodcastRequest { + /** + * + * @type {number} + * @memberof PodcastRequest + */ + episode_count: number + /** + * + * @type {string} + * @memberof PodcastRequest + */ + apple_podcasts_url?: string | null + /** + * + * @type {string} + * @memberof PodcastRequest + */ + google_podcasts_url?: string | null + /** + * + * @type {string} + * @memberof PodcastRequest + */ + rss_url?: string | null +} +/** + * Serializer for podcast resources + * @export + * @interface PodcastResource + */ +export interface PodcastResource { + /** + * + * @type {number} + * @memberof PodcastResource + */ + id: number + /** + * + * @type {Array} + * @memberof PodcastResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof PodcastResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof PodcastResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof PodcastResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof PodcastResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof PodcastResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof PodcastResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof PodcastResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof PodcastResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof PodcastResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof PodcastResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof PodcastResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof PodcastResource + */ + views: number + /** + * + * @type {Array} + * @memberof PodcastResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof PodcastResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof PodcastResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof PodcastResource + */ + format: Array + /** + * + * @type {Array} + * @memberof PodcastResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof PodcastResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof PodcastResource + */ + best_run_id: number | null + /** + * + * @type {PodcastResourceResourceTypeEnum} + * @memberof PodcastResource + */ + resource_type: PodcastResourceResourceTypeEnum + /** + * + * @type {Podcast} + * @memberof PodcastResource + */ + podcast: Podcast + /** + * + * @type {string} + * @memberof PodcastResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof PodcastResource + */ + title: string + /** + * + * @type {string} + * @memberof PodcastResource + */ + description?: string | null + /** + * + * @type {string} + * @memberof PodcastResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof PodcastResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof PodcastResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof PodcastResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof PodcastResource + */ + url?: string | null + /** + * The display category for this resource. + * @type {string} + * @memberof PodcastResource + */ + resource_category: string + /** + * + * @type {Array} + * @memberof PodcastResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof PodcastResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof PodcastResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof PodcastResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof PodcastResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof PodcastResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof PodcastResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof PodcastResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof PodcastResource + */ + location?: string + /** + * + * @type {string} + * @memberof PodcastResource + */ + duration?: string + /** + * + * @type {number} + * @memberof PodcastResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof PodcastResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof PodcastResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof PodcastResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof PodcastResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof PodcastResource + */ + require_summaries: boolean +} + +/** + * Serializer for podcast resources + * @export + * @interface PodcastResourceRequest + */ +export interface PodcastResourceRequest { + /** + * + * @type {Array} + * @memberof PodcastResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof PodcastResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof PodcastResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof PodcastResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof PodcastResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof PodcastResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof PodcastResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof PodcastResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof PodcastResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof PodcastResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof PodcastResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof PodcastResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof PodcastResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const PodcastResourceResourceTypeEnumDescriptions = { + podcast: "", +} as const + +export const PodcastResourceResourceTypeEnum = { + Podcast: "podcast", +} as const + +export type PodcastResourceResourceTypeEnum = + (typeof PodcastResourceResourceTypeEnum)[keyof typeof PodcastResourceResourceTypeEnum] + +/** + * * `private` - private * `unlisted` - unlisted + * @export + * @enum {string} + */ + +export const PrivacyLevelEnumDescriptions = { + private: "private", + unlisted: "unlisted", +} as const + +export const PrivacyLevelEnum = { + /** + * private + */ + Private: "private", + /** + * unlisted + */ + Unlisted: "unlisted", +} as const + +export type PrivacyLevelEnum = + (typeof PrivacyLevelEnum)[keyof typeof PrivacyLevelEnum] + +/** + * Serializer for the Program model + * @export + * @interface Program + */ +export interface Program { + /** + * + * @type {number} + * @memberof Program + */ + course_count: number + /** + * + * @type {number} + * @memberof Program + */ + program_count: number +} +/** + * Serializer for program resources + * @export + * @interface ProgramResource + */ +export interface ProgramResource { + /** + * + * @type {number} + * @memberof ProgramResource + */ + id: number + /** + * + * @type {Array} + * @memberof ProgramResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof ProgramResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof ProgramResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof ProgramResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof ProgramResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof ProgramResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof ProgramResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof ProgramResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof ProgramResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof ProgramResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof ProgramResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof ProgramResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof ProgramResource + */ + views: number + /** + * + * @type {Array} + * @memberof ProgramResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof ProgramResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof ProgramResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof ProgramResource + */ + format: Array + /** + * + * @type {Array} + * @memberof ProgramResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof ProgramResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof ProgramResource + */ + best_run_id: number | null + /** + * + * @type {ProgramResourceResourceTypeEnum} + * @memberof ProgramResource + */ + resource_type: ProgramResourceResourceTypeEnum + /** + * + * @type {Program} + * @memberof ProgramResource + */ + program: Program + /** + * + * @type {string} + * @memberof ProgramResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof ProgramResource + */ + title: string + /** + * + * @type {string} + * @memberof ProgramResource + */ + description?: string | null + /** + * + * @type {string} + * @memberof ProgramResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof ProgramResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof ProgramResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof ProgramResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof ProgramResource + */ + url?: string | null + /** + * The display category for this resource. + * @type {string} + * @memberof ProgramResource + */ + resource_category: string + /** + * + * @type {Array} + * @memberof ProgramResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof ProgramResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof ProgramResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof ProgramResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof ProgramResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof ProgramResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof ProgramResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof ProgramResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof ProgramResource + */ + location?: string + /** + * + * @type {string} + * @memberof ProgramResource + */ + duration?: string + /** + * + * @type {number} + * @memberof ProgramResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof ProgramResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof ProgramResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof ProgramResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof ProgramResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof ProgramResource + */ + require_summaries: boolean +} + +/** + * Serializer for program resources + * @export + * @interface ProgramResourceRequest + */ +export interface ProgramResourceRequest { + /** + * + * @type {Array} + * @memberof ProgramResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof ProgramResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof ProgramResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof ProgramResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof ProgramResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof ProgramResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof ProgramResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof ProgramResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof ProgramResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof ProgramResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof ProgramResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof ProgramResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof ProgramResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const ProgramResourceResourceTypeEnumDescriptions = { + program: "", +} as const + +export const ProgramResourceResourceTypeEnum = { + Program: "program", +} as const + +export type ProgramResourceResourceTypeEnum = + (typeof ProgramResourceResourceTypeEnum)[keyof typeof ProgramResourceResourceTypeEnum] + +/** + * * `PROGRAM_COURSES` - Program Courses * `PROGRAM_PROGRAMS` - Program Programs * `LEARNING_PATH_ITEMS` - Learning Path Items * `PODCAST_EPISODES` - Podcast Episodes * `PLAYLIST_VIDEOS` - Playlist Videos * `COURSE_LEARNING_MATERIALS` - Course Learning Materials + * @export + * @enum {string} + */ + +export const RelationTypeEnumDescriptions = { + PROGRAM_COURSES: "Program Courses", + PROGRAM_PROGRAMS: "Program Programs", + LEARNING_PATH_ITEMS: "Learning Path Items", + PODCAST_EPISODES: "Podcast Episodes", + PLAYLIST_VIDEOS: "Playlist Videos", + COURSE_LEARNING_MATERIALS: "Course Learning Materials", +} as const + +export const RelationTypeEnum = { + /** + * Program Courses + */ + ProgramCourses: "PROGRAM_COURSES", + /** + * Program Programs + */ + ProgramPrograms: "PROGRAM_PROGRAMS", + /** + * Learning Path Items + */ + LearningPathItems: "LEARNING_PATH_ITEMS", + /** + * Podcast Episodes + */ + PodcastEpisodes: "PODCAST_EPISODES", + /** + * Playlist Videos + */ + PlaylistVideos: "PLAYLIST_VIDEOS", + /** + * Course Learning Materials + */ + CourseLearningMaterials: "COURSE_LEARNING_MATERIALS", +} as const + +export type RelationTypeEnum = + (typeof RelationTypeEnum)[keyof typeof RelationTypeEnum] + +/** + * Serializer for child course/program entries within a program. + * @export + * @interface ResourceChildSummary + */ +export interface ResourceChildSummary { + /** + * + * @type {string} + * @memberof ResourceChildSummary + */ + title: string + /** + * + * @type {string} + * @memberof ResourceChildSummary + */ + readable_id: string + /** + * + * @type {string} + * @memberof ResourceChildSummary + */ + description: string + /** + * + * @type {string} + * @memberof ResourceChildSummary + */ + resource_type: string + /** + * + * @type {Array} + * @memberof ResourceChildSummary + */ + topics: Array + /** + * + * @type {string} + * @memberof ResourceChildSummary + */ + parent_program?: string +} +/** + * * `course` - course * `program` - program * `learning_path` - learning_path * `podcast` - podcast * `podcast_episode` - podcast_episode * `video` - video * `video_playlist` - video_playlist * `document` - document + * @export + * @enum {string} + */ + +export const ResourceTypeEnumDescriptions = { + course: "course", + program: "program", + learning_path: "learning_path", + podcast: "podcast", + podcast_episode: "podcast_episode", + video: "video", + video_playlist: "video_playlist", + document: "document", +} as const + +export const ResourceTypeEnum = { + /** + * course + */ + Course: "course", + /** + * program + */ + Program: "program", + /** + * learning_path + */ + LearningPath: "learning_path", + /** + * podcast + */ + Podcast: "podcast", + /** + * podcast_episode + */ + PodcastEpisode: "podcast_episode", + /** + * video + */ + Video: "video", + /** + * video_playlist + */ + VideoPlaylist: "video_playlist", + /** + * document + */ + Document: "document", +} as const + +export type ResourceTypeEnum = + (typeof ResourceTypeEnum)[keyof typeof ResourceTypeEnum] + +/** + * * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @export + * @enum {string} + */ + +export const ResourceTypeGroupEnumDescriptions = { + course: "Course", + program: "Program", + learning_material: "Learning Material", +} as const + +export const ResourceTypeGroupEnum = { + /** + * Course + */ + Course: "course", + /** + * Program + */ + Program: "program", + /** + * Learning Material + */ + LearningMaterial: "learning_material", +} as const + +export type ResourceTypeGroupEnum = + (typeof ResourceTypeGroupEnum)[keyof typeof ResourceTypeGroupEnum] + +/** + * * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @export + * @enum {string} + */ + +export const SearchModeEnumDescriptions = { + phrase: "phrase", + best_fields: "best_fields", + most_fields: "most_fields", + hybrid: "hybrid", +} as const + +export const SearchModeEnum = { + /** + * phrase + */ + Phrase: "phrase", + /** + * best_fields + */ + BestFields: "best_fields", + /** + * most_fields + */ + MostFields: "most_fields", + /** + * hybrid + */ + Hybrid: "hybrid", +} as const + +export type SearchModeEnum = + (typeof SearchModeEnum)[keyof typeof SearchModeEnum] + +/** + * * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @export + * @enum {string} + */ + +export const SortbyEnumDescriptions = { + featured: "Featured", + id: "Object ID ascending", + "-id": "Object ID descending", + readable_id: "Readable ID ascending", + "-readable_id": "Readable ID descending", + last_modified: "Last Modified Date ascending", + "-last_modified": "Last Modified Date descending", + new: "Newest resources first", + start_date: "Start Date ascending", + "-start_date": "Start Date descending", + mitcoursenumber: "MIT course number ascending", + "-mitcoursenumber": "MIT course number descending", + views: "Popularity ascending", + "-views": "Popularity descending", + upcoming: "Next start date ascending", +} as const + +export const SortbyEnum = { + /** + * Featured + */ + Featured: "featured", + /** + * Object ID ascending + */ + Id: "id", + /** + * Object ID descending + */ + Id2: "-id", + /** + * Readable ID ascending + */ + ReadableId: "readable_id", + /** + * Readable ID descending + */ + ReadableId2: "-readable_id", + /** + * Last Modified Date ascending + */ + LastModified: "last_modified", + /** + * Last Modified Date descending + */ + LastModified2: "-last_modified", + /** + * Newest resources first + */ + New: "new", + /** + * Start Date ascending + */ + StartDate: "start_date", + /** + * Start Date descending + */ + StartDate2: "-start_date", + /** + * MIT course number ascending + */ + Mitcoursenumber: "mitcoursenumber", + /** + * MIT course number descending + */ + Mitcoursenumber2: "-mitcoursenumber", + /** + * Popularity ascending + */ + Views: "views", + /** + * Popularity descending + */ + Views2: "-views", + /** + * Next start date ascending + */ + Upcoming: "upcoming", +} as const + +export type SortbyEnum = (typeof SortbyEnum)[keyof typeof SortbyEnum] + +/** + * * `search_subscription_type` - search_subscription_type * `channel_subscription_type` - channel_subscription_type + * @export + * @enum {string} + */ + +export const SourceTypeEnumDescriptions = { + search_subscription_type: "search_subscription_type", + channel_subscription_type: "channel_subscription_type", +} as const + +export const SourceTypeEnum = { + /** + * search_subscription_type + */ + SearchSubscriptionType: "search_subscription_type", + /** + * channel_subscription_type + */ + ChannelSubscriptionType: "channel_subscription_type", +} as const + +export type SourceTypeEnum = + (typeof SourceTypeEnum)[keyof typeof SourceTypeEnum] + +/** + * Simplified serializer for UserList model. + * @export + * @interface UserList + */ +export interface UserList { + /** + * + * @type {number} + * @memberof UserList + */ + id: number + /** + * + * @type {Array} + * @memberof UserList + */ + topics?: Array + /** + * Return the number of items in the list + * @type {number} + * @memberof UserList + */ + item_count: number + /** + * Return the image of the first item + * @type {{ [key: string]: any; }} + * @memberof UserList + */ + image: { [key: string]: any } + /** + * + * @type {string} + * @memberof UserList + */ + title: string + /** + * + * @type {string} + * @memberof UserList + */ + description?: string + /** + * + * @type {PrivacyLevelEnum} + * @memberof UserList + */ + privacy_level?: PrivacyLevelEnum + /** + * + * @type {number} + * @memberof UserList + */ + author: number +} + +/** + * Serializer for UserListRelationship model + * @export + * @interface UserListRelationship + */ +export interface UserListRelationship { + /** + * + * @type {number} + * @memberof UserListRelationship + */ + id: number + /** + * + * @type {LearningResource} + * @memberof UserListRelationship + */ + resource: LearningResource + /** + * + * @type {number} + * @memberof UserListRelationship + */ + position?: number + /** + * + * @type {number} + * @memberof UserListRelationship + */ + parent: number + /** + * + * @type {number} + * @memberof UserListRelationship + */ + child: number +} +/** + * Serializer for UserListRelationship model + * @export + * @interface UserListRelationshipRequest + */ +export interface UserListRelationshipRequest { + /** + * + * @type {number} + * @memberof UserListRelationshipRequest + */ + position?: number + /** + * + * @type {number} + * @memberof UserListRelationshipRequest + */ + parent: number + /** + * + * @type {number} + * @memberof UserListRelationshipRequest + */ + child: number +} +/** + * Simplified serializer for UserList model. + * @export + * @interface UserListRequest + */ +export interface UserListRequest { + /** + * + * @type {Array} + * @memberof UserListRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof UserListRequest + */ + title: string + /** + * + * @type {string} + * @memberof UserListRequest + */ + description?: string + /** + * + * @type {PrivacyLevelEnum} + * @memberof UserListRequest + */ + privacy_level?: PrivacyLevelEnum +} + +/** + * Serializer for the Video model + * @export + * @interface Video + */ +export interface Video { + /** + * + * @type {number} + * @memberof Video + */ + id: number + /** + * + * @type {Array} + * @memberof Video + */ + caption_urls: Array + /** + * + * @type {string} + * @memberof Video + */ + streaming_url: string | null + /** + * + * @type {string} + * @memberof Video + */ + thumbnail_url: string | null + /** + * + * @type {string} + * @memberof Video + */ + duration: string +} +/** + * Serializer for the VideoChannel model + * @export + * @interface VideoChannel + */ +export interface VideoChannel { + /** + * + * @type {string} + * @memberof VideoChannel + */ + channel_id: string + /** + * + * @type {string} + * @memberof VideoChannel + */ + title: string +} +/** + * Serializer for the VideoChannel model + * @export + * @interface VideoChannelRequest + */ +export interface VideoChannelRequest { + /** + * + * @type {string} + * @memberof VideoChannelRequest + */ + channel_id: string + /** + * + * @type {string} + * @memberof VideoChannelRequest + */ + title: string +} +/** + * Serializer for the VideoPlaylist model + * @export + * @interface VideoPlaylist + */ +export interface VideoPlaylist { + /** + * + * @type {number} + * @memberof VideoPlaylist + */ + id: number + /** + * + * @type {VideoChannel} + * @memberof VideoPlaylist + */ + channel: VideoChannel | null + /** + * + * @type {number} + * @memberof VideoPlaylist + */ + video_count: number +} +/** + * Serializer for the VideoPlaylist model + * @export + * @interface VideoPlaylistRequest + */ +export interface VideoPlaylistRequest { + /** + * + * @type {number} + * @memberof VideoPlaylistRequest + */ + video_count: number +} +/** + * Serializer for video playlist resources + * @export + * @interface VideoPlaylistResource + */ +export interface VideoPlaylistResource { + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + id: number + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof VideoPlaylistResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof VideoPlaylistResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof VideoPlaylistResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof VideoPlaylistResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof VideoPlaylistResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + views: number + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof VideoPlaylistResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof VideoPlaylistResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + format: Array + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof VideoPlaylistResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof VideoPlaylistResource + */ + best_run_id: number | null + /** + * + * @type {VideoPlaylistResourceResourceTypeEnum} + * @memberof VideoPlaylistResource + */ + resource_type: VideoPlaylistResourceResourceTypeEnum + /** + * + * @type {VideoPlaylist} + * @memberof VideoPlaylistResource + */ + video_playlist: VideoPlaylist + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + title: string + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + description?: string | null + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof VideoPlaylistResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + url?: string | null + /** + * The display category for this resource. + * @type {string} + * @memberof VideoPlaylistResource + */ + resource_category: string + /** + * + * @type {Array} + * @memberof VideoPlaylistResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof VideoPlaylistResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof VideoPlaylistResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof VideoPlaylistResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof VideoPlaylistResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + location?: string + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + duration?: string + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof VideoPlaylistResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof VideoPlaylistResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof VideoPlaylistResource + */ + require_summaries: boolean +} + +/** + * Serializer for video playlist resources + * @export + * @interface VideoPlaylistResourceRequest + */ +export interface VideoPlaylistResourceRequest { + /** + * + * @type {Array} + * @memberof VideoPlaylistResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + description?: string | null + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof VideoPlaylistResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof VideoPlaylistResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof VideoPlaylistResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof VideoPlaylistResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof VideoPlaylistResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof VideoPlaylistResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof VideoPlaylistResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof VideoPlaylistResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof VideoPlaylistResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof VideoPlaylistResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof VideoPlaylistResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof VideoPlaylistResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const VideoPlaylistResourceResourceTypeEnumDescriptions = { + video_playlist: "", +} as const + +export const VideoPlaylistResourceResourceTypeEnum = { + VideoPlaylist: "video_playlist", +} as const + +export type VideoPlaylistResourceResourceTypeEnum = + (typeof VideoPlaylistResourceResourceTypeEnum)[keyof typeof VideoPlaylistResourceResourceTypeEnum] + +/** + * Serializer for the Video model + * @export + * @interface VideoRequest + */ +export interface VideoRequest { + /** + * + * @type {string} + * @memberof VideoRequest + */ + duration: string +} +/** + * Serializer for video resources + * @export + * @interface VideoResource + */ +export interface VideoResource { + /** + * + * @type {number} + * @memberof VideoResource + */ + id: number + /** + * + * @type {Array} + * @memberof VideoResource + */ + topics?: Array + /** + * + * @type {number} + * @memberof VideoResource + */ + position: number | null + /** + * + * @type {LearningResourceOfferor} + * @memberof VideoResource + */ + offered_by: LearningResourceOfferor | null + /** + * + * @type {LearningResourcePlatform} + * @memberof VideoResource + */ + platform: LearningResourcePlatform | null + /** + * + * @type {Array} + * @memberof VideoResource + */ + course_feature: Array | null + /** + * + * @type {Array} + * @memberof VideoResource + */ + departments: Array | null + /** + * + * @type {boolean} + * @memberof VideoResource + */ + certification: boolean + /** + * + * @type {CourseResourceCertificationType} + * @memberof VideoResource + */ + certification_type: CourseResourceCertificationType + /** + * + * @type {Array} + * @memberof VideoResource + */ + prices: Array + /** + * + * @type {Array} + * @memberof VideoResource + */ + resource_prices: Array + /** + * + * @type {Array} + * @memberof VideoResource + */ + runs: Array | null + /** + * + * @type {LearningResourceImage} + * @memberof VideoResource + */ + image: LearningResourceImage | null + /** + * + * @type {number} + * @memberof VideoResource + */ + views: number + /** + * + * @type {Array} + * @memberof VideoResource + */ + delivery: Array + /** + * Return true if the resource is free/has a free option + * @type {boolean} + * @memberof VideoResource + */ + free: boolean + /** + * + * @type {ResourceTypeGroupEnum} + * @memberof VideoResource + */ + resource_type_group: ResourceTypeGroupEnum + /** + * + * @type {Array} + * @memberof VideoResource + */ + format: Array + /** + * + * @type {Array} + * @memberof VideoResource + */ + pace: Array + /** + * + * @type {LearningResourceRelationshipChildField} + * @memberof VideoResource + */ + children: LearningResourceRelationshipChildField | null + /** + * Return the best run id for the resource, if it has runs + * @type {number} + * @memberof VideoResource + */ + best_run_id: number | null + /** + * + * @type {VideoResourceResourceTypeEnum} + * @memberof VideoResource + */ + resource_type: VideoResourceResourceTypeEnum + /** + * + * @type {Video} + * @memberof VideoResource + */ + video: Video | null + /** + * Get the playlist id(s) the video belongs to + * @type {Array} + * @memberof VideoResource + */ + playlists: Array + /** + * + * @type {Array} + * @memberof VideoResource + */ + content_files: Array | null + /** + * + * @type {string} + * @memberof VideoResource + */ + description: string | null + /** + * + * @type {string} + * @memberof VideoResource + */ + readable_id: string + /** + * + * @type {string} + * @memberof VideoResource + */ + title: string + /** + * + * @type {string} + * @memberof VideoResource + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof VideoResource + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof VideoResource + */ + published?: boolean + /** + * + * @type {Array} + * @memberof VideoResource + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof VideoResource + */ + url?: string | null + /** + * The display category for this resource. + * @type {string} + * @memberof VideoResource + */ + resource_category: string + /** + * + * @type {Array} + * @memberof VideoResource + */ + ocw_topics?: Array + /** + * + * @type {boolean} + * @memberof VideoResource + */ + professional: boolean + /** + * + * @type {string} + * @memberof VideoResource + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof VideoResource + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof VideoResource + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof VideoResource + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof VideoResource + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof VideoResource + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof VideoResource + */ + location?: string + /** + * + * @type {string} + * @memberof VideoResource + */ + duration?: string + /** + * + * @type {number} + * @memberof VideoResource + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof VideoResource + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof VideoResource + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof VideoResource + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof VideoResource + */ + max_weekly_hours?: number | null + /** + * + * @type {boolean} + * @memberof VideoResource + */ + require_summaries: boolean +} + +/** + * Serializer for video resources + * @export + * @interface VideoResourceRequest + */ +export interface VideoResourceRequest { + /** + * + * @type {Array} + * @memberof VideoResourceRequest + */ + topics?: Array + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + title: string + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + full_description?: string | null + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + last_modified?: string | null + /** + * + * @type {boolean} + * @memberof VideoResourceRequest + */ + published?: boolean + /** + * + * @type {Array} + * @memberof VideoResourceRequest + */ + languages?: Array | null + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + url?: string | null + /** + * + * @type {Array} + * @memberof VideoResourceRequest + */ + ocw_topics?: Array + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + next_start_date?: string | null + /** + * + * @type {AvailabilityEnum} + * @memberof VideoResourceRequest + */ + availability?: AvailabilityEnum | null + /** + * + * @type {number} + * @memberof VideoResourceRequest + */ + completeness?: number + /** + * + * @type {boolean} + * @memberof VideoResourceRequest + */ + license_cc?: boolean + /** + * + * @type {boolean} + * @memberof VideoResourceRequest + */ + test_mode?: boolean + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + continuing_ed_credits?: string | null + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + location?: string + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + duration?: string + /** + * + * @type {number} + * @memberof VideoResourceRequest + */ + min_weeks?: number | null + /** + * + * @type {number} + * @memberof VideoResourceRequest + */ + max_weeks?: number | null + /** + * + * @type {string} + * @memberof VideoResourceRequest + */ + time_commitment?: string + /** + * + * @type {number} + * @memberof VideoResourceRequest + */ + min_weekly_hours?: number | null + /** + * + * @type {number} + * @memberof VideoResourceRequest + */ + max_weekly_hours?: number | null +} + +/** + * + * @export + * @enum {string} + */ + +export const VideoResourceResourceTypeEnumDescriptions = { + video: "", +} as const + +export const VideoResourceResourceTypeEnum = { + Video: "video", +} as const + +export type VideoResourceResourceTypeEnum = + (typeof VideoResourceResourceTypeEnum)[keyof typeof VideoResourceResourceTypeEnum] + +/** + * ContentFileSearchApi - axios parameter creator + * @export + */ +export const ContentFileSearchApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Search for content files + * @summary Search + * @param {Array} [aggregations] Show resource counts by category + * @param {Array} [content_feature_type] The feature type of the content file. Possible options are at api/v1/course_features/ + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {Array} [id] The id value for the content file + * @param {number} [limit] Number of results to return per page + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {string} [q] The search text + * @param {Array} [resource_id] The id value of the parent learning resource for the content file + * @param {Array} [run_id] The id value of the run that the content file belongs to + * @param {ContentFileSearchRetrieveSortbyEnum} [sortby] if the parameter starts with \'-\' the sort is in descending order * `id` - id * `-id` - -id * `resource_readable_id` - resource_readable_id * `-resource_readable_id` - -resource_readable_id + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + contentFileSearchRetrieve: async ( + aggregations?: Array, + content_feature_type?: Array, + dev_mode?: boolean | null, + id?: Array, + limit?: number, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + q?: string, + resource_id?: Array, + run_id?: Array, + sortby?: ContentFileSearchRetrieveSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/content_file_search/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (aggregations) { + localVarQueryParameter["aggregations"] = aggregations + } + + if (content_feature_type) { + localVarQueryParameter["content_feature_type"] = content_feature_type + } + + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + + if (id) { + localVarQueryParameter["id"] = id + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (ocw_topic) { + localVarQueryParameter["ocw_topic"] = ocw_topic + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (q !== undefined) { + localVarQueryParameter["q"] = q + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (run_id) { + localVarQueryParameter["run_id"] = run_id + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * ContentFileSearchApi - functional programming interface + * @export + */ +export const ContentFileSearchApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + ContentFileSearchApiAxiosParamCreator(configuration) + return { + /** + * Search for content files + * @summary Search + * @param {Array} [aggregations] Show resource counts by category + * @param {Array} [content_feature_type] The feature type of the content file. Possible options are at api/v1/course_features/ + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {Array} [id] The id value for the content file + * @param {number} [limit] Number of results to return per page + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {string} [q] The search text + * @param {Array} [resource_id] The id value of the parent learning resource for the content file + * @param {Array} [run_id] The id value of the run that the content file belongs to + * @param {ContentFileSearchRetrieveSortbyEnum} [sortby] if the parameter starts with \'-\' the sort is in descending order * `id` - id * `-id` - -id * `resource_readable_id` - resource_readable_id * `-resource_readable_id` - -resource_readable_id + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async contentFileSearchRetrieve( + aggregations?: Array, + content_feature_type?: Array, + dev_mode?: boolean | null, + id?: Array, + limit?: number, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + q?: string, + resource_id?: Array, + run_id?: Array, + sortby?: ContentFileSearchRetrieveSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.contentFileSearchRetrieve( + aggregations, + content_feature_type, + dev_mode, + id, + limit, + ocw_topic, + offered_by, + offset, + platform, + q, + resource_id, + run_id, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["ContentFileSearchApi.contentFileSearchRetrieve"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * ContentFileSearchApi - factory interface + * @export + */ +export const ContentFileSearchApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = ContentFileSearchApiFp(configuration) + return { + /** + * Search for content files + * @summary Search + * @param {ContentFileSearchApiContentFileSearchRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + contentFileSearchRetrieve( + requestParameters: ContentFileSearchApiContentFileSearchRetrieveRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .contentFileSearchRetrieve( + requestParameters.aggregations, + requestParameters.content_feature_type, + requestParameters.dev_mode, + requestParameters.id, + requestParameters.limit, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.q, + requestParameters.resource_id, + requestParameters.run_id, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for contentFileSearchRetrieve operation in ContentFileSearchApi. + * @export + * @interface ContentFileSearchApiContentFileSearchRetrieveRequest + */ +export interface ContentFileSearchApiContentFileSearchRetrieveRequest { + /** + * Show resource counts by category + * @type {Array<'topic' | 'content_feature_type' | 'platform' | 'offered_by'>} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly aggregations?: Array + + /** + * The feature type of the content file. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly content_feature_type?: Array + + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly dev_mode?: boolean | null + + /** + * The id value for the content file + * @type {Array} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly id?: Array + + /** + * Number of results to return per page + * @type {number} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly limit?: number + + /** + * The ocw topic name. + * @type {Array} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly ocw_topic?: Array + + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'mitpe' | 'see' | 'climate'>} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results + * @type {number} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly offset?: number + + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast' | 'youtube' | 'canvas' | 'climate' | 'ovs'>} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly platform?: Array + + /** + * The search text + * @type {string} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly q?: string + + /** + * The id value of the parent learning resource for the content file + * @type {Array} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly resource_id?: Array + + /** + * The id value of the run that the content file belongs to + * @type {Array} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly run_id?: Array + + /** + * if the parameter starts with \'-\' the sort is in descending order * `id` - id * `-id` - -id * `resource_readable_id` - resource_readable_id * `-resource_readable_id` - -resource_readable_id + * @type {'id' | '-id' | 'resource_readable_id' | '-resource_readable_id'} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly sortby?: ContentFileSearchRetrieveSortbyEnum + + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly topic?: Array +} + +/** + * ContentFileSearchApi - object-oriented interface + * @export + * @class ContentFileSearchApi + * @extends {BaseAPI} + */ +export class ContentFileSearchApi extends BaseAPI { + /** + * Search for content files + * @summary Search + * @param {ContentFileSearchApiContentFileSearchRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ContentFileSearchApi + */ + public contentFileSearchRetrieve( + requestParameters: ContentFileSearchApiContentFileSearchRetrieveRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return ContentFileSearchApiFp(this.configuration) + .contentFileSearchRetrieve( + requestParameters.aggregations, + requestParameters.content_feature_type, + requestParameters.dev_mode, + requestParameters.id, + requestParameters.limit, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.q, + requestParameters.resource_id, + requestParameters.run_id, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const ContentFileSearchRetrieveAggregationsEnum = { + Topic: "topic", + ContentFeatureType: "content_feature_type", + Platform: "platform", + OfferedBy: "offered_by", +} as const +export type ContentFileSearchRetrieveAggregationsEnum = + (typeof ContentFileSearchRetrieveAggregationsEnum)[keyof typeof ContentFileSearchRetrieveAggregationsEnum] +/** + * @export + */ +export const ContentFileSearchRetrieveOfferedByEnum = { + Mitx: "mitx", + Ocw: "ocw", + Bootcamps: "bootcamps", + Xpro: "xpro", + Mitpe: "mitpe", + See: "see", + Climate: "climate", +} as const +export type ContentFileSearchRetrieveOfferedByEnum = + (typeof ContentFileSearchRetrieveOfferedByEnum)[keyof typeof ContentFileSearchRetrieveOfferedByEnum] +/** + * @export + */ +export const ContentFileSearchRetrievePlatformEnum = { + Edx: "edx", + Ocw: "ocw", + Oll: "oll", + Mitxonline: "mitxonline", + Bootcamps: "bootcamps", + Xpro: "xpro", + Csail: "csail", + Mitpe: "mitpe", + See: "see", + Scc: "scc", + Ctl: "ctl", + Whu: "whu", + Susskind: "susskind", + Globalalumni: "globalalumni", + Simplilearn: "simplilearn", + Emeritus: "emeritus", + Podcast: "podcast", + Youtube: "youtube", + Canvas: "canvas", + Climate: "climate", + Ovs: "ovs", +} as const +export type ContentFileSearchRetrievePlatformEnum = + (typeof ContentFileSearchRetrievePlatformEnum)[keyof typeof ContentFileSearchRetrievePlatformEnum] +/** + * @export + */ +export const ContentFileSearchRetrieveSortbyEnum = { + Id: "id", + Id2: "-id", + ResourceReadableId: "resource_readable_id", + ResourceReadableId2: "-resource_readable_id", +} as const +export type ContentFileSearchRetrieveSortbyEnum = + (typeof ContentFileSearchRetrieveSortbyEnum)[keyof typeof ContentFileSearchRetrieveSortbyEnum] + +/** + * ContentfilesApi - axios parameter creator + * @export + */ +export const ContentfilesApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Viewset for ContentFiles + * @summary List + * @param {number} learning_resource_id id of the parent learning resource + * @param {Array} [content_feature_type] Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array} [edx_module_id] The edx module id of the content file + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {Array} [resource_id] The id of the learning resource the content file belongs to + * @param {Array} [run_id] The id of the learning resource run the content file belongs to + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + contentfilesList: async ( + learning_resource_id: number, + content_feature_type?: Array, + edx_module_id?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + resource_id?: Array, + run_id?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "contentfilesList", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = `/api/v2/contentfiles/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (content_feature_type) { + localVarQueryParameter["content_feature_type"] = content_feature_type + } + + if (edx_module_id) { + localVarQueryParameter["edx_module_id"] = edx_module_id + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (run_id) { + localVarQueryParameter["run_id"] = run_id + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for ContentFiles + * @summary Retrieve + * @param {number} id A unique integer value identifying this contentfile. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + contentfilesRetrieve: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("contentfilesRetrieve", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "contentfilesRetrieve", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = `/api/v2/contentfiles/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * ContentfilesApi - functional programming interface + * @export + */ +export const ContentfilesApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + ContentfilesApiAxiosParamCreator(configuration) + return { + /** + * Viewset for ContentFiles + * @summary List + * @param {number} learning_resource_id id of the parent learning resource + * @param {Array} [content_feature_type] Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array} [edx_module_id] The edx module id of the content file + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {Array} [resource_id] The id of the learning resource the content file belongs to + * @param {Array} [run_id] The id of the learning resource run the content file belongs to + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async contentfilesList( + learning_resource_id: number, + content_feature_type?: Array, + edx_module_id?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + resource_id?: Array, + run_id?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.contentfilesList( + learning_resource_id, + content_feature_type, + edx_module_id, + limit, + offered_by, + offset, + platform, + resource_id, + run_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["ContentfilesApi.contentfilesList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for ContentFiles + * @summary Retrieve + * @param {number} id A unique integer value identifying this contentfile. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async contentfilesRetrieve( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.contentfilesRetrieve( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["ContentfilesApi.contentfilesRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * ContentfilesApi - factory interface + * @export + */ +export const ContentfilesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = ContentfilesApiFp(configuration) + return { + /** + * Viewset for ContentFiles + * @summary List + * @param {ContentfilesApiContentfilesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + contentfilesList( + requestParameters: ContentfilesApiContentfilesListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .contentfilesList( + requestParameters.learning_resource_id, + requestParameters.content_feature_type, + requestParameters.edx_module_id, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.resource_id, + requestParameters.run_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for ContentFiles + * @summary Retrieve + * @param {ContentfilesApiContentfilesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + contentfilesRetrieve( + requestParameters: ContentfilesApiContentfilesRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .contentfilesRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for contentfilesList operation in ContentfilesApi. + * @export + * @interface ContentfilesApiContentfilesListRequest + */ +export interface ContentfilesApiContentfilesListRequest { + /** + * id of the parent learning resource + * @type {number} + * @memberof ContentfilesApiContentfilesList + */ + readonly learning_resource_id: number + + /** + * Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof ContentfilesApiContentfilesList + */ + readonly content_feature_type?: Array + + /** + * The edx module id of the content file + * @type {Array} + * @memberof ContentfilesApiContentfilesList + */ + readonly edx_module_id?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof ContentfilesApiContentfilesList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof ContentfilesApiContentfilesList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof ContentfilesApiContentfilesList + */ + readonly offset?: number + + /** + * The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof ContentfilesApiContentfilesList + */ + readonly platform?: Array + + /** + * The id of the learning resource the content file belongs to + * @type {Array} + * @memberof ContentfilesApiContentfilesList + */ + readonly resource_id?: Array + + /** + * The id of the learning resource run the content file belongs to + * @type {Array} + * @memberof ContentfilesApiContentfilesList + */ + readonly run_id?: Array +} + +/** + * Request parameters for contentfilesRetrieve operation in ContentfilesApi. + * @export + * @interface ContentfilesApiContentfilesRetrieveRequest + */ +export interface ContentfilesApiContentfilesRetrieveRequest { + /** + * A unique integer value identifying this contentfile. + * @type {number} + * @memberof ContentfilesApiContentfilesRetrieve + */ + readonly id: number + + /** + * id of the parent learning resource + * @type {number} + * @memberof ContentfilesApiContentfilesRetrieve + */ + readonly learning_resource_id: number +} + +/** + * ContentfilesApi - object-oriented interface + * @export + * @class ContentfilesApi + * @extends {BaseAPI} + */ +export class ContentfilesApi extends BaseAPI { + /** + * Viewset for ContentFiles + * @summary List + * @param {ContentfilesApiContentfilesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ContentfilesApi + */ + public contentfilesList( + requestParameters: ContentfilesApiContentfilesListRequest, + options?: RawAxiosRequestConfig, + ) { + return ContentfilesApiFp(this.configuration) + .contentfilesList( + requestParameters.learning_resource_id, + requestParameters.content_feature_type, + requestParameters.edx_module_id, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.resource_id, + requestParameters.run_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for ContentFiles + * @summary Retrieve + * @param {ContentfilesApiContentfilesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ContentfilesApi + */ + public contentfilesRetrieve( + requestParameters: ContentfilesApiContentfilesRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return ContentfilesApiFp(this.configuration) + .contentfilesRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const ContentfilesListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type ContentfilesListOfferedByEnum = + (typeof ContentfilesListOfferedByEnum)[keyof typeof ContentfilesListOfferedByEnum] +/** + * @export + */ +export const ContentfilesListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type ContentfilesListPlatformEnum = + (typeof ContentfilesListPlatformEnum)[keyof typeof ContentfilesListPlatformEnum] + +/** + * CourseFeaturesApi - axios parameter creator + * @export + */ +export const CourseFeaturesApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Course Features and Content Feature Types + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + courseFeaturesList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/course_features/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Course Features and Content Feature Types + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource content tag. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + courseFeaturesRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("courseFeaturesRetrieve", "id", id) + const localVarPath = `/api/v2/course_features/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * CourseFeaturesApi - functional programming interface + * @export + */ +export const CourseFeaturesApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + CourseFeaturesApiAxiosParamCreator(configuration) + return { + /** + * Course Features and Content Feature Types + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async courseFeaturesList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.courseFeaturesList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["CourseFeaturesApi.courseFeaturesList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Course Features and Content Feature Types + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource content tag. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async courseFeaturesRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.courseFeaturesRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["CourseFeaturesApi.courseFeaturesRetrieve"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * CourseFeaturesApi - factory interface + * @export + */ +export const CourseFeaturesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = CourseFeaturesApiFp(configuration) + return { + /** + * Course Features and Content Feature Types + * @summary List + * @param {CourseFeaturesApiCourseFeaturesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + courseFeaturesList( + requestParameters: CourseFeaturesApiCourseFeaturesListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .courseFeaturesList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Course Features and Content Feature Types + * @summary Retrieve + * @param {CourseFeaturesApiCourseFeaturesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + courseFeaturesRetrieve( + requestParameters: CourseFeaturesApiCourseFeaturesRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .courseFeaturesRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for courseFeaturesList operation in CourseFeaturesApi. + * @export + * @interface CourseFeaturesApiCourseFeaturesListRequest + */ +export interface CourseFeaturesApiCourseFeaturesListRequest { + /** + * Number of results to return per page. + * @type {number} + * @memberof CourseFeaturesApiCourseFeaturesList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof CourseFeaturesApiCourseFeaturesList + */ + readonly offset?: number +} + +/** + * Request parameters for courseFeaturesRetrieve operation in CourseFeaturesApi. + * @export + * @interface CourseFeaturesApiCourseFeaturesRetrieveRequest + */ +export interface CourseFeaturesApiCourseFeaturesRetrieveRequest { + /** + * A unique integer value identifying this learning resource content tag. + * @type {number} + * @memberof CourseFeaturesApiCourseFeaturesRetrieve + */ + readonly id: number +} + +/** + * CourseFeaturesApi - object-oriented interface + * @export + * @class CourseFeaturesApi + * @extends {BaseAPI} + */ +export class CourseFeaturesApi extends BaseAPI { + /** + * Course Features and Content Feature Types + * @summary List + * @param {CourseFeaturesApiCourseFeaturesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CourseFeaturesApi + */ + public courseFeaturesList( + requestParameters: CourseFeaturesApiCourseFeaturesListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return CourseFeaturesApiFp(this.configuration) + .courseFeaturesList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Course Features and Content Feature Types + * @summary Retrieve + * @param {CourseFeaturesApiCourseFeaturesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CourseFeaturesApi + */ + public courseFeaturesRetrieve( + requestParameters: CourseFeaturesApiCourseFeaturesRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return CourseFeaturesApiFp(this.configuration) + .courseFeaturesRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * CoursesApi - axios parameter creator + * @export + */ +export const CoursesApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {number} learning_resource_id id of the parent learning resource + * @param {Array} [content_feature_type] Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array} [edx_module_id] The edx module id of the content file + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {Array} [resource_id] The id of the learning resource the content file belongs to + * @param {Array} [run_id] The id of the learning resource run the content file belongs to + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesContentfilesList: async ( + learning_resource_id: number, + content_feature_type?: Array, + edx_module_id?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + resource_id?: Array, + run_id?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "coursesContentfilesList", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/courses/{learning_resource_id}/contentfiles/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (content_feature_type) { + localVarQueryParameter["content_feature_type"] = content_feature_type + } + + if (edx_module_id) { + localVarQueryParameter["edx_module_id"] = edx_module_id + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (run_id) { + localVarQueryParameter["run_id"] = run_id + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {number} id A unique integer value identifying this contentfile. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesContentfilesRetrieve: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("coursesContentfilesRetrieve", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "coursesContentfilesRetrieve", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/courses/{learning_resource_id}/contentfiles/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a paginated list of courses + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {CoursesListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: CoursesListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/courses/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single course + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("coursesRetrieve", "id", id) + const localVarPath = `/api/v2/courses/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * CoursesApi - functional programming interface + * @export + */ +export const CoursesApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = CoursesApiAxiosParamCreator(configuration) + return { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {number} learning_resource_id id of the parent learning resource + * @param {Array} [content_feature_type] Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array} [edx_module_id] The edx module id of the content file + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {Array} [resource_id] The id of the learning resource the content file belongs to + * @param {Array} [run_id] The id of the learning resource run the content file belongs to + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async coursesContentfilesList( + learning_resource_id: number, + content_feature_type?: Array, + edx_module_id?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + resource_id?: Array, + run_id?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.coursesContentfilesList( + learning_resource_id, + content_feature_type, + edx_module_id, + limit, + offered_by, + offset, + platform, + resource_id, + run_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["CoursesApi.coursesContentfilesList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {number} id A unique integer value identifying this contentfile. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async coursesContentfilesRetrieve( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.coursesContentfilesRetrieve( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["CoursesApi.coursesContentfilesRetrieve"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a paginated list of courses + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {CoursesListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async coursesList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: CoursesListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.coursesList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["CoursesApi.coursesList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single course + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async coursesRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.coursesRetrieve( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["CoursesApi.coursesRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * CoursesApi - factory interface + * @export + */ +export const CoursesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = CoursesApiFp(configuration) + return { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {CoursesApiCoursesContentfilesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesContentfilesList( + requestParameters: CoursesApiCoursesContentfilesListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .coursesContentfilesList( + requestParameters.learning_resource_id, + requestParameters.content_feature_type, + requestParameters.edx_module_id, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.resource_id, + requestParameters.run_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {CoursesApiCoursesContentfilesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesContentfilesRetrieve( + requestParameters: CoursesApiCoursesContentfilesRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .coursesContentfilesRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a paginated list of courses + * @summary List + * @param {CoursesApiCoursesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesList( + requestParameters: CoursesApiCoursesListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .coursesList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single course + * @summary Retrieve + * @param {CoursesApiCoursesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + coursesRetrieve( + requestParameters: CoursesApiCoursesRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .coursesRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for coursesContentfilesList operation in CoursesApi. + * @export + * @interface CoursesApiCoursesContentfilesListRequest + */ +export interface CoursesApiCoursesContentfilesListRequest { + /** + * id of the parent learning resource + * @type {number} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly learning_resource_id: number + + /** + * Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly content_feature_type?: Array + + /** + * The edx module id of the content file + * @type {Array} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly edx_module_id?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly offset?: number + + /** + * The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly platform?: Array + + /** + * The id of the learning resource the content file belongs to + * @type {Array} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly resource_id?: Array + + /** + * The id of the learning resource run the content file belongs to + * @type {Array} + * @memberof CoursesApiCoursesContentfilesList + */ + readonly run_id?: Array +} + +/** + * Request parameters for coursesContentfilesRetrieve operation in CoursesApi. + * @export + * @interface CoursesApiCoursesContentfilesRetrieveRequest + */ +export interface CoursesApiCoursesContentfilesRetrieveRequest { + /** + * A unique integer value identifying this contentfile. + * @type {number} + * @memberof CoursesApiCoursesContentfilesRetrieve + */ + readonly id: number + + /** + * id of the parent learning resource + * @type {number} + * @memberof CoursesApiCoursesContentfilesRetrieve + */ + readonly learning_resource_id: number +} + +/** + * Request parameters for coursesList operation in CoursesApi. + * @export + * @interface CoursesApiCoursesListRequest + */ +export interface CoursesApiCoursesListRequest { + /** + * + * @type {boolean} + * @memberof CoursesApiCoursesList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof CoursesApiCoursesList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof CoursesApiCoursesList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof CoursesApiCoursesList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof CoursesApiCoursesList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof CoursesApiCoursesList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof CoursesApiCoursesList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof CoursesApiCoursesList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof CoursesApiCoursesList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof CoursesApiCoursesList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof CoursesApiCoursesList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof CoursesApiCoursesList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof CoursesApiCoursesList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof CoursesApiCoursesList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof CoursesApiCoursesList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof CoursesApiCoursesList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof CoursesApiCoursesList + */ + readonly sortby?: CoursesListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof CoursesApiCoursesList + */ + readonly topic?: Array +} + +/** + * Request parameters for coursesRetrieve operation in CoursesApi. + * @export + * @interface CoursesApiCoursesRetrieveRequest + */ +export interface CoursesApiCoursesRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof CoursesApiCoursesRetrieve + */ + readonly id: number +} + +/** + * CoursesApi - object-oriented interface + * @export + * @class CoursesApi + * @extends {BaseAPI} + */ +export class CoursesApi extends BaseAPI { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {CoursesApiCoursesContentfilesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CoursesApi + */ + public coursesContentfilesList( + requestParameters: CoursesApiCoursesContentfilesListRequest, + options?: RawAxiosRequestConfig, + ) { + return CoursesApiFp(this.configuration) + .coursesContentfilesList( + requestParameters.learning_resource_id, + requestParameters.content_feature_type, + requestParameters.edx_module_id, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.resource_id, + requestParameters.run_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {CoursesApiCoursesContentfilesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CoursesApi + */ + public coursesContentfilesRetrieve( + requestParameters: CoursesApiCoursesContentfilesRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return CoursesApiFp(this.configuration) + .coursesContentfilesRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a paginated list of courses + * @summary List + * @param {CoursesApiCoursesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CoursesApi + */ + public coursesList( + requestParameters: CoursesApiCoursesListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return CoursesApiFp(this.configuration) + .coursesList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single course + * @summary Retrieve + * @param {CoursesApiCoursesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CoursesApi + */ + public coursesRetrieve( + requestParameters: CoursesApiCoursesRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return CoursesApiFp(this.configuration) + .coursesRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const CoursesContentfilesListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type CoursesContentfilesListOfferedByEnum = + (typeof CoursesContentfilesListOfferedByEnum)[keyof typeof CoursesContentfilesListOfferedByEnum] +/** + * @export + */ +export const CoursesContentfilesListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type CoursesContentfilesListPlatformEnum = + (typeof CoursesContentfilesListPlatformEnum)[keyof typeof CoursesContentfilesListPlatformEnum] +/** + * @export + */ +export const CoursesListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type CoursesListCertificationTypeEnum = + (typeof CoursesListCertificationTypeEnum)[keyof typeof CoursesListCertificationTypeEnum] +/** + * @export + */ +export const CoursesListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type CoursesListDeliveryEnum = + (typeof CoursesListDeliveryEnum)[keyof typeof CoursesListDeliveryEnum] +/** + * @export + */ +export const CoursesListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type CoursesListDepartmentEnum = + (typeof CoursesListDepartmentEnum)[keyof typeof CoursesListDepartmentEnum] +/** + * @export + */ +export const CoursesListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type CoursesListLevelEnum = + (typeof CoursesListLevelEnum)[keyof typeof CoursesListLevelEnum] +/** + * @export + */ +export const CoursesListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type CoursesListOfferedByEnum = + (typeof CoursesListOfferedByEnum)[keyof typeof CoursesListOfferedByEnum] +/** + * @export + */ +export const CoursesListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type CoursesListPlatformEnum = + (typeof CoursesListPlatformEnum)[keyof typeof CoursesListPlatformEnum] +/** + * @export + */ +export const CoursesListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type CoursesListResourceTypeEnum = + (typeof CoursesListResourceTypeEnum)[keyof typeof CoursesListResourceTypeEnum] +/** + * @export + */ +export const CoursesListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type CoursesListResourceTypeGroupEnum = + (typeof CoursesListResourceTypeGroupEnum)[keyof typeof CoursesListResourceTypeGroupEnum] +/** + * @export + */ +export const CoursesListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type CoursesListSortbyEnum = + (typeof CoursesListSortbyEnum)[keyof typeof CoursesListSortbyEnum] + +/** + * DepartmentsApi - axios parameter creator + * @export + */ +export const DepartmentsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * MIT academic departments + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + departmentsList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/departments/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * MIT academic departments + * @summary Retrieve + * @param {string} department_id A unique value identifying this learning resource department. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + departmentsRetrieve: async ( + department_id: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'department_id' is not null or undefined + assertParamExists("departmentsRetrieve", "department_id", department_id) + const localVarPath = `/api/v2/departments/{department_id}/`.replace( + `{${"department_id"}}`, + encodeURIComponent(String(department_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * DepartmentsApi - functional programming interface + * @export + */ +export const DepartmentsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + DepartmentsApiAxiosParamCreator(configuration) + return { + /** + * MIT academic departments + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async departmentsList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.departmentsList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["DepartmentsApi.departmentsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * MIT academic departments + * @summary Retrieve + * @param {string} department_id A unique value identifying this learning resource department. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async departmentsRetrieve( + department_id: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.departmentsRetrieve( + department_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["DepartmentsApi.departmentsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * DepartmentsApi - factory interface + * @export + */ +export const DepartmentsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = DepartmentsApiFp(configuration) + return { + /** + * MIT academic departments + * @summary List + * @param {DepartmentsApiDepartmentsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + departmentsList( + requestParameters: DepartmentsApiDepartmentsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .departmentsList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * MIT academic departments + * @summary Retrieve + * @param {DepartmentsApiDepartmentsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + departmentsRetrieve( + requestParameters: DepartmentsApiDepartmentsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .departmentsRetrieve(requestParameters.department_id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for departmentsList operation in DepartmentsApi. + * @export + * @interface DepartmentsApiDepartmentsListRequest + */ +export interface DepartmentsApiDepartmentsListRequest { + /** + * Number of results to return per page. + * @type {number} + * @memberof DepartmentsApiDepartmentsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof DepartmentsApiDepartmentsList + */ + readonly offset?: number +} + +/** + * Request parameters for departmentsRetrieve operation in DepartmentsApi. + * @export + * @interface DepartmentsApiDepartmentsRetrieveRequest + */ +export interface DepartmentsApiDepartmentsRetrieveRequest { + /** + * A unique value identifying this learning resource department. + * @type {string} + * @memberof DepartmentsApiDepartmentsRetrieve + */ + readonly department_id: string +} + +/** + * DepartmentsApi - object-oriented interface + * @export + * @class DepartmentsApi + * @extends {BaseAPI} + */ +export class DepartmentsApi extends BaseAPI { + /** + * MIT academic departments + * @summary List + * @param {DepartmentsApiDepartmentsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DepartmentsApi + */ + public departmentsList( + requestParameters: DepartmentsApiDepartmentsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return DepartmentsApiFp(this.configuration) + .departmentsList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * MIT academic departments + * @summary Retrieve + * @param {DepartmentsApiDepartmentsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DepartmentsApi + */ + public departmentsRetrieve( + requestParameters: DepartmentsApiDepartmentsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return DepartmentsApiFp(this.configuration) + .departmentsRetrieve(requestParameters.department_id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * FeaturedApi - axios parameter creator + * @export + */ +export const FeaturedApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get a paginated list of featured resources + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {FeaturedListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + featuredList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: FeaturedListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/featured/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single featured resource + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + featuredRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("featuredRetrieve", "id", id) + const localVarPath = `/api/v2/featured/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * FeaturedApi - functional programming interface + * @export + */ +export const FeaturedApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = FeaturedApiAxiosParamCreator(configuration) + return { + /** + * Get a paginated list of featured resources + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {FeaturedListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async featuredList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: FeaturedListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.featuredList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["FeaturedApi.featuredList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single featured resource + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async featuredRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.featuredRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["FeaturedApi.featuredRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * FeaturedApi - factory interface + * @export + */ +export const FeaturedApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = FeaturedApiFp(configuration) + return { + /** + * Get a paginated list of featured resources + * @summary List + * @param {FeaturedApiFeaturedListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + featuredList( + requestParameters: FeaturedApiFeaturedListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .featuredList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single featured resource + * @summary Retrieve + * @param {FeaturedApiFeaturedRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + featuredRetrieve( + requestParameters: FeaturedApiFeaturedRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .featuredRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for featuredList operation in FeaturedApi. + * @export + * @interface FeaturedApiFeaturedListRequest + */ +export interface FeaturedApiFeaturedListRequest { + /** + * + * @type {boolean} + * @memberof FeaturedApiFeaturedList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof FeaturedApiFeaturedList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof FeaturedApiFeaturedList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof FeaturedApiFeaturedList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof FeaturedApiFeaturedList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof FeaturedApiFeaturedList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof FeaturedApiFeaturedList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof FeaturedApiFeaturedList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof FeaturedApiFeaturedList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof FeaturedApiFeaturedList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof FeaturedApiFeaturedList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof FeaturedApiFeaturedList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof FeaturedApiFeaturedList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof FeaturedApiFeaturedList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof FeaturedApiFeaturedList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof FeaturedApiFeaturedList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof FeaturedApiFeaturedList + */ + readonly sortby?: FeaturedListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof FeaturedApiFeaturedList + */ + readonly topic?: Array +} + +/** + * Request parameters for featuredRetrieve operation in FeaturedApi. + * @export + * @interface FeaturedApiFeaturedRetrieveRequest + */ +export interface FeaturedApiFeaturedRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof FeaturedApiFeaturedRetrieve + */ + readonly id: number +} + +/** + * FeaturedApi - object-oriented interface + * @export + * @class FeaturedApi + * @extends {BaseAPI} + */ +export class FeaturedApi extends BaseAPI { + /** + * Get a paginated list of featured resources + * @summary List + * @param {FeaturedApiFeaturedListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeaturedApi + */ + public featuredList( + requestParameters: FeaturedApiFeaturedListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return FeaturedApiFp(this.configuration) + .featuredList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single featured resource + * @summary Retrieve + * @param {FeaturedApiFeaturedRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeaturedApi + */ + public featuredRetrieve( + requestParameters: FeaturedApiFeaturedRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return FeaturedApiFp(this.configuration) + .featuredRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const FeaturedListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type FeaturedListCertificationTypeEnum = + (typeof FeaturedListCertificationTypeEnum)[keyof typeof FeaturedListCertificationTypeEnum] +/** + * @export + */ +export const FeaturedListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type FeaturedListDeliveryEnum = + (typeof FeaturedListDeliveryEnum)[keyof typeof FeaturedListDeliveryEnum] +/** + * @export + */ +export const FeaturedListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type FeaturedListDepartmentEnum = + (typeof FeaturedListDepartmentEnum)[keyof typeof FeaturedListDepartmentEnum] +/** + * @export + */ +export const FeaturedListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type FeaturedListLevelEnum = + (typeof FeaturedListLevelEnum)[keyof typeof FeaturedListLevelEnum] +/** + * @export + */ +export const FeaturedListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type FeaturedListOfferedByEnum = + (typeof FeaturedListOfferedByEnum)[keyof typeof FeaturedListOfferedByEnum] +/** + * @export + */ +export const FeaturedListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type FeaturedListPlatformEnum = + (typeof FeaturedListPlatformEnum)[keyof typeof FeaturedListPlatformEnum] +/** + * @export + */ +export const FeaturedListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type FeaturedListResourceTypeEnum = + (typeof FeaturedListResourceTypeEnum)[keyof typeof FeaturedListResourceTypeEnum] +/** + * @export + */ +export const FeaturedListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type FeaturedListResourceTypeGroupEnum = + (typeof FeaturedListResourceTypeGroupEnum)[keyof typeof FeaturedListResourceTypeGroupEnum] +/** + * @export + */ +export const FeaturedListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type FeaturedListSortbyEnum = + (typeof FeaturedListSortbyEnum)[keyof typeof FeaturedListSortbyEnum] + +/** + * LearningResourceDisplayInfoApi - axios parameter creator + * @export + */ +export const LearningResourceDisplayInfoApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get a paginated list of learning resource display info + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningResourceDisplayInfoListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourceDisplayInfoList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningResourceDisplayInfoListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learning_resource_display_info/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve display info for a learning resource. + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourceDisplayInfoRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourceDisplayInfoRetrieve", "id", id) + const localVarPath = + `/api/v2/learning_resource_display_info/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * LearningResourceDisplayInfoApi - functional programming interface + * @export + */ +export const LearningResourceDisplayInfoApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + LearningResourceDisplayInfoApiAxiosParamCreator(configuration) + return { + /** + * Get a paginated list of learning resource display info + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningResourceDisplayInfoListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourceDisplayInfoList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningResourceDisplayInfoListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourceDisplayInfoList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourceDisplayInfoApi.learningResourceDisplayInfoList" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve display info for a learning resource. + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourceDisplayInfoRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourceDisplayInfoRetrieve( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourceDisplayInfoApi.learningResourceDisplayInfoRetrieve" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * LearningResourceDisplayInfoApi - factory interface + * @export + */ +export const LearningResourceDisplayInfoApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = LearningResourceDisplayInfoApiFp(configuration) + return { + /** + * Get a paginated list of learning resource display info + * @summary List + * @param {LearningResourceDisplayInfoApiLearningResourceDisplayInfoListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourceDisplayInfoList( + requestParameters: LearningResourceDisplayInfoApiLearningResourceDisplayInfoListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourceDisplayInfoList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve display info for a learning resource. + * @summary Retrieve + * @param {LearningResourceDisplayInfoApiLearningResourceDisplayInfoRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourceDisplayInfoRetrieve( + requestParameters: LearningResourceDisplayInfoApiLearningResourceDisplayInfoRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourceDisplayInfoRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for learningResourceDisplayInfoList operation in LearningResourceDisplayInfoApi. + * @export + * @interface LearningResourceDisplayInfoApiLearningResourceDisplayInfoListRequest + */ +export interface LearningResourceDisplayInfoApiLearningResourceDisplayInfoListRequest { + /** + * + * @type {boolean} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly sortby?: LearningResourceDisplayInfoListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoList + */ + readonly topic?: Array +} + +/** + * Request parameters for learningResourceDisplayInfoRetrieve operation in LearningResourceDisplayInfoApi. + * @export + * @interface LearningResourceDisplayInfoApiLearningResourceDisplayInfoRetrieveRequest + */ +export interface LearningResourceDisplayInfoApiLearningResourceDisplayInfoRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof LearningResourceDisplayInfoApiLearningResourceDisplayInfoRetrieve + */ + readonly id: number +} + +/** + * LearningResourceDisplayInfoApi - object-oriented interface + * @export + * @class LearningResourceDisplayInfoApi + * @extends {BaseAPI} + */ +export class LearningResourceDisplayInfoApi extends BaseAPI { + /** + * Get a paginated list of learning resource display info + * @summary List + * @param {LearningResourceDisplayInfoApiLearningResourceDisplayInfoListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourceDisplayInfoApi + */ + public learningResourceDisplayInfoList( + requestParameters: LearningResourceDisplayInfoApiLearningResourceDisplayInfoListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningResourceDisplayInfoApiFp(this.configuration) + .learningResourceDisplayInfoList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve display info for a learning resource. + * @summary Retrieve + * @param {LearningResourceDisplayInfoApiLearningResourceDisplayInfoRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourceDisplayInfoApi + */ + public learningResourceDisplayInfoRetrieve( + requestParameters: LearningResourceDisplayInfoApiLearningResourceDisplayInfoRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourceDisplayInfoApiFp(this.configuration) + .learningResourceDisplayInfoRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const LearningResourceDisplayInfoListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type LearningResourceDisplayInfoListCertificationTypeEnum = + (typeof LearningResourceDisplayInfoListCertificationTypeEnum)[keyof typeof LearningResourceDisplayInfoListCertificationTypeEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourceDisplayInfoListDeliveryEnum = + (typeof LearningResourceDisplayInfoListDeliveryEnum)[keyof typeof LearningResourceDisplayInfoListDeliveryEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourceDisplayInfoListDepartmentEnum = + (typeof LearningResourceDisplayInfoListDepartmentEnum)[keyof typeof LearningResourceDisplayInfoListDepartmentEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type LearningResourceDisplayInfoListLevelEnum = + (typeof LearningResourceDisplayInfoListLevelEnum)[keyof typeof LearningResourceDisplayInfoListLevelEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type LearningResourceDisplayInfoListOfferedByEnum = + (typeof LearningResourceDisplayInfoListOfferedByEnum)[keyof typeof LearningResourceDisplayInfoListOfferedByEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type LearningResourceDisplayInfoListPlatformEnum = + (typeof LearningResourceDisplayInfoListPlatformEnum)[keyof typeof LearningResourceDisplayInfoListPlatformEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type LearningResourceDisplayInfoListResourceTypeEnum = + (typeof LearningResourceDisplayInfoListResourceTypeEnum)[keyof typeof LearningResourceDisplayInfoListResourceTypeEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type LearningResourceDisplayInfoListResourceTypeGroupEnum = + (typeof LearningResourceDisplayInfoListResourceTypeGroupEnum)[keyof typeof LearningResourceDisplayInfoListResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourceDisplayInfoListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type LearningResourceDisplayInfoListSortbyEnum = + (typeof LearningResourceDisplayInfoListSortbyEnum)[keyof typeof LearningResourceDisplayInfoListSortbyEnum] + +/** + * LearningResourcesApi - axios parameter creator + * @export + */ +export const LearningResourcesApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {number} learning_resource_id id of the parent learning resource + * @param {Array} [content_feature_type] Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array} [edx_module_id] The edx module id of the content file + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {Array} [resource_id] The id of the learning resource the content file belongs to + * @param {Array} [run_id] The id of the learning resource run the content file belongs to + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesContentfilesList: async ( + learning_resource_id: number, + content_feature_type?: Array, + edx_module_id?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + resource_id?: Array, + run_id?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningResourcesContentfilesList", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learning_resources/{learning_resource_id}/contentfiles/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (content_feature_type) { + localVarQueryParameter["content_feature_type"] = content_feature_type + } + + if (edx_module_id) { + localVarQueryParameter["edx_module_id"] = edx_module_id + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (run_id) { + localVarQueryParameter["run_id"] = run_id + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {number} id A unique integer value identifying this contentfile. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesContentfilesRetrieve: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourcesContentfilesRetrieve", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningResourcesContentfilesRetrieve", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learning_resources/{learning_resource_id}/contentfiles/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {number} learning_resource_id id of the parent learning resource + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesItemsList: async ( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningResourcesItemsList", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learning_resources/{learning_resource_id}/items/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesItemsRetrieve: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourcesItemsRetrieve", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningResourcesItemsRetrieve", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learning_resources/{learning_resource_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Set Learning Path Relationships on a given Learning Resource. + * @summary Set Learning Path Relationships + * @param {number} id id of the learning resource + * @param {Array} [learning_path_id] id of the parent learning path + * @param {PatchedLearningResourceRelationshipRequest} [PatchedLearningResourceRelationshipRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesLearningPathsPartialUpdate: async ( + id: number, + learning_path_id?: Array, + PatchedLearningResourceRelationshipRequest?: PatchedLearningResourceRelationshipRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourcesLearningPathsPartialUpdate", "id", id) + const localVarPath = + `/api/v2/learning_resources/{id}/learning_paths/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (learning_path_id) { + localVarQueryParameter["learning_path_id"] = learning_path_id + } + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedLearningResourceRelationshipRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a paginated list of learning resources. + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningResourcesListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningResourcesListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learning_resources/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single learning resource. + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourcesRetrieve", "id", id) + const localVarPath = `/api/v2/learning_resources/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Fetch similar learning resources, optionally narrowed by filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources + * @param {number} id + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [free] + * @param {Array} [level] + * @param {number} [limit] + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] The category of learning resource * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesSimilarList: async ( + id: number, + certification?: boolean | null, + certification_type?: Array, + course_feature?: Array, + delivery?: Array, + department?: Array, + free?: boolean | null, + level?: Array, + limit?: number, + ocw_topic?: Array, + offered_by?: Array, + platform?: Array, + professional?: boolean | null, + resource_type?: Array, + resource_type_group?: Array, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourcesSimilarList", "id", id) + const localVarPath = `/api/v2/learning_resources/{id}/similar/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (ocw_topic) { + localVarQueryParameter["ocw_topic"] = ocw_topic + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a paginated list of learning resources with summary fields + * @summary Get learning resources summary + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningResourcesSummaryListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesSummaryList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningResourcesSummaryListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learning_resources/summary/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Set User List Relationships on a given Learning Resource. + * @summary Set User List Relationships + * @param {number} id id of the learning resource + * @param {Array} [userlist_id] id of the parent user list + * @param {PatchedUserListRelationshipRequest} [PatchedUserListRelationshipRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserlistsPartialUpdate: async ( + id: number, + userlist_id?: Array, + PatchedUserListRelationshipRequest?: PatchedUserListRelationshipRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourcesUserlistsPartialUpdate", "id", id) + const localVarPath = `/api/v2/learning_resources/{id}/userlists/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (userlist_id) { + localVarQueryParameter["userlist_id"] = userlist_id + } + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedUserListRelationshipRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Fetch similar learning resources, optionally narrowed by Qdrant filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources using vector embeddings + * @param {number} id + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [free] + * @param {Array} [level] + * @param {number} [limit] + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] The category of learning resource * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesVectorSimilarList: async ( + id: number, + certification?: boolean | null, + certification_type?: Array, + course_feature?: Array, + delivery?: Array, + department?: Array, + free?: boolean | null, + level?: Array, + limit?: number, + ocw_topic?: Array, + offered_by?: Array, + platform?: Array, + professional?: boolean | null, + resource_type?: Array, + resource_type_group?: Array, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningResourcesVectorSimilarList", "id", id) + const localVarPath = + `/api/v2/learning_resources/{id}/vector_similar/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (ocw_topic) { + localVarQueryParameter["ocw_topic"] = ocw_topic + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * LearningResourcesApi - functional programming interface + * @export + */ +export const LearningResourcesApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + LearningResourcesApiAxiosParamCreator(configuration) + return { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {number} learning_resource_id id of the parent learning resource + * @param {Array} [content_feature_type] Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array} [edx_module_id] The edx module id of the content file + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {Array} [resource_id] The id of the learning resource the content file belongs to + * @param {Array} [run_id] The id of the learning resource run the content file belongs to + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesContentfilesList( + learning_resource_id: number, + content_feature_type?: Array, + edx_module_id?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + resource_id?: Array, + run_id?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesContentfilesList( + learning_resource_id, + content_feature_type, + edx_module_id, + limit, + offered_by, + offset, + platform, + resource_id, + run_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesContentfilesList" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {number} id A unique integer value identifying this contentfile. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesContentfilesRetrieve( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesContentfilesRetrieve( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesContentfilesRetrieve" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {number} learning_resource_id id of the parent learning resource + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesItemsList( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesItemsList( + learning_resource_id, + limit, + offset, + sortby, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningResourcesApi.learningResourcesItemsList"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesItemsRetrieve( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesItemsRetrieve( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesItemsRetrieve" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Set Learning Path Relationships on a given Learning Resource. + * @summary Set Learning Path Relationships + * @param {number} id id of the learning resource + * @param {Array} [learning_path_id] id of the parent learning path + * @param {PatchedLearningResourceRelationshipRequest} [PatchedLearningResourceRelationshipRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesLearningPathsPartialUpdate( + id: number, + learning_path_id?: Array, + PatchedLearningResourceRelationshipRequest?: PatchedLearningResourceRelationshipRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesLearningPathsPartialUpdate( + id, + learning_path_id, + PatchedLearningResourceRelationshipRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesLearningPathsPartialUpdate" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a paginated list of learning resources. + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningResourcesListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningResourcesListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningResourcesApi.learningResourcesList"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single learning resource. + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningResourcesApi.learningResourcesRetrieve"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Fetch similar learning resources, optionally narrowed by filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources + * @param {number} id + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [free] + * @param {Array} [level] + * @param {number} [limit] + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] The category of learning resource * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesSimilarList( + id: number, + certification?: boolean | null, + certification_type?: Array, + course_feature?: Array, + delivery?: Array, + department?: Array, + free?: boolean | null, + level?: Array, + limit?: number, + ocw_topic?: Array, + offered_by?: Array, + platform?: Array, + professional?: boolean | null, + resource_type?: Array, + resource_type_group?: Array, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesSimilarList( + id, + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + ocw_topic, + offered_by, + platform, + professional, + resource_type, + resource_type_group, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesSimilarList" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a paginated list of learning resources with summary fields + * @summary Get learning resources summary + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningResourcesSummaryListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesSummaryList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningResourcesSummaryListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesSummaryList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesSummaryList" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Set User List Relationships on a given Learning Resource. + * @summary Set User List Relationships + * @param {number} id id of the learning resource + * @param {Array} [userlist_id] id of the parent user list + * @param {PatchedUserListRelationshipRequest} [PatchedUserListRelationshipRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesUserlistsPartialUpdate( + id: number, + userlist_id?: Array, + PatchedUserListRelationshipRequest?: PatchedUserListRelationshipRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesUserlistsPartialUpdate( + id, + userlist_id, + PatchedUserListRelationshipRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesUserlistsPartialUpdate" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Fetch similar learning resources, optionally narrowed by Qdrant filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources using vector embeddings + * @param {number} id + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [free] + * @param {Array} [level] + * @param {number} [limit] + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] The category of learning resource * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesVectorSimilarList( + id: number, + certification?: boolean | null, + certification_type?: Array, + course_feature?: Array, + delivery?: Array, + department?: Array, + free?: boolean | null, + level?: Array, + limit?: number, + ocw_topic?: Array, + offered_by?: Array, + platform?: Array, + professional?: boolean | null, + resource_type?: Array, + resource_type_group?: Array, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesVectorSimilarList( + id, + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + ocw_topic, + offered_by, + platform, + professional, + resource_type, + resource_type_group, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesApi.learningResourcesVectorSimilarList" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * LearningResourcesApi - factory interface + * @export + */ +export const LearningResourcesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = LearningResourcesApiFp(configuration) + return { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {LearningResourcesApiLearningResourcesContentfilesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesContentfilesList( + requestParameters: LearningResourcesApiLearningResourcesContentfilesListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesContentfilesList( + requestParameters.learning_resource_id, + requestParameters.content_feature_type, + requestParameters.edx_module_id, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.resource_id, + requestParameters.run_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {LearningResourcesApiLearningResourcesContentfilesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesContentfilesRetrieve( + requestParameters: LearningResourcesApiLearningResourcesContentfilesRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesContentfilesRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {LearningResourcesApiLearningResourcesItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesItemsList( + requestParameters: LearningResourcesApiLearningResourcesItemsListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {LearningResourcesApiLearningResourcesItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesItemsRetrieve( + requestParameters: LearningResourcesApiLearningResourcesItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Set Learning Path Relationships on a given Learning Resource. + * @summary Set Learning Path Relationships + * @param {LearningResourcesApiLearningResourcesLearningPathsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesLearningPathsPartialUpdate( + requestParameters: LearningResourcesApiLearningResourcesLearningPathsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .learningResourcesLearningPathsPartialUpdate( + requestParameters.id, + requestParameters.learning_path_id, + requestParameters.PatchedLearningResourceRelationshipRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a paginated list of learning resources. + * @summary List + * @param {LearningResourcesApiLearningResourcesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesList( + requestParameters: LearningResourcesApiLearningResourcesListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single learning resource. + * @summary Retrieve + * @param {LearningResourcesApiLearningResourcesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesRetrieve( + requestParameters: LearningResourcesApiLearningResourcesRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + /** + * Fetch similar learning resources, optionally narrowed by filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources + * @param {LearningResourcesApiLearningResourcesSimilarListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesSimilarList( + requestParameters: LearningResourcesApiLearningResourcesSimilarListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .learningResourcesSimilarList( + requestParameters.id, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.platform, + requestParameters.professional, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a paginated list of learning resources with summary fields + * @summary Get learning resources summary + * @param {LearningResourcesApiLearningResourcesSummaryListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesSummaryList( + requestParameters: LearningResourcesApiLearningResourcesSummaryListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesSummaryList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Set User List Relationships on a given Learning Resource. + * @summary Set User List Relationships + * @param {LearningResourcesApiLearningResourcesUserlistsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserlistsPartialUpdate( + requestParameters: LearningResourcesApiLearningResourcesUserlistsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .learningResourcesUserlistsPartialUpdate( + requestParameters.id, + requestParameters.userlist_id, + requestParameters.PatchedUserListRelationshipRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Fetch similar learning resources, optionally narrowed by Qdrant filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources using vector embeddings + * @param {LearningResourcesApiLearningResourcesVectorSimilarListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesVectorSimilarList( + requestParameters: LearningResourcesApiLearningResourcesVectorSimilarListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .learningResourcesVectorSimilarList( + requestParameters.id, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.platform, + requestParameters.professional, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for learningResourcesContentfilesList operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesContentfilesListRequest + */ +export interface LearningResourcesApiLearningResourcesContentfilesListRequest { + /** + * id of the parent learning resource + * @type {number} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly learning_resource_id: number + + /** + * Content feature type for the content file. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly content_feature_type?: Array + + /** + * The edx module id of the content file + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly edx_module_id?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource the content file belongs to * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly offset?: number + + /** + * The platform on which learning resources the content file belongs to is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly platform?: Array + + /** + * The id of the learning resource the content file belongs to + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly resource_id?: Array + + /** + * The id of the learning resource run the content file belongs to + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesContentfilesList + */ + readonly run_id?: Array +} + +/** + * Request parameters for learningResourcesContentfilesRetrieve operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesContentfilesRetrieveRequest + */ +export interface LearningResourcesApiLearningResourcesContentfilesRetrieveRequest { + /** + * A unique integer value identifying this contentfile. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesContentfilesRetrieve + */ + readonly id: number + + /** + * id of the parent learning resource + * @type {number} + * @memberof LearningResourcesApiLearningResourcesContentfilesRetrieve + */ + readonly learning_resource_id: number +} + +/** + * Request parameters for learningResourcesItemsList operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesItemsListRequest + */ +export interface LearningResourcesApiLearningResourcesItemsListRequest { + /** + * id of the parent learning resource + * @type {number} + * @memberof LearningResourcesApiLearningResourcesItemsList + */ + readonly learning_resource_id: number + + /** + * Number of results to return per page. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesItemsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesItemsList + */ + readonly offset?: number + + /** + * Which field to use when ordering the results. + * @type {string} + * @memberof LearningResourcesApiLearningResourcesItemsList + */ + readonly sortby?: string +} + +/** + * Request parameters for learningResourcesItemsRetrieve operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesItemsRetrieveRequest + */ +export interface LearningResourcesApiLearningResourcesItemsRetrieveRequest { + /** + * A unique integer value identifying this learning resource relationship. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesItemsRetrieve + */ + readonly id: number + + /** + * id of the parent learning resource + * @type {number} + * @memberof LearningResourcesApiLearningResourcesItemsRetrieve + */ + readonly learning_resource_id: number +} + +/** + * Request parameters for learningResourcesLearningPathsPartialUpdate operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesLearningPathsPartialUpdateRequest + */ +export interface LearningResourcesApiLearningResourcesLearningPathsPartialUpdateRequest { + /** + * id of the learning resource + * @type {number} + * @memberof LearningResourcesApiLearningResourcesLearningPathsPartialUpdate + */ + readonly id: number + + /** + * id of the parent learning path + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesLearningPathsPartialUpdate + */ + readonly learning_path_id?: Array + + /** + * + * @type {PatchedLearningResourceRelationshipRequest} + * @memberof LearningResourcesApiLearningResourcesLearningPathsPartialUpdate + */ + readonly PatchedLearningResourceRelationshipRequest?: PatchedLearningResourceRelationshipRequest +} + +/** + * Request parameters for learningResourcesList operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesListRequest + */ +export interface LearningResourcesApiLearningResourcesListRequest { + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly sortby?: LearningResourcesListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesList + */ + readonly topic?: Array +} + +/** + * Request parameters for learningResourcesRetrieve operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesRetrieveRequest + */ +export interface LearningResourcesApiLearningResourcesRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesRetrieve + */ + readonly id: number +} + +/** + * Request parameters for learningResourcesSimilarList operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesSimilarListRequest + */ +export interface LearningResourcesApiLearningResourcesSimilarListRequest { + /** + * + * @type {number} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly id: number + + /** + * True if the learning resource offers a certificate + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly certification?: boolean | null + + /** + * The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'micromasters' | 'professional' | 'completion' | 'none'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly certification_type?: Array + + /** + * The course feature. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly course_feature?: Array + + /** + * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array<'online' | 'hybrid' | 'in_person' | 'offline'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly delivery?: Array + + /** + * The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly department?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly free?: boolean | null + + /** + * + * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly level?: Array + + /** + * + * @type {number} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly limit?: number + + /** + * The ocw topic name. + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly ocw_topic?: Array + + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'mitpe' | 'see' | 'climate'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly offered_by?: Array + + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast' | 'youtube' | 'canvas' | 'climate' | 'ovs'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly professional?: boolean | null + + /** + * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @type {Array<'course' | 'program' | 'learning_path' | 'podcast' | 'podcast_episode' | 'video' | 'video_playlist' | 'document'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly resource_type?: Array + + /** + * The category of learning resource * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'program' | 'learning_material'>} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly resource_type_group?: Array + + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesSimilarList + */ + readonly topic?: Array +} + +/** + * Request parameters for learningResourcesSummaryList operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesSummaryListRequest + */ +export interface LearningResourcesApiLearningResourcesSummaryListRequest { + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly sortby?: LearningResourcesSummaryListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesSummaryList + */ + readonly topic?: Array +} + +/** + * Request parameters for learningResourcesUserlistsPartialUpdate operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesUserlistsPartialUpdateRequest + */ +export interface LearningResourcesApiLearningResourcesUserlistsPartialUpdateRequest { + /** + * id of the learning resource + * @type {number} + * @memberof LearningResourcesApiLearningResourcesUserlistsPartialUpdate + */ + readonly id: number + + /** + * id of the parent user list + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesUserlistsPartialUpdate + */ + readonly userlist_id?: Array + + /** + * + * @type {PatchedUserListRelationshipRequest} + * @memberof LearningResourcesApiLearningResourcesUserlistsPartialUpdate + */ + readonly PatchedUserListRelationshipRequest?: PatchedUserListRelationshipRequest +} + +/** + * Request parameters for learningResourcesVectorSimilarList operation in LearningResourcesApi. + * @export + * @interface LearningResourcesApiLearningResourcesVectorSimilarListRequest + */ +export interface LearningResourcesApiLearningResourcesVectorSimilarListRequest { + /** + * + * @type {number} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly id: number + + /** + * True if the learning resource offers a certificate + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly certification?: boolean | null + + /** + * The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'micromasters' | 'professional' | 'completion' | 'none'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly certification_type?: Array + + /** + * The course feature. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly course_feature?: Array + + /** + * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array<'online' | 'hybrid' | 'in_person' | 'offline'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly delivery?: Array + + /** + * The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly department?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly free?: boolean | null + + /** + * + * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly level?: Array + + /** + * + * @type {number} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly limit?: number + + /** + * The ocw topic name. + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly ocw_topic?: Array + + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'mitpe' | 'see' | 'climate'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly offered_by?: Array + + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast' | 'youtube' | 'canvas' | 'climate' | 'ovs'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly professional?: boolean | null + + /** + * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @type {Array<'course' | 'program' | 'learning_path' | 'podcast' | 'podcast_episode' | 'video' | 'video_playlist' | 'document'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly resource_type?: Array + + /** + * The category of learning resource * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'program' | 'learning_material'>} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly resource_type_group?: Array + + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof LearningResourcesApiLearningResourcesVectorSimilarList + */ + readonly topic?: Array +} + +/** + * LearningResourcesApi - object-oriented interface + * @export + * @class LearningResourcesApi + * @extends {BaseAPI} + */ +export class LearningResourcesApi extends BaseAPI { + /** + * Show content files for a learning resource + * @summary Learning Resource Content File List + * @param {LearningResourcesApiLearningResourcesContentfilesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesContentfilesList( + requestParameters: LearningResourcesApiLearningResourcesContentfilesListRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesContentfilesList( + requestParameters.learning_resource_id, + requestParameters.content_feature_type, + requestParameters.edx_module_id, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.resource_id, + requestParameters.run_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Show content files for a learning resource + * @summary Learning Resource Content File Retrieve + * @param {LearningResourcesApiLearningResourcesContentfilesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesContentfilesRetrieve( + requestParameters: LearningResourcesApiLearningResourcesContentfilesRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesContentfilesRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {LearningResourcesApiLearningResourcesItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesItemsList( + requestParameters: LearningResourcesApiLearningResourcesItemsListRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {LearningResourcesApiLearningResourcesItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesItemsRetrieve( + requestParameters: LearningResourcesApiLearningResourcesItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Set Learning Path Relationships on a given Learning Resource. + * @summary Set Learning Path Relationships + * @param {LearningResourcesApiLearningResourcesLearningPathsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesLearningPathsPartialUpdate( + requestParameters: LearningResourcesApiLearningResourcesLearningPathsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesLearningPathsPartialUpdate( + requestParameters.id, + requestParameters.learning_path_id, + requestParameters.PatchedLearningResourceRelationshipRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a paginated list of learning resources. + * @summary List + * @param {LearningResourcesApiLearningResourcesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesList( + requestParameters: LearningResourcesApiLearningResourcesListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single learning resource. + * @summary Retrieve + * @param {LearningResourcesApiLearningResourcesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesRetrieve( + requestParameters: LearningResourcesApiLearningResourcesRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Fetch similar learning resources, optionally narrowed by filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources + * @param {LearningResourcesApiLearningResourcesSimilarListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesSimilarList( + requestParameters: LearningResourcesApiLearningResourcesSimilarListRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesSimilarList( + requestParameters.id, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.platform, + requestParameters.professional, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a paginated list of learning resources with summary fields + * @summary Get learning resources summary + * @param {LearningResourcesApiLearningResourcesSummaryListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesSummaryList( + requestParameters: LearningResourcesApiLearningResourcesSummaryListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesSummaryList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Set User List Relationships on a given Learning Resource. + * @summary Set User List Relationships + * @param {LearningResourcesApiLearningResourcesUserlistsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesUserlistsPartialUpdate( + requestParameters: LearningResourcesApiLearningResourcesUserlistsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesUserlistsPartialUpdate( + requestParameters.id, + requestParameters.userlist_id, + requestParameters.PatchedUserListRelationshipRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Fetch similar learning resources, optionally narrowed by Qdrant filters. Args: id (integer): The id of the learning resource Returns: QuerySet of similar LearningResource for the resource matching the id parameter + * @summary Get similar resources using vector embeddings + * @param {LearningResourcesApiLearningResourcesVectorSimilarListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesApi + */ + public learningResourcesVectorSimilarList( + requestParameters: LearningResourcesApiLearningResourcesVectorSimilarListRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesApiFp(this.configuration) + .learningResourcesVectorSimilarList( + requestParameters.id, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.platform, + requestParameters.professional, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const LearningResourcesContentfilesListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type LearningResourcesContentfilesListOfferedByEnum = + (typeof LearningResourcesContentfilesListOfferedByEnum)[keyof typeof LearningResourcesContentfilesListOfferedByEnum] +/** + * @export + */ +export const LearningResourcesContentfilesListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type LearningResourcesContentfilesListPlatformEnum = + (typeof LearningResourcesContentfilesListPlatformEnum)[keyof typeof LearningResourcesContentfilesListPlatformEnum] +/** + * @export + */ +export const LearningResourcesListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type LearningResourcesListCertificationTypeEnum = + (typeof LearningResourcesListCertificationTypeEnum)[keyof typeof LearningResourcesListCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesListDeliveryEnum = + (typeof LearningResourcesListDeliveryEnum)[keyof typeof LearningResourcesListDeliveryEnum] +/** + * @export + */ +export const LearningResourcesListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesListDepartmentEnum = + (typeof LearningResourcesListDepartmentEnum)[keyof typeof LearningResourcesListDepartmentEnum] +/** + * @export + */ +export const LearningResourcesListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type LearningResourcesListLevelEnum = + (typeof LearningResourcesListLevelEnum)[keyof typeof LearningResourcesListLevelEnum] +/** + * @export + */ +export const LearningResourcesListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type LearningResourcesListOfferedByEnum = + (typeof LearningResourcesListOfferedByEnum)[keyof typeof LearningResourcesListOfferedByEnum] +/** + * @export + */ +export const LearningResourcesListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type LearningResourcesListPlatformEnum = + (typeof LearningResourcesListPlatformEnum)[keyof typeof LearningResourcesListPlatformEnum] +/** + * @export + */ +export const LearningResourcesListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type LearningResourcesListResourceTypeEnum = + (typeof LearningResourcesListResourceTypeEnum)[keyof typeof LearningResourcesListResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type LearningResourcesListResourceTypeGroupEnum = + (typeof LearningResourcesListResourceTypeGroupEnum)[keyof typeof LearningResourcesListResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourcesListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type LearningResourcesListSortbyEnum = + (typeof LearningResourcesListSortbyEnum)[keyof typeof LearningResourcesListSortbyEnum] +/** + * @export + */ +export const LearningResourcesSimilarListCertificationTypeEnum = { + Micromasters: "micromasters", + Professional: "professional", + Completion: "completion", + None: "none", +} as const +export type LearningResourcesSimilarListCertificationTypeEnum = + (typeof LearningResourcesSimilarListCertificationTypeEnum)[keyof typeof LearningResourcesSimilarListCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesSimilarListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesSimilarListDeliveryEnum = + (typeof LearningResourcesSimilarListDeliveryEnum)[keyof typeof LearningResourcesSimilarListDeliveryEnum] +/** + * @export + */ +export const LearningResourcesSimilarListDepartmentEnum = { + _1: "1", + _2: "2", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesSimilarListDepartmentEnum = + (typeof LearningResourcesSimilarListDepartmentEnum)[keyof typeof LearningResourcesSimilarListDepartmentEnum] +/** + * @export + */ +export const LearningResourcesSimilarListLevelEnum = { + Undergraduate: "undergraduate", + Graduate: "graduate", + HighSchool: "high_school", + Noncredit: "noncredit", + Advanced: "advanced", + Intermediate: "intermediate", + Introductory: "introductory", +} as const +export type LearningResourcesSimilarListLevelEnum = + (typeof LearningResourcesSimilarListLevelEnum)[keyof typeof LearningResourcesSimilarListLevelEnum] +/** + * @export + */ +export const LearningResourcesSimilarListOfferedByEnum = { + Mitx: "mitx", + Ocw: "ocw", + Bootcamps: "bootcamps", + Xpro: "xpro", + Mitpe: "mitpe", + See: "see", + Climate: "climate", +} as const +export type LearningResourcesSimilarListOfferedByEnum = + (typeof LearningResourcesSimilarListOfferedByEnum)[keyof typeof LearningResourcesSimilarListOfferedByEnum] +/** + * @export + */ +export const LearningResourcesSimilarListPlatformEnum = { + Edx: "edx", + Ocw: "ocw", + Oll: "oll", + Mitxonline: "mitxonline", + Bootcamps: "bootcamps", + Xpro: "xpro", + Csail: "csail", + Mitpe: "mitpe", + See: "see", + Scc: "scc", + Ctl: "ctl", + Whu: "whu", + Susskind: "susskind", + Globalalumni: "globalalumni", + Simplilearn: "simplilearn", + Emeritus: "emeritus", + Podcast: "podcast", + Youtube: "youtube", + Canvas: "canvas", + Climate: "climate", + Ovs: "ovs", +} as const +export type LearningResourcesSimilarListPlatformEnum = + (typeof LearningResourcesSimilarListPlatformEnum)[keyof typeof LearningResourcesSimilarListPlatformEnum] +/** + * @export + */ +export const LearningResourcesSimilarListResourceTypeEnum = { + Course: "course", + Program: "program", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Video: "video", + VideoPlaylist: "video_playlist", + Document: "document", +} as const +export type LearningResourcesSimilarListResourceTypeEnum = + (typeof LearningResourcesSimilarListResourceTypeEnum)[keyof typeof LearningResourcesSimilarListResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesSimilarListResourceTypeGroupEnum = { + Course: "course", + Program: "program", + LearningMaterial: "learning_material", +} as const +export type LearningResourcesSimilarListResourceTypeGroupEnum = + (typeof LearningResourcesSimilarListResourceTypeGroupEnum)[keyof typeof LearningResourcesSimilarListResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourcesSummaryListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type LearningResourcesSummaryListCertificationTypeEnum = + (typeof LearningResourcesSummaryListCertificationTypeEnum)[keyof typeof LearningResourcesSummaryListCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesSummaryListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesSummaryListDeliveryEnum = + (typeof LearningResourcesSummaryListDeliveryEnum)[keyof typeof LearningResourcesSummaryListDeliveryEnum] +/** + * @export + */ +export const LearningResourcesSummaryListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesSummaryListDepartmentEnum = + (typeof LearningResourcesSummaryListDepartmentEnum)[keyof typeof LearningResourcesSummaryListDepartmentEnum] +/** + * @export + */ +export const LearningResourcesSummaryListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type LearningResourcesSummaryListLevelEnum = + (typeof LearningResourcesSummaryListLevelEnum)[keyof typeof LearningResourcesSummaryListLevelEnum] +/** + * @export + */ +export const LearningResourcesSummaryListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type LearningResourcesSummaryListOfferedByEnum = + (typeof LearningResourcesSummaryListOfferedByEnum)[keyof typeof LearningResourcesSummaryListOfferedByEnum] +/** + * @export + */ +export const LearningResourcesSummaryListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type LearningResourcesSummaryListPlatformEnum = + (typeof LearningResourcesSummaryListPlatformEnum)[keyof typeof LearningResourcesSummaryListPlatformEnum] +/** + * @export + */ +export const LearningResourcesSummaryListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type LearningResourcesSummaryListResourceTypeEnum = + (typeof LearningResourcesSummaryListResourceTypeEnum)[keyof typeof LearningResourcesSummaryListResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesSummaryListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type LearningResourcesSummaryListResourceTypeGroupEnum = + (typeof LearningResourcesSummaryListResourceTypeGroupEnum)[keyof typeof LearningResourcesSummaryListResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourcesSummaryListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type LearningResourcesSummaryListSortbyEnum = + (typeof LearningResourcesSummaryListSortbyEnum)[keyof typeof LearningResourcesSummaryListSortbyEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListCertificationTypeEnum = { + Micromasters: "micromasters", + Professional: "professional", + Completion: "completion", + None: "none", +} as const +export type LearningResourcesVectorSimilarListCertificationTypeEnum = + (typeof LearningResourcesVectorSimilarListCertificationTypeEnum)[keyof typeof LearningResourcesVectorSimilarListCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesVectorSimilarListDeliveryEnum = + (typeof LearningResourcesVectorSimilarListDeliveryEnum)[keyof typeof LearningResourcesVectorSimilarListDeliveryEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListDepartmentEnum = { + _1: "1", + _2: "2", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesVectorSimilarListDepartmentEnum = + (typeof LearningResourcesVectorSimilarListDepartmentEnum)[keyof typeof LearningResourcesVectorSimilarListDepartmentEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListLevelEnum = { + Undergraduate: "undergraduate", + Graduate: "graduate", + HighSchool: "high_school", + Noncredit: "noncredit", + Advanced: "advanced", + Intermediate: "intermediate", + Introductory: "introductory", +} as const +export type LearningResourcesVectorSimilarListLevelEnum = + (typeof LearningResourcesVectorSimilarListLevelEnum)[keyof typeof LearningResourcesVectorSimilarListLevelEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListOfferedByEnum = { + Mitx: "mitx", + Ocw: "ocw", + Bootcamps: "bootcamps", + Xpro: "xpro", + Mitpe: "mitpe", + See: "see", + Climate: "climate", +} as const +export type LearningResourcesVectorSimilarListOfferedByEnum = + (typeof LearningResourcesVectorSimilarListOfferedByEnum)[keyof typeof LearningResourcesVectorSimilarListOfferedByEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListPlatformEnum = { + Edx: "edx", + Ocw: "ocw", + Oll: "oll", + Mitxonline: "mitxonline", + Bootcamps: "bootcamps", + Xpro: "xpro", + Csail: "csail", + Mitpe: "mitpe", + See: "see", + Scc: "scc", + Ctl: "ctl", + Whu: "whu", + Susskind: "susskind", + Globalalumni: "globalalumni", + Simplilearn: "simplilearn", + Emeritus: "emeritus", + Podcast: "podcast", + Youtube: "youtube", + Canvas: "canvas", + Climate: "climate", + Ovs: "ovs", +} as const +export type LearningResourcesVectorSimilarListPlatformEnum = + (typeof LearningResourcesVectorSimilarListPlatformEnum)[keyof typeof LearningResourcesVectorSimilarListPlatformEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListResourceTypeEnum = { + Course: "course", + Program: "program", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Video: "video", + VideoPlaylist: "video_playlist", + Document: "document", +} as const +export type LearningResourcesVectorSimilarListResourceTypeEnum = + (typeof LearningResourcesVectorSimilarListResourceTypeEnum)[keyof typeof LearningResourcesVectorSimilarListResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesVectorSimilarListResourceTypeGroupEnum = { + Course: "course", + Program: "program", + LearningMaterial: "learning_material", +} as const +export type LearningResourcesVectorSimilarListResourceTypeGroupEnum = + (typeof LearningResourcesVectorSimilarListResourceTypeGroupEnum)[keyof typeof LearningResourcesVectorSimilarListResourceTypeGroupEnum] + +/** + * LearningResourcesSearchApi - axios parameter creator + * @export + */ +export const LearningResourcesSearchApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Search for learning resources + * @summary Search + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesSearchRetrieveSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesSearchRetrieveSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesSearchRetrieve: async ( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesSearchRetrieveSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesSearchRetrieveSortbyEnum, + topic?: Array, + yearly_decay_percent?: number | null, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learning_resources_search/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (aggregations) { + localVarQueryParameter["aggregations"] = aggregations + } + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (content_file_score_weight !== undefined) { + localVarQueryParameter["content_file_score_weight"] = + content_file_score_weight + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (id) { + localVarQueryParameter["id"] = id + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (max_incompleteness_penalty !== undefined) { + localVarQueryParameter["max_incompleteness_penalty"] = + max_incompleteness_penalty + } + + if (min_score !== undefined) { + localVarQueryParameter["min_score"] = min_score + } + + if (ocw_topic) { + localVarQueryParameter["ocw_topic"] = ocw_topic + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (q !== undefined) { + localVarQueryParameter["q"] = q + } + + if (resource_category) { + localVarQueryParameter["resource_category"] = resource_category + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (search_mode !== undefined) { + localVarQueryParameter["search_mode"] = search_mode + } + + if (show_ocw_files !== undefined) { + localVarQueryParameter["show_ocw_files"] = show_ocw_files + } + + if (slop !== undefined) { + localVarQueryParameter["slop"] = slop + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + if (yearly_decay_percent !== undefined) { + localVarQueryParameter["yearly_decay_percent"] = yearly_decay_percent + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * LearningResourcesSearchApi - functional programming interface + * @export + */ +export const LearningResourcesSearchApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + LearningResourcesSearchApiAxiosParamCreator(configuration) + return { + /** + * Search for learning resources + * @summary Search + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesSearchRetrieveSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesSearchRetrieveSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesSearchRetrieve( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesSearchRetrieveSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesSearchRetrieveSortbyEnum, + topic?: Array, + yearly_decay_percent?: number | null, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesSearchRetrieve( + aggregations, + certification, + certification_type, + content_file_score_weight, + course_feature, + delivery, + department, + dev_mode, + free, + id, + level, + limit, + max_incompleteness_penalty, + min_score, + ocw_topic, + offered_by, + offset, + platform, + professional, + q, + resource_category, + resource_type, + resource_type_group, + search_mode, + show_ocw_files, + slop, + sortby, + topic, + yearly_decay_percent, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesSearchApi.learningResourcesSearchRetrieve" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * LearningResourcesSearchApi - factory interface + * @export + */ +export const LearningResourcesSearchApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = LearningResourcesSearchApiFp(configuration) + return { + /** + * Search for learning resources + * @summary Search + * @param {LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesSearchRetrieve( + requestParameters: LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesSearchRetrieve( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.topic, + requestParameters.yearly_decay_percent, + options, + ) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for learningResourcesSearchRetrieve operation in LearningResourcesSearchApi. + * @export + * @interface LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest + */ +export interface LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest { + /** + * Show resource counts by category + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_type_group' | 'resource_category'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly aggregations?: Array + + /** + * True if the learning resource offers a certificate + * @type {boolean} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly certification?: boolean | null + + /** + * The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'micromasters' | 'professional' | 'completion' | 'none'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly certification_type?: Array + + /** + * Score weight for content file data. 1 is the default. 0 means content files are ignored + * @type {number} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly content_file_score_weight?: number | null + + /** + * The course feature. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly course_feature?: Array + + /** + * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array<'online' | 'hybrid' | 'in_person' | 'offline'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly delivery?: Array + + /** + * The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly department?: Array + + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly dev_mode?: boolean | null + + /** + * + * @type {boolean} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly free?: boolean | null + + /** + * The id value for the learning resource + * @type {Array} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly id?: Array + + /** + * + * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly level?: Array + + /** + * Number of results to return per page + * @type {number} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly limit?: number + + /** + * Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly max_incompleteness_penalty?: number | null + + /** + * Minimum score value a text query result needs to have to be displayed + * @type {number} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly min_score?: number | null + + /** + * The ocw topic name. + * @type {Array} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly ocw_topic?: Array + + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'mitpe' | 'see' | 'climate'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results + * @type {number} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly offset?: number + + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast' | 'youtube' | 'canvas' | 'climate' | 'ovs'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly professional?: boolean | null + + /** + * The search text + * @type {string} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly q?: string + + /** + * The resource category for the resource + * @type {Array} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly resource_category?: Array + + /** + * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @type {Array<'course' | 'program' | 'learning_path' | 'podcast' | 'podcast_episode' | 'video' | 'video_playlist' | 'document'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly resource_type?: Array + + /** + * + * @type {Array<'course' | 'program' | 'learning_material'>} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly resource_type_group?: Array + + /** + * The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @type {'phrase' | 'best_fields' | 'most_fields' | 'hybrid'} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly search_mode?: LearningResourcesSearchRetrieveSearchModeEnum + + /** + * Whether to include select OCW content files in search results. + * @type {boolean} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly show_ocw_files?: boolean | null + + /** + * Allowed distance for phrase search + * @type {number} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly slop?: number | null + + /** + * If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'featured' | 'id' | '-id' | 'readable_id' | '-readable_id' | 'last_modified' | '-last_modified' | 'new' | 'start_date' | '-start_date' | 'mitcoursenumber' | '-mitcoursenumber' | 'views' | '-views' | 'upcoming'} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly sortby?: LearningResourcesSearchRetrieveSortbyEnum + + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly topic?: Array + + /** + * Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly yearly_decay_percent?: number | null +} + +/** + * LearningResourcesSearchApi - object-oriented interface + * @export + * @class LearningResourcesSearchApi + * @extends {BaseAPI} + */ +export class LearningResourcesSearchApi extends BaseAPI { + /** + * Search for learning resources + * @summary Search + * @param {LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesSearchApi + */ + public learningResourcesSearchRetrieve( + requestParameters: LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesSearchApiFp(this.configuration) + .learningResourcesSearchRetrieve( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.topic, + requestParameters.yearly_decay_percent, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const LearningResourcesSearchRetrieveAggregationsEnum = { + ResourceType: "resource_type", + Certification: "certification", + CertificationType: "certification_type", + OfferedBy: "offered_by", + Platform: "platform", + Topic: "topic", + Department: "department", + Level: "level", + CourseFeature: "course_feature", + Professional: "professional", + Free: "free", + Delivery: "delivery", + ResourceTypeGroup: "resource_type_group", + ResourceCategory: "resource_category", +} as const +export type LearningResourcesSearchRetrieveAggregationsEnum = + (typeof LearningResourcesSearchRetrieveAggregationsEnum)[keyof typeof LearningResourcesSearchRetrieveAggregationsEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveCertificationTypeEnum = { + Micromasters: "micromasters", + Professional: "professional", + Completion: "completion", + None: "none", +} as const +export type LearningResourcesSearchRetrieveCertificationTypeEnum = + (typeof LearningResourcesSearchRetrieveCertificationTypeEnum)[keyof typeof LearningResourcesSearchRetrieveCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesSearchRetrieveDeliveryEnum = + (typeof LearningResourcesSearchRetrieveDeliveryEnum)[keyof typeof LearningResourcesSearchRetrieveDeliveryEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveDepartmentEnum = { + _1: "1", + _2: "2", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesSearchRetrieveDepartmentEnum = + (typeof LearningResourcesSearchRetrieveDepartmentEnum)[keyof typeof LearningResourcesSearchRetrieveDepartmentEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveLevelEnum = { + Undergraduate: "undergraduate", + Graduate: "graduate", + HighSchool: "high_school", + Noncredit: "noncredit", + Advanced: "advanced", + Intermediate: "intermediate", + Introductory: "introductory", +} as const +export type LearningResourcesSearchRetrieveLevelEnum = + (typeof LearningResourcesSearchRetrieveLevelEnum)[keyof typeof LearningResourcesSearchRetrieveLevelEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveOfferedByEnum = { + Mitx: "mitx", + Ocw: "ocw", + Bootcamps: "bootcamps", + Xpro: "xpro", + Mitpe: "mitpe", + See: "see", + Climate: "climate", +} as const +export type LearningResourcesSearchRetrieveOfferedByEnum = + (typeof LearningResourcesSearchRetrieveOfferedByEnum)[keyof typeof LearningResourcesSearchRetrieveOfferedByEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrievePlatformEnum = { + Edx: "edx", + Ocw: "ocw", + Oll: "oll", + Mitxonline: "mitxonline", + Bootcamps: "bootcamps", + Xpro: "xpro", + Csail: "csail", + Mitpe: "mitpe", + See: "see", + Scc: "scc", + Ctl: "ctl", + Whu: "whu", + Susskind: "susskind", + Globalalumni: "globalalumni", + Simplilearn: "simplilearn", + Emeritus: "emeritus", + Podcast: "podcast", + Youtube: "youtube", + Canvas: "canvas", + Climate: "climate", + Ovs: "ovs", +} as const +export type LearningResourcesSearchRetrievePlatformEnum = + (typeof LearningResourcesSearchRetrievePlatformEnum)[keyof typeof LearningResourcesSearchRetrievePlatformEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveResourceTypeEnum = { + Course: "course", + Program: "program", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Video: "video", + VideoPlaylist: "video_playlist", + Document: "document", +} as const +export type LearningResourcesSearchRetrieveResourceTypeEnum = + (typeof LearningResourcesSearchRetrieveResourceTypeEnum)[keyof typeof LearningResourcesSearchRetrieveResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveResourceTypeGroupEnum = { + Course: "course", + Program: "program", + LearningMaterial: "learning_material", +} as const +export type LearningResourcesSearchRetrieveResourceTypeGroupEnum = + (typeof LearningResourcesSearchRetrieveResourceTypeGroupEnum)[keyof typeof LearningResourcesSearchRetrieveResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveSearchModeEnum = { + Phrase: "phrase", + BestFields: "best_fields", + MostFields: "most_fields", + Hybrid: "hybrid", +} as const +export type LearningResourcesSearchRetrieveSearchModeEnum = + (typeof LearningResourcesSearchRetrieveSearchModeEnum)[keyof typeof LearningResourcesSearchRetrieveSearchModeEnum] +/** + * @export + */ +export const LearningResourcesSearchRetrieveSortbyEnum = { + Featured: "featured", + Id: "id", + Id2: "-id", + ReadableId: "readable_id", + ReadableId2: "-readable_id", + LastModified: "last_modified", + LastModified2: "-last_modified", + New: "new", + StartDate: "start_date", + StartDate2: "-start_date", + Mitcoursenumber: "mitcoursenumber", + Mitcoursenumber2: "-mitcoursenumber", + Views: "views", + Views2: "-views", + Upcoming: "upcoming", +} as const +export type LearningResourcesSearchRetrieveSortbyEnum = + (typeof LearningResourcesSearchRetrieveSortbyEnum)[keyof typeof LearningResourcesSearchRetrieveSortbyEnum] + +/** + * LearningResourcesUserSubscriptionApi - axios parameter creator + * @export + */ +export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * View for listing percolate query subscriptions for a user + * @summary Check if a user is subscribed to a specific query + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesUserSubscriptionCheckListSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesUserSubscriptionCheckListSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {LearningResourcesUserSubscriptionCheckListSourceTypeEnum} [source_type] The subscription type * `search_subscription_type` - search_subscription_type * `channel_subscription_type` - channel_subscription_type + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionCheckList: async ( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesUserSubscriptionCheckListSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesUserSubscriptionCheckListSortbyEnum, + source_type?: LearningResourcesUserSubscriptionCheckListSourceTypeEnum, + topic?: Array, + yearly_decay_percent?: number | null, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learning_resources_user_subscription/check/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (aggregations) { + localVarQueryParameter["aggregations"] = aggregations + } + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (content_file_score_weight !== undefined) { + localVarQueryParameter["content_file_score_weight"] = + content_file_score_weight + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (id) { + localVarQueryParameter["id"] = id + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (max_incompleteness_penalty !== undefined) { + localVarQueryParameter["max_incompleteness_penalty"] = + max_incompleteness_penalty + } + + if (min_score !== undefined) { + localVarQueryParameter["min_score"] = min_score + } + + if (ocw_topic) { + localVarQueryParameter["ocw_topic"] = ocw_topic + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (q !== undefined) { + localVarQueryParameter["q"] = q + } + + if (resource_category) { + localVarQueryParameter["resource_category"] = resource_category + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (search_mode !== undefined) { + localVarQueryParameter["search_mode"] = search_mode + } + + if (show_ocw_files !== undefined) { + localVarQueryParameter["show_ocw_files"] = show_ocw_files + } + + if (slop !== undefined) { + localVarQueryParameter["slop"] = slop + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (source_type !== undefined) { + localVarQueryParameter["source_type"] = source_type + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + if (yearly_decay_percent !== undefined) { + localVarQueryParameter["yearly_decay_percent"] = yearly_decay_percent + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * View for listing percolate query subscriptions for a user + * @summary List subscribed queries + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesUserSubscriptionListSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesUserSubscriptionListSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionList: async ( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesUserSubscriptionListSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesUserSubscriptionListSortbyEnum, + topic?: Array, + yearly_decay_percent?: number | null, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learning_resources_user_subscription/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (aggregations) { + localVarQueryParameter["aggregations"] = aggregations + } + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (content_file_score_weight !== undefined) { + localVarQueryParameter["content_file_score_weight"] = + content_file_score_weight + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (id) { + localVarQueryParameter["id"] = id + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (max_incompleteness_penalty !== undefined) { + localVarQueryParameter["max_incompleteness_penalty"] = + max_incompleteness_penalty + } + + if (min_score !== undefined) { + localVarQueryParameter["min_score"] = min_score + } + + if (ocw_topic) { + localVarQueryParameter["ocw_topic"] = ocw_topic + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (q !== undefined) { + localVarQueryParameter["q"] = q + } + + if (resource_category) { + localVarQueryParameter["resource_category"] = resource_category + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (search_mode !== undefined) { + localVarQueryParameter["search_mode"] = search_mode + } + + if (show_ocw_files !== undefined) { + localVarQueryParameter["show_ocw_files"] = show_ocw_files + } + + if (slop !== undefined) { + localVarQueryParameter["slop"] = slop + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + if (yearly_decay_percent !== undefined) { + localVarQueryParameter["yearly_decay_percent"] = yearly_decay_percent + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Subscribe a user to query + * @summary Subscribe user to query + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum} [source_type] The subscription type * `search_subscription_type` - search_subscription_type * `channel_subscription_type` - channel_subscription_type + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {PercolateQuerySubscriptionRequestRequest} [PercolateQuerySubscriptionRequestRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionSubscribeCreate: async ( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum, + source_type?: LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum, + topic?: Array, + yearly_decay_percent?: number | null, + PercolateQuerySubscriptionRequestRequest?: PercolateQuerySubscriptionRequestRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learning_resources_user_subscription/subscribe/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (aggregations) { + localVarQueryParameter["aggregations"] = aggregations + } + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (content_file_score_weight !== undefined) { + localVarQueryParameter["content_file_score_weight"] = + content_file_score_weight + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (id) { + localVarQueryParameter["id"] = id + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (max_incompleteness_penalty !== undefined) { + localVarQueryParameter["max_incompleteness_penalty"] = + max_incompleteness_penalty + } + + if (min_score !== undefined) { + localVarQueryParameter["min_score"] = min_score + } + + if (ocw_topic) { + localVarQueryParameter["ocw_topic"] = ocw_topic + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (q !== undefined) { + localVarQueryParameter["q"] = q + } + + if (resource_category) { + localVarQueryParameter["resource_category"] = resource_category + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (search_mode !== undefined) { + localVarQueryParameter["search_mode"] = search_mode + } + + if (show_ocw_files !== undefined) { + localVarQueryParameter["show_ocw_files"] = show_ocw_files + } + + if (slop !== undefined) { + localVarQueryParameter["slop"] = slop + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (source_type !== undefined) { + localVarQueryParameter["source_type"] = source_type + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + if (yearly_decay_percent !== undefined) { + localVarQueryParameter["yearly_decay_percent"] = yearly_decay_percent + } + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PercolateQuerySubscriptionRequestRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Unsubscribe a user from a query Args: pk (integer): The id of the query Returns: PercolateQuerySerializer: The percolate query + * @summary Unsubscribe user from query + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionUnsubscribeDestroy: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists( + "learningResourcesUserSubscriptionUnsubscribeDestroy", + "id", + id, + ) + const localVarPath = + `/api/v2/learning_resources_user_subscription/{id}/unsubscribe/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * LearningResourcesUserSubscriptionApi - functional programming interface + * @export + */ +export const LearningResourcesUserSubscriptionApiFp = function ( + configuration?: Configuration, +) { + const localVarAxiosParamCreator = + LearningResourcesUserSubscriptionApiAxiosParamCreator(configuration) + return { + /** + * View for listing percolate query subscriptions for a user + * @summary Check if a user is subscribed to a specific query + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesUserSubscriptionCheckListSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesUserSubscriptionCheckListSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {LearningResourcesUserSubscriptionCheckListSourceTypeEnum} [source_type] The subscription type * `search_subscription_type` - search_subscription_type * `channel_subscription_type` - channel_subscription_type + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesUserSubscriptionCheckList( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesUserSubscriptionCheckListSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesUserSubscriptionCheckListSortbyEnum, + source_type?: LearningResourcesUserSubscriptionCheckListSourceTypeEnum, + topic?: Array, + yearly_decay_percent?: number | null, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesUserSubscriptionCheckList( + aggregations, + certification, + certification_type, + content_file_score_weight, + course_feature, + delivery, + department, + dev_mode, + free, + id, + level, + limit, + max_incompleteness_penalty, + min_score, + ocw_topic, + offered_by, + offset, + platform, + professional, + q, + resource_category, + resource_type, + resource_type_group, + search_mode, + show_ocw_files, + slop, + sortby, + source_type, + topic, + yearly_decay_percent, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesUserSubscriptionApi.learningResourcesUserSubscriptionCheckList" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * View for listing percolate query subscriptions for a user + * @summary List subscribed queries + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesUserSubscriptionListSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesUserSubscriptionListSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesUserSubscriptionList( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesUserSubscriptionListSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesUserSubscriptionListSortbyEnum, + topic?: Array, + yearly_decay_percent?: number | null, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesUserSubscriptionList( + aggregations, + certification, + certification_type, + content_file_score_weight, + course_feature, + delivery, + department, + dev_mode, + free, + id, + level, + limit, + max_incompleteness_penalty, + min_score, + ocw_topic, + offered_by, + offset, + platform, + professional, + q, + resource_category, + resource_type, + resource_type_group, + search_mode, + show_ocw_files, + slop, + sortby, + topic, + yearly_decay_percent, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesUserSubscriptionApi.learningResourcesUserSubscriptionList" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Subscribe a user to query + * @summary Subscribe user to query + * @param {Array} [aggregations] Show resource counts by category + * @param {boolean | null} [certification] True if the learning resource offers a certificate + * @param {Array} [certification_type] The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {number | null} [content_file_score_weight] Score weight for content file data. 1 is the default. 0 means content files are ignored + * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ + * @param {Array} [delivery] The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations + * @param {boolean | null} [free] + * @param {Array} [id] The id value for the learning resource + * @param {Array} [level] + * @param {number} [limit] Number of results to return per page + * @param {number | null} [max_incompleteness_penalty] Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @param {number | null} [min_score] Minimum score value a text query result needs to have to be displayed + * @param {Array} [ocw_topic] The ocw topic name. + * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results + * @param {Array} [platform] The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean | null} [professional] + * @param {string} [q] The search text + * @param {Array} [resource_category] The resource category for the resource + * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @param {Array} [resource_type_group] + * @param {LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum} [search_mode] The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @param {boolean | null} [show_ocw_files] Whether to include select OCW content files in search results. + * @param {number | null} [slop] Allowed distance for phrase search + * @param {LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum} [source_type] The subscription type * `search_subscription_type` - search_subscription_type * `channel_subscription_type` - channel_subscription_type + * @param {Array} [topic] The topic name. To see a list of options go to api/v1/topics/ + * @param {number | null} [yearly_decay_percent] Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @param {PercolateQuerySubscriptionRequestRequest} [PercolateQuerySubscriptionRequestRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesUserSubscriptionSubscribeCreate( + aggregations?: Array, + certification?: boolean | null, + certification_type?: Array, + content_file_score_weight?: number | null, + course_feature?: Array, + delivery?: Array, + department?: Array, + dev_mode?: boolean | null, + free?: boolean | null, + id?: Array, + level?: Array, + limit?: number, + max_incompleteness_penalty?: number | null, + min_score?: number | null, + ocw_topic?: Array, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean | null, + q?: string, + resource_category?: Array, + resource_type?: Array, + resource_type_group?: Array, + search_mode?: LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum, + show_ocw_files?: boolean | null, + slop?: number | null, + sortby?: LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum, + source_type?: LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum, + topic?: Array, + yearly_decay_percent?: number | null, + PercolateQuerySubscriptionRequestRequest?: PercolateQuerySubscriptionRequestRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesUserSubscriptionSubscribeCreate( + aggregations, + certification, + certification_type, + content_file_score_weight, + course_feature, + delivery, + department, + dev_mode, + free, + id, + level, + limit, + max_incompleteness_penalty, + min_score, + ocw_topic, + offered_by, + offset, + platform, + professional, + q, + resource_category, + resource_type, + resource_type_group, + search_mode, + show_ocw_files, + slop, + sortby, + source_type, + topic, + yearly_decay_percent, + PercolateQuerySubscriptionRequestRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesUserSubscriptionApi.learningResourcesUserSubscriptionSubscribeCreate" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Unsubscribe a user from a query Args: pk (integer): The id of the query Returns: PercolateQuerySerializer: The percolate query + * @summary Unsubscribe user from query + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningResourcesUserSubscriptionUnsubscribeDestroy( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningResourcesUserSubscriptionUnsubscribeDestroy( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningResourcesUserSubscriptionApi.learningResourcesUserSubscriptionUnsubscribeDestroy" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * LearningResourcesUserSubscriptionApi - factory interface + * @export + */ +export const LearningResourcesUserSubscriptionApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = LearningResourcesUserSubscriptionApiFp(configuration) + return { + /** + * View for listing percolate query subscriptions for a user + * @summary Check if a user is subscribed to a specific query + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionCheckList( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .learningResourcesUserSubscriptionCheckList( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.source_type, + requestParameters.topic, + requestParameters.yearly_decay_percent, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * View for listing percolate query subscriptions for a user + * @summary List subscribed queries + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionList( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .learningResourcesUserSubscriptionList( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.topic, + requestParameters.yearly_decay_percent, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Subscribe a user to query + * @summary Subscribe user to query + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionSubscribeCreate( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesUserSubscriptionSubscribeCreate( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.source_type, + requestParameters.topic, + requestParameters.yearly_decay_percent, + requestParameters.PercolateQuerySubscriptionRequestRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Unsubscribe a user from a query Args: pk (integer): The id of the query Returns: PercolateQuerySerializer: The percolate query + * @summary Unsubscribe user from query + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionUnsubscribeDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningResourcesUserSubscriptionUnsubscribeDestroy( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionUnsubscribeDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningResourcesUserSubscriptionUnsubscribeDestroy( + requestParameters.id, + options, + ) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for learningResourcesUserSubscriptionCheckList operation in LearningResourcesUserSubscriptionApi. + * @export + * @interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest + */ +export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest { + /** + * Show resource counts by category + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_type_group' | 'resource_category'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly aggregations?: Array + + /** + * True if the learning resource offers a certificate + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly certification?: boolean | null + + /** + * The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'micromasters' | 'professional' | 'completion' | 'none'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly certification_type?: Array + + /** + * Score weight for content file data. 1 is the default. 0 means content files are ignored + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly content_file_score_weight?: number | null + + /** + * The course feature. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly course_feature?: Array + + /** + * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array<'online' | 'hybrid' | 'in_person' | 'offline'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly delivery?: Array + + /** + * The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly department?: Array + + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly dev_mode?: boolean | null + + /** + * + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly free?: boolean | null + + /** + * The id value for the learning resource + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly id?: Array + + /** + * + * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly level?: Array + + /** + * Number of results to return per page + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly limit?: number + + /** + * Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly max_incompleteness_penalty?: number | null + + /** + * Minimum score value a text query result needs to have to be displayed + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly min_score?: number | null + + /** + * The ocw topic name. + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly ocw_topic?: Array + + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'mitpe' | 'see' | 'climate'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly offset?: number + + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast' | 'youtube' | 'canvas' | 'climate' | 'ovs'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly professional?: boolean | null + + /** + * The search text + * @type {string} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly q?: string + + /** + * The resource category for the resource + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly resource_category?: Array + + /** + * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @type {Array<'course' | 'program' | 'learning_path' | 'podcast' | 'podcast_episode' | 'video' | 'video_playlist' | 'document'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly resource_type?: Array + + /** + * + * @type {Array<'course' | 'program' | 'learning_material'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly resource_type_group?: Array + + /** + * The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @type {'phrase' | 'best_fields' | 'most_fields' | 'hybrid'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly search_mode?: LearningResourcesUserSubscriptionCheckListSearchModeEnum + + /** + * Whether to include select OCW content files in search results. + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly show_ocw_files?: boolean | null + + /** + * Allowed distance for phrase search + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly slop?: number | null + + /** + * If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'featured' | 'id' | '-id' | 'readable_id' | '-readable_id' | 'last_modified' | '-last_modified' | 'new' | 'start_date' | '-start_date' | 'mitcoursenumber' | '-mitcoursenumber' | 'views' | '-views' | 'upcoming'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly sortby?: LearningResourcesUserSubscriptionCheckListSortbyEnum + + /** + * The subscription type * `search_subscription_type` - search_subscription_type * `channel_subscription_type` - channel_subscription_type + * @type {'search_subscription_type' | 'channel_subscription_type'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly source_type?: LearningResourcesUserSubscriptionCheckListSourceTypeEnum + + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly topic?: Array + + /** + * Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly yearly_decay_percent?: number | null +} + +/** + * Request parameters for learningResourcesUserSubscriptionList operation in LearningResourcesUserSubscriptionApi. + * @export + * @interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest + */ +export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest { + /** + * Show resource counts by category + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_type_group' | 'resource_category'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly aggregations?: Array + + /** + * True if the learning resource offers a certificate + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly certification?: boolean | null + + /** + * The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'micromasters' | 'professional' | 'completion' | 'none'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly certification_type?: Array + + /** + * Score weight for content file data. 1 is the default. 0 means content files are ignored + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly content_file_score_weight?: number | null + + /** + * The course feature. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly course_feature?: Array + + /** + * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array<'online' | 'hybrid' | 'in_person' | 'offline'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly delivery?: Array + + /** + * The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly department?: Array + + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly dev_mode?: boolean | null + + /** + * + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly free?: boolean | null + + /** + * The id value for the learning resource + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly id?: Array + + /** + * + * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly level?: Array + + /** + * Number of results to return per page + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly limit?: number + + /** + * Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly max_incompleteness_penalty?: number | null + + /** + * Minimum score value a text query result needs to have to be displayed + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly min_score?: number | null + + /** + * The ocw topic name. + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly ocw_topic?: Array + + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'mitpe' | 'see' | 'climate'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly offset?: number + + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast' | 'youtube' | 'canvas' | 'climate' | 'ovs'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly professional?: boolean | null + + /** + * The search text + * @type {string} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly q?: string + + /** + * The resource category for the resource + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly resource_category?: Array + + /** + * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @type {Array<'course' | 'program' | 'learning_path' | 'podcast' | 'podcast_episode' | 'video' | 'video_playlist' | 'document'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly resource_type?: Array + + /** + * + * @type {Array<'course' | 'program' | 'learning_material'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly resource_type_group?: Array + + /** + * The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @type {'phrase' | 'best_fields' | 'most_fields' | 'hybrid'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly search_mode?: LearningResourcesUserSubscriptionListSearchModeEnum + + /** + * Whether to include select OCW content files in search results. + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly show_ocw_files?: boolean | null + + /** + * Allowed distance for phrase search + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly slop?: number | null + + /** + * If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'featured' | 'id' | '-id' | 'readable_id' | '-readable_id' | 'last_modified' | '-last_modified' | 'new' | 'start_date' | '-start_date' | 'mitcoursenumber' | '-mitcoursenumber' | 'views' | '-views' | 'upcoming'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly sortby?: LearningResourcesUserSubscriptionListSortbyEnum + + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly topic?: Array + + /** + * Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly yearly_decay_percent?: number | null +} + +/** + * Request parameters for learningResourcesUserSubscriptionSubscribeCreate operation in LearningResourcesUserSubscriptionApi. + * @export + * @interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest + */ +export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest { + /** + * Show resource counts by category + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'delivery' | 'resource_type_group' | 'resource_category'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly aggregations?: Array + + /** + * True if the learning resource offers a certificate + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly certification?: boolean | null + + /** + * The type of certificate * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'micromasters' | 'professional' | 'completion' | 'none'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly certification_type?: Array + + /** + * Score weight for content file data. 1 is the default. 0 means content files are ignored + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly content_file_score_weight?: number | null + + /** + * The course feature. Possible options are at api/v1/course_features/ + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly course_feature?: Array + + /** + * The delivery options in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array<'online' | 'hybrid' | 'in_person' | 'offline'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly delivery?: Array + + /** + * The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly department?: Array + + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly dev_mode?: boolean | null + + /** + * + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly free?: boolean | null + + /** + * The id value for the learning resource + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly id?: Array + + /** + * + * @type {Array<'undergraduate' | 'graduate' | 'high_school' | 'noncredit' | 'advanced' | 'intermediate' | 'introductory'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly level?: Array + + /** + * Number of results to return per page + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly limit?: number + + /** + * Maximum score penalty for incomplete OCW courses in percent. An OCW course with completeness = 0 will have this score penalty. Partially complete courses have a linear penalty proportional to the degree of incompleteness. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly max_incompleteness_penalty?: number | null + + /** + * Minimum score value a text query result needs to have to be displayed + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly min_score?: number | null + + /** + * The ocw topic name. + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly ocw_topic?: Array + + /** + * The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'mitpe' | 'see' | 'climate'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly offset?: number + + /** + * The platform on which the learning resource is offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast' | 'youtube' | 'canvas' | 'climate' | 'ovs'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly professional?: boolean | null + + /** + * The search text + * @type {string} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly q?: string + + /** + * The resource category for the resource + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly resource_category?: Array + + /** + * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode * `video` - video * `video_playlist` - video playlist * `document` - document + * @type {Array<'course' | 'program' | 'learning_path' | 'podcast' | 'podcast_episode' | 'video' | 'video_playlist' | 'document'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly resource_type?: Array + + /** + * + * @type {Array<'course' | 'program' | 'learning_material'>} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly resource_type_group?: Array + + /** + * The open search search type for text queries * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid * `phrase` - phrase * `best_fields` - best_fields * `most_fields` - most_fields * `hybrid` - hybrid + * @type {'phrase' | 'best_fields' | 'most_fields' | 'hybrid'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly search_mode?: LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum + + /** + * Whether to include select OCW content files in search results. + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly show_ocw_files?: boolean | null + + /** + * Allowed distance for phrase search + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly slop?: number | null + + /** + * If the parameter starts with \'-\' the sort is in descending order * `featured` - Featured * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'featured' | 'id' | '-id' | 'readable_id' | '-readable_id' | 'last_modified' | '-last_modified' | 'new' | 'start_date' | '-start_date' | 'mitcoursenumber' | '-mitcoursenumber' | 'views' | '-views' | 'upcoming'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly sortby?: LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum + + /** + * The subscription type * `search_subscription_type` - search_subscription_type * `channel_subscription_type` - channel_subscription_type + * @type {'search_subscription_type' | 'channel_subscription_type'} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly source_type?: LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum + + /** + * The topic name. To see a list of options go to api/v1/topics/ + * @type {Array} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly topic?: Array + + /** + * Relevance score penalty percent per year for for resources without upcoming runs. Only affects results if there is a search term. + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly yearly_decay_percent?: number | null + + /** + * + * @type {PercolateQuerySubscriptionRequestRequest} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly PercolateQuerySubscriptionRequestRequest?: PercolateQuerySubscriptionRequestRequest +} + +/** + * Request parameters for learningResourcesUserSubscriptionUnsubscribeDestroy operation in LearningResourcesUserSubscriptionApi. + * @export + * @interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionUnsubscribeDestroyRequest + */ +export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionUnsubscribeDestroyRequest { + /** + * + * @type {number} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionUnsubscribeDestroy + */ + readonly id: number +} + +/** + * LearningResourcesUserSubscriptionApi - object-oriented interface + * @export + * @class LearningResourcesUserSubscriptionApi + * @extends {BaseAPI} + */ +export class LearningResourcesUserSubscriptionApi extends BaseAPI { + /** + * View for listing percolate query subscriptions for a user + * @summary Check if a user is subscribed to a specific query + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesUserSubscriptionApi + */ + public learningResourcesUserSubscriptionCheckList( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesUserSubscriptionApiFp(this.configuration) + .learningResourcesUserSubscriptionCheckList( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.source_type, + requestParameters.topic, + requestParameters.yearly_decay_percent, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * View for listing percolate query subscriptions for a user + * @summary List subscribed queries + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesUserSubscriptionApi + */ + public learningResourcesUserSubscriptionList( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesUserSubscriptionApiFp(this.configuration) + .learningResourcesUserSubscriptionList( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.topic, + requestParameters.yearly_decay_percent, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Subscribe a user to query + * @summary Subscribe user to query + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesUserSubscriptionApi + */ + public learningResourcesUserSubscriptionSubscribeCreate( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesUserSubscriptionApiFp(this.configuration) + .learningResourcesUserSubscriptionSubscribeCreate( + requestParameters.aggregations, + requestParameters.certification, + requestParameters.certification_type, + requestParameters.content_file_score_weight, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.dev_mode, + requestParameters.free, + requestParameters.id, + requestParameters.level, + requestParameters.limit, + requestParameters.max_incompleteness_penalty, + requestParameters.min_score, + requestParameters.ocw_topic, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.q, + requestParameters.resource_category, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.search_mode, + requestParameters.show_ocw_files, + requestParameters.slop, + requestParameters.sortby, + requestParameters.source_type, + requestParameters.topic, + requestParameters.yearly_decay_percent, + requestParameters.PercolateQuerySubscriptionRequestRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Unsubscribe a user from a query Args: pk (integer): The id of the query Returns: PercolateQuerySerializer: The percolate query + * @summary Unsubscribe user from query + * @param {LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionUnsubscribeDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningResourcesUserSubscriptionApi + */ + public learningResourcesUserSubscriptionUnsubscribeDestroy( + requestParameters: LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionUnsubscribeDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningResourcesUserSubscriptionApiFp(this.configuration) + .learningResourcesUserSubscriptionUnsubscribeDestroy( + requestParameters.id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListAggregationsEnum = { + ResourceType: "resource_type", + Certification: "certification", + CertificationType: "certification_type", + OfferedBy: "offered_by", + Platform: "platform", + Topic: "topic", + Department: "department", + Level: "level", + CourseFeature: "course_feature", + Professional: "professional", + Free: "free", + Delivery: "delivery", + ResourceTypeGroup: "resource_type_group", + ResourceCategory: "resource_category", +} as const +export type LearningResourcesUserSubscriptionCheckListAggregationsEnum = + (typeof LearningResourcesUserSubscriptionCheckListAggregationsEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListAggregationsEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListCertificationTypeEnum = { + Micromasters: "micromasters", + Professional: "professional", + Completion: "completion", + None: "none", +} as const +export type LearningResourcesUserSubscriptionCheckListCertificationTypeEnum = + (typeof LearningResourcesUserSubscriptionCheckListCertificationTypeEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesUserSubscriptionCheckListDeliveryEnum = + (typeof LearningResourcesUserSubscriptionCheckListDeliveryEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListDeliveryEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListDepartmentEnum = { + _1: "1", + _2: "2", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesUserSubscriptionCheckListDepartmentEnum = + (typeof LearningResourcesUserSubscriptionCheckListDepartmentEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListDepartmentEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListLevelEnum = { + Undergraduate: "undergraduate", + Graduate: "graduate", + HighSchool: "high_school", + Noncredit: "noncredit", + Advanced: "advanced", + Intermediate: "intermediate", + Introductory: "introductory", +} as const +export type LearningResourcesUserSubscriptionCheckListLevelEnum = + (typeof LearningResourcesUserSubscriptionCheckListLevelEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListLevelEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListOfferedByEnum = { + Mitx: "mitx", + Ocw: "ocw", + Bootcamps: "bootcamps", + Xpro: "xpro", + Mitpe: "mitpe", + See: "see", + Climate: "climate", +} as const +export type LearningResourcesUserSubscriptionCheckListOfferedByEnum = + (typeof LearningResourcesUserSubscriptionCheckListOfferedByEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListOfferedByEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListPlatformEnum = { + Edx: "edx", + Ocw: "ocw", + Oll: "oll", + Mitxonline: "mitxonline", + Bootcamps: "bootcamps", + Xpro: "xpro", + Csail: "csail", + Mitpe: "mitpe", + See: "see", + Scc: "scc", + Ctl: "ctl", + Whu: "whu", + Susskind: "susskind", + Globalalumni: "globalalumni", + Simplilearn: "simplilearn", + Emeritus: "emeritus", + Podcast: "podcast", + Youtube: "youtube", + Canvas: "canvas", + Climate: "climate", + Ovs: "ovs", +} as const +export type LearningResourcesUserSubscriptionCheckListPlatformEnum = + (typeof LearningResourcesUserSubscriptionCheckListPlatformEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListPlatformEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListResourceTypeEnum = { + Course: "course", + Program: "program", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Video: "video", + VideoPlaylist: "video_playlist", + Document: "document", +} as const +export type LearningResourcesUserSubscriptionCheckListResourceTypeEnum = + (typeof LearningResourcesUserSubscriptionCheckListResourceTypeEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListResourceTypeGroupEnum = { + Course: "course", + Program: "program", + LearningMaterial: "learning_material", +} as const +export type LearningResourcesUserSubscriptionCheckListResourceTypeGroupEnum = + (typeof LearningResourcesUserSubscriptionCheckListResourceTypeGroupEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListSearchModeEnum = { + Phrase: "phrase", + BestFields: "best_fields", + MostFields: "most_fields", + Hybrid: "hybrid", +} as const +export type LearningResourcesUserSubscriptionCheckListSearchModeEnum = + (typeof LearningResourcesUserSubscriptionCheckListSearchModeEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListSearchModeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListSortbyEnum = { + Featured: "featured", + Id: "id", + Id2: "-id", + ReadableId: "readable_id", + ReadableId2: "-readable_id", + LastModified: "last_modified", + LastModified2: "-last_modified", + New: "new", + StartDate: "start_date", + StartDate2: "-start_date", + Mitcoursenumber: "mitcoursenumber", + Mitcoursenumber2: "-mitcoursenumber", + Views: "views", + Views2: "-views", + Upcoming: "upcoming", +} as const +export type LearningResourcesUserSubscriptionCheckListSortbyEnum = + (typeof LearningResourcesUserSubscriptionCheckListSortbyEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListSortbyEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionCheckListSourceTypeEnum = { + SearchSubscriptionType: "search_subscription_type", + ChannelSubscriptionType: "channel_subscription_type", +} as const +export type LearningResourcesUserSubscriptionCheckListSourceTypeEnum = + (typeof LearningResourcesUserSubscriptionCheckListSourceTypeEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListSourceTypeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListAggregationsEnum = { + ResourceType: "resource_type", + Certification: "certification", + CertificationType: "certification_type", + OfferedBy: "offered_by", + Platform: "platform", + Topic: "topic", + Department: "department", + Level: "level", + CourseFeature: "course_feature", + Professional: "professional", + Free: "free", + Delivery: "delivery", + ResourceTypeGroup: "resource_type_group", + ResourceCategory: "resource_category", +} as const +export type LearningResourcesUserSubscriptionListAggregationsEnum = + (typeof LearningResourcesUserSubscriptionListAggregationsEnum)[keyof typeof LearningResourcesUserSubscriptionListAggregationsEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListCertificationTypeEnum = { + Micromasters: "micromasters", + Professional: "professional", + Completion: "completion", + None: "none", +} as const +export type LearningResourcesUserSubscriptionListCertificationTypeEnum = + (typeof LearningResourcesUserSubscriptionListCertificationTypeEnum)[keyof typeof LearningResourcesUserSubscriptionListCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesUserSubscriptionListDeliveryEnum = + (typeof LearningResourcesUserSubscriptionListDeliveryEnum)[keyof typeof LearningResourcesUserSubscriptionListDeliveryEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListDepartmentEnum = { + _1: "1", + _2: "2", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesUserSubscriptionListDepartmentEnum = + (typeof LearningResourcesUserSubscriptionListDepartmentEnum)[keyof typeof LearningResourcesUserSubscriptionListDepartmentEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListLevelEnum = { + Undergraduate: "undergraduate", + Graduate: "graduate", + HighSchool: "high_school", + Noncredit: "noncredit", + Advanced: "advanced", + Intermediate: "intermediate", + Introductory: "introductory", +} as const +export type LearningResourcesUserSubscriptionListLevelEnum = + (typeof LearningResourcesUserSubscriptionListLevelEnum)[keyof typeof LearningResourcesUserSubscriptionListLevelEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListOfferedByEnum = { + Mitx: "mitx", + Ocw: "ocw", + Bootcamps: "bootcamps", + Xpro: "xpro", + Mitpe: "mitpe", + See: "see", + Climate: "climate", +} as const +export type LearningResourcesUserSubscriptionListOfferedByEnum = + (typeof LearningResourcesUserSubscriptionListOfferedByEnum)[keyof typeof LearningResourcesUserSubscriptionListOfferedByEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListPlatformEnum = { + Edx: "edx", + Ocw: "ocw", + Oll: "oll", + Mitxonline: "mitxonline", + Bootcamps: "bootcamps", + Xpro: "xpro", + Csail: "csail", + Mitpe: "mitpe", + See: "see", + Scc: "scc", + Ctl: "ctl", + Whu: "whu", + Susskind: "susskind", + Globalalumni: "globalalumni", + Simplilearn: "simplilearn", + Emeritus: "emeritus", + Podcast: "podcast", + Youtube: "youtube", + Canvas: "canvas", + Climate: "climate", + Ovs: "ovs", +} as const +export type LearningResourcesUserSubscriptionListPlatformEnum = + (typeof LearningResourcesUserSubscriptionListPlatformEnum)[keyof typeof LearningResourcesUserSubscriptionListPlatformEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListResourceTypeEnum = { + Course: "course", + Program: "program", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Video: "video", + VideoPlaylist: "video_playlist", + Document: "document", +} as const +export type LearningResourcesUserSubscriptionListResourceTypeEnum = + (typeof LearningResourcesUserSubscriptionListResourceTypeEnum)[keyof typeof LearningResourcesUserSubscriptionListResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListResourceTypeGroupEnum = { + Course: "course", + Program: "program", + LearningMaterial: "learning_material", +} as const +export type LearningResourcesUserSubscriptionListResourceTypeGroupEnum = + (typeof LearningResourcesUserSubscriptionListResourceTypeGroupEnum)[keyof typeof LearningResourcesUserSubscriptionListResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListSearchModeEnum = { + Phrase: "phrase", + BestFields: "best_fields", + MostFields: "most_fields", + Hybrid: "hybrid", +} as const +export type LearningResourcesUserSubscriptionListSearchModeEnum = + (typeof LearningResourcesUserSubscriptionListSearchModeEnum)[keyof typeof LearningResourcesUserSubscriptionListSearchModeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionListSortbyEnum = { + Featured: "featured", + Id: "id", + Id2: "-id", + ReadableId: "readable_id", + ReadableId2: "-readable_id", + LastModified: "last_modified", + LastModified2: "-last_modified", + New: "new", + StartDate: "start_date", + StartDate2: "-start_date", + Mitcoursenumber: "mitcoursenumber", + Mitcoursenumber2: "-mitcoursenumber", + Views: "views", + Views2: "-views", + Upcoming: "upcoming", +} as const +export type LearningResourcesUserSubscriptionListSortbyEnum = + (typeof LearningResourcesUserSubscriptionListSortbyEnum)[keyof typeof LearningResourcesUserSubscriptionListSortbyEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum = + { + ResourceType: "resource_type", + Certification: "certification", + CertificationType: "certification_type", + OfferedBy: "offered_by", + Platform: "platform", + Topic: "topic", + Department: "department", + Level: "level", + CourseFeature: "course_feature", + Professional: "professional", + Free: "free", + Delivery: "delivery", + ResourceTypeGroup: "resource_type_group", + ResourceCategory: "resource_category", + } as const +export type LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateCertificationTypeEnum = + { + Micromasters: "micromasters", + Professional: "professional", + Completion: "completion", + None: "none", + } as const +export type LearningResourcesUserSubscriptionSubscribeCreateCertificationTypeEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateCertificationTypeEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateCertificationTypeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreateDeliveryEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateDeliveryEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateDeliveryEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateDepartmentEnum = { + _1: "1", + _2: "2", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreateDepartmentEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateDepartmentEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateDepartmentEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateLevelEnum = { + Undergraduate: "undergraduate", + Graduate: "graduate", + HighSchool: "high_school", + Noncredit: "noncredit", + Advanced: "advanced", + Intermediate: "intermediate", + Introductory: "introductory", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreateLevelEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateLevelEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateLevelEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateOfferedByEnum = { + Mitx: "mitx", + Ocw: "ocw", + Bootcamps: "bootcamps", + Xpro: "xpro", + Mitpe: "mitpe", + See: "see", + Climate: "climate", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreateOfferedByEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateOfferedByEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateOfferedByEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreatePlatformEnum = { + Edx: "edx", + Ocw: "ocw", + Oll: "oll", + Mitxonline: "mitxonline", + Bootcamps: "bootcamps", + Xpro: "xpro", + Csail: "csail", + Mitpe: "mitpe", + See: "see", + Scc: "scc", + Ctl: "ctl", + Whu: "whu", + Susskind: "susskind", + Globalalumni: "globalalumni", + Simplilearn: "simplilearn", + Emeritus: "emeritus", + Podcast: "podcast", + Youtube: "youtube", + Canvas: "canvas", + Climate: "climate", + Ovs: "ovs", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreatePlatformEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreatePlatformEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreatePlatformEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateResourceTypeEnum = + { + Course: "course", + Program: "program", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Video: "video", + VideoPlaylist: "video_playlist", + Document: "document", + } as const +export type LearningResourcesUserSubscriptionSubscribeCreateResourceTypeEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateResourceTypeEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateResourceTypeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateResourceTypeGroupEnum = + { + Course: "course", + Program: "program", + LearningMaterial: "learning_material", + } as const +export type LearningResourcesUserSubscriptionSubscribeCreateResourceTypeGroupEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateResourceTypeGroupEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateResourceTypeGroupEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum = { + Phrase: "phrase", + BestFields: "best_fields", + MostFields: "most_fields", + Hybrid: "hybrid", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateSearchModeEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum = { + Featured: "featured", + Id: "id", + Id2: "-id", + ReadableId: "readable_id", + ReadableId2: "-readable_id", + LastModified: "last_modified", + LastModified2: "-last_modified", + New: "new", + StartDate: "start_date", + StartDate2: "-start_date", + Mitcoursenumber: "mitcoursenumber", + Mitcoursenumber2: "-mitcoursenumber", + Views: "views", + Views2: "-views", + Upcoming: "upcoming", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateSortbyEnum] +/** + * @export + */ +export const LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum = { + SearchSubscriptionType: "search_subscription_type", + ChannelSubscriptionType: "channel_subscription_type", +} as const +export type LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum = + (typeof LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateSourceTypeEnum] + +/** + * LearningpathsApi - axios parameter creator + * @export + */ +export const LearningpathsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Create a learning path + * @summary Create + * @param {LearningPathResourceRequest} LearningPathResourceRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsCreate: async ( + LearningPathResourceRequest: LearningPathResourceRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'LearningPathResourceRequest' is not null or undefined + assertParamExists( + "learningpathsCreate", + "LearningPathResourceRequest", + LearningPathResourceRequest, + ) + const localVarPath = `/api/v2/learningpaths/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + LearningPathResourceRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Remove a learning path + * @summary Destroy + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsDestroy: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningpathsDestroy", "id", id) + const localVarPath = `/api/v2/learningpaths/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Add + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {LearningPathRelationshipCreateRequest} LearningPathRelationshipCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsCreate: async ( + learning_resource_id: number, + LearningPathRelationshipCreateRequest: LearningPathRelationshipCreateRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningpathsItemsCreate", + "learning_resource_id", + learning_resource_id, + ) + // verify required parameter 'LearningPathRelationshipCreateRequest' is not null or undefined + assertParamExists( + "learningpathsItemsCreate", + "LearningPathRelationshipCreateRequest", + LearningPathRelationshipCreateRequest, + ) + const localVarPath = + `/api/v2/learningpaths/{learning_resource_id}/items/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + LearningPathRelationshipCreateRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Remove + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsDestroy: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningpathsItemsDestroy", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningpathsItemsDestroy", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learningpaths/{learning_resource_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for LearningPath related resources + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsList: async ( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningpathsItemsList", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learningpaths/{learning_resource_id}/items/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Update + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {PatchedLearningPathRelationshipCreateRequest} [PatchedLearningPathRelationshipCreateRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsPartialUpdate: async ( + id: number, + learning_resource_id: number, + PatchedLearningPathRelationshipCreateRequest?: PatchedLearningPathRelationshipCreateRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningpathsItemsPartialUpdate", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningpathsItemsPartialUpdate", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learningpaths/{learning_resource_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedLearningPathRelationshipCreateRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsRetrieve: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningpathsItemsRetrieve", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "learningpathsItemsRetrieve", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/learningpaths/{learning_resource_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a paginated list of learning paths + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningpathsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningpathsListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learningpaths/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a list of all learning path items + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsMembershipList: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/learningpaths/membership/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Update individual fields of a learning path + * @summary Update + * @param {number} id A unique integer value identifying this learning resource. + * @param {PatchedLearningPathResourceRequest} [PatchedLearningPathResourceRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsPartialUpdate: async ( + id: number, + PatchedLearningPathResourceRequest?: PatchedLearningPathResourceRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningpathsPartialUpdate", "id", id) + const localVarPath = `/api/v2/learningpaths/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedLearningPathResourceRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrive a single learning path + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("learningpathsRetrieve", "id", id) + const localVarPath = `/api/v2/learningpaths/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * LearningpathsApi - functional programming interface + * @export + */ +export const LearningpathsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + LearningpathsApiAxiosParamCreator(configuration) + return { + /** + * Create a learning path + * @summary Create + * @param {LearningPathResourceRequest} LearningPathResourceRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsCreate( + LearningPathResourceRequest: LearningPathResourceRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsCreate( + LearningPathResourceRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsCreate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Remove a learning path + * @summary Destroy + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsDestroy( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsDestroy(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsDestroy"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Add + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {LearningPathRelationshipCreateRequest} LearningPathRelationshipCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsItemsCreate( + learning_resource_id: number, + LearningPathRelationshipCreateRequest: LearningPathRelationshipCreateRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsItemsCreate( + learning_resource_id, + LearningPathRelationshipCreateRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsItemsCreate"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Remove + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsItemsDestroy( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsItemsDestroy( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsItemsDestroy"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for LearningPath related resources + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsItemsList( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsItemsList( + learning_resource_id, + limit, + offset, + sortby, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsItemsList"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Update + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {PatchedLearningPathRelationshipCreateRequest} [PatchedLearningPathRelationshipCreateRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsItemsPartialUpdate( + id: number, + learning_resource_id: number, + PatchedLearningPathRelationshipCreateRequest?: PatchedLearningPathRelationshipCreateRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsItemsPartialUpdate( + id, + learning_resource_id, + PatchedLearningPathRelationshipCreateRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "LearningpathsApi.learningpathsItemsPartialUpdate" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id The learning resource id of the learning path + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsItemsRetrieve( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsItemsRetrieve( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsItemsRetrieve"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a paginated list of learning paths + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {LearningpathsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: LearningpathsListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a list of all learning path items + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsMembershipList( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsMembershipList(options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsMembershipList"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Update individual fields of a learning path + * @summary Update + * @param {number} id A unique integer value identifying this learning resource. + * @param {PatchedLearningPathResourceRequest} [PatchedLearningPathResourceRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsPartialUpdate( + id: number, + PatchedLearningPathResourceRequest?: PatchedLearningPathResourceRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsPartialUpdate( + id, + PatchedLearningPathResourceRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsPartialUpdate"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrive a single learning path + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async learningpathsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.learningpathsRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["LearningpathsApi.learningpathsRetrieve"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * LearningpathsApi - factory interface + * @export + */ +export const LearningpathsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = LearningpathsApiFp(configuration) + return { + /** + * Create a learning path + * @summary Create + * @param {LearningpathsApiLearningpathsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsCreate( + requestParameters: LearningpathsApiLearningpathsCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsCreate( + requestParameters.LearningPathResourceRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Remove a learning path + * @summary Destroy + * @param {LearningpathsApiLearningpathsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsDestroy( + requestParameters: LearningpathsApiLearningpathsDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsDestroy(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Add + * @param {LearningpathsApiLearningpathsItemsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsCreate( + requestParameters: LearningpathsApiLearningpathsItemsCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsItemsCreate( + requestParameters.learning_resource_id, + requestParameters.LearningPathRelationshipCreateRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Remove + * @param {LearningpathsApiLearningpathsItemsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsDestroy( + requestParameters: LearningpathsApiLearningpathsItemsDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsItemsDestroy( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for LearningPath related resources + * @param {LearningpathsApiLearningpathsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsList( + requestParameters: LearningpathsApiLearningpathsItemsListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Update + * @param {LearningpathsApiLearningpathsItemsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsPartialUpdate( + requestParameters: LearningpathsApiLearningpathsItemsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsItemsPartialUpdate( + requestParameters.id, + requestParameters.learning_resource_id, + requestParameters.PatchedLearningPathRelationshipCreateRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {LearningpathsApiLearningpathsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsItemsRetrieve( + requestParameters: LearningpathsApiLearningpathsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a paginated list of learning paths + * @summary List + * @param {LearningpathsApiLearningpathsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsList( + requestParameters: LearningpathsApiLearningpathsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a list of all learning path items + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsMembershipList( + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .learningpathsMembershipList(options) + .then((request) => request(axios, basePath)) + }, + /** + * Update individual fields of a learning path + * @summary Update + * @param {LearningpathsApiLearningpathsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsPartialUpdate( + requestParameters: LearningpathsApiLearningpathsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsPartialUpdate( + requestParameters.id, + requestParameters.PatchedLearningPathResourceRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrive a single learning path + * @summary Retrieve + * @param {LearningpathsApiLearningpathsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + learningpathsRetrieve( + requestParameters: LearningpathsApiLearningpathsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .learningpathsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for learningpathsCreate operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsCreateRequest + */ +export interface LearningpathsApiLearningpathsCreateRequest { + /** + * + * @type {LearningPathResourceRequest} + * @memberof LearningpathsApiLearningpathsCreate + */ + readonly LearningPathResourceRequest: LearningPathResourceRequest +} + +/** + * Request parameters for learningpathsDestroy operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsDestroyRequest + */ +export interface LearningpathsApiLearningpathsDestroyRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof LearningpathsApiLearningpathsDestroy + */ + readonly id: number +} + +/** + * Request parameters for learningpathsItemsCreate operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsItemsCreateRequest + */ +export interface LearningpathsApiLearningpathsItemsCreateRequest { + /** + * The learning resource id of the learning path + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsCreate + */ + readonly learning_resource_id: number + + /** + * + * @type {LearningPathRelationshipCreateRequest} + * @memberof LearningpathsApiLearningpathsItemsCreate + */ + readonly LearningPathRelationshipCreateRequest: LearningPathRelationshipCreateRequest +} + +/** + * Request parameters for learningpathsItemsDestroy operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsItemsDestroyRequest + */ +export interface LearningpathsApiLearningpathsItemsDestroyRequest { + /** + * A unique integer value identifying this learning resource relationship. + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsDestroy + */ + readonly id: number + + /** + * The learning resource id of the learning path + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsDestroy + */ + readonly learning_resource_id: number +} + +/** + * Request parameters for learningpathsItemsList operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsItemsListRequest + */ +export interface LearningpathsApiLearningpathsItemsListRequest { + /** + * The learning resource id of the learning path + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsList + */ + readonly learning_resource_id: number + + /** + * Number of results to return per page. + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsList + */ + readonly offset?: number + + /** + * Which field to use when ordering the results. + * @type {string} + * @memberof LearningpathsApiLearningpathsItemsList + */ + readonly sortby?: string +} + +/** + * Request parameters for learningpathsItemsPartialUpdate operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsItemsPartialUpdateRequest + */ +export interface LearningpathsApiLearningpathsItemsPartialUpdateRequest { + /** + * A unique integer value identifying this learning resource relationship. + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsPartialUpdate + */ + readonly id: number + + /** + * The learning resource id of the learning path + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsPartialUpdate + */ + readonly learning_resource_id: number + + /** + * + * @type {PatchedLearningPathRelationshipCreateRequest} + * @memberof LearningpathsApiLearningpathsItemsPartialUpdate + */ + readonly PatchedLearningPathRelationshipCreateRequest?: PatchedLearningPathRelationshipCreateRequest +} + +/** + * Request parameters for learningpathsItemsRetrieve operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsItemsRetrieveRequest + */ +export interface LearningpathsApiLearningpathsItemsRetrieveRequest { + /** + * A unique integer value identifying this learning resource relationship. + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsRetrieve + */ + readonly id: number + + /** + * The learning resource id of the learning path + * @type {number} + * @memberof LearningpathsApiLearningpathsItemsRetrieve + */ + readonly learning_resource_id: number +} + +/** + * Request parameters for learningpathsList operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsListRequest + */ +export interface LearningpathsApiLearningpathsListRequest { + /** + * + * @type {boolean} + * @memberof LearningpathsApiLearningpathsList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof LearningpathsApiLearningpathsList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof LearningpathsApiLearningpathsList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof LearningpathsApiLearningpathsList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof LearningpathsApiLearningpathsList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof LearningpathsApiLearningpathsList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof LearningpathsApiLearningpathsList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof LearningpathsApiLearningpathsList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof LearningpathsApiLearningpathsList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof LearningpathsApiLearningpathsList + */ + readonly sortby?: LearningpathsListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof LearningpathsApiLearningpathsList + */ + readonly topic?: Array +} + +/** + * Request parameters for learningpathsPartialUpdate operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsPartialUpdateRequest + */ +export interface LearningpathsApiLearningpathsPartialUpdateRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof LearningpathsApiLearningpathsPartialUpdate + */ + readonly id: number + + /** + * + * @type {PatchedLearningPathResourceRequest} + * @memberof LearningpathsApiLearningpathsPartialUpdate + */ + readonly PatchedLearningPathResourceRequest?: PatchedLearningPathResourceRequest +} + +/** + * Request parameters for learningpathsRetrieve operation in LearningpathsApi. + * @export + * @interface LearningpathsApiLearningpathsRetrieveRequest + */ +export interface LearningpathsApiLearningpathsRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof LearningpathsApiLearningpathsRetrieve + */ + readonly id: number +} + +/** + * LearningpathsApi - object-oriented interface + * @export + * @class LearningpathsApi + * @extends {BaseAPI} + */ +export class LearningpathsApi extends BaseAPI { + /** + * Create a learning path + * @summary Create + * @param {LearningpathsApiLearningpathsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsCreate( + requestParameters: LearningpathsApiLearningpathsCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsCreate( + requestParameters.LearningPathResourceRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Remove a learning path + * @summary Destroy + * @param {LearningpathsApiLearningpathsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsDestroy( + requestParameters: LearningpathsApiLearningpathsDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsDestroy(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Add + * @param {LearningpathsApiLearningpathsItemsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsItemsCreate( + requestParameters: LearningpathsApiLearningpathsItemsCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsItemsCreate( + requestParameters.learning_resource_id, + requestParameters.LearningPathRelationshipCreateRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Remove + * @param {LearningpathsApiLearningpathsItemsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsItemsDestroy( + requestParameters: LearningpathsApiLearningpathsItemsDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsItemsDestroy( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for LearningPath related resources + * @param {LearningpathsApiLearningpathsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsItemsList( + requestParameters: LearningpathsApiLearningpathsItemsListRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for LearningPath related resources + * @summary Learning Path Resource Relationship Update + * @param {LearningpathsApiLearningpathsItemsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsItemsPartialUpdate( + requestParameters: LearningpathsApiLearningpathsItemsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsItemsPartialUpdate( + requestParameters.id, + requestParameters.learning_resource_id, + requestParameters.PatchedLearningPathRelationshipCreateRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {LearningpathsApiLearningpathsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsItemsRetrieve( + requestParameters: LearningpathsApiLearningpathsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a paginated list of learning paths + * @summary List + * @param {LearningpathsApiLearningpathsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsList( + requestParameters: LearningpathsApiLearningpathsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a list of all learning path items + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsMembershipList(options?: RawAxiosRequestConfig) { + return LearningpathsApiFp(this.configuration) + .learningpathsMembershipList(options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Update individual fields of a learning path + * @summary Update + * @param {LearningpathsApiLearningpathsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsPartialUpdate( + requestParameters: LearningpathsApiLearningpathsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsPartialUpdate( + requestParameters.id, + requestParameters.PatchedLearningPathResourceRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrive a single learning path + * @summary Retrieve + * @param {LearningpathsApiLearningpathsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LearningpathsApi + */ + public learningpathsRetrieve( + requestParameters: LearningpathsApiLearningpathsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return LearningpathsApiFp(this.configuration) + .learningpathsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const LearningpathsListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type LearningpathsListCertificationTypeEnum = + (typeof LearningpathsListCertificationTypeEnum)[keyof typeof LearningpathsListCertificationTypeEnum] +/** + * @export + */ +export const LearningpathsListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type LearningpathsListDeliveryEnum = + (typeof LearningpathsListDeliveryEnum)[keyof typeof LearningpathsListDeliveryEnum] +/** + * @export + */ +export const LearningpathsListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type LearningpathsListDepartmentEnum = + (typeof LearningpathsListDepartmentEnum)[keyof typeof LearningpathsListDepartmentEnum] +/** + * @export + */ +export const LearningpathsListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type LearningpathsListLevelEnum = + (typeof LearningpathsListLevelEnum)[keyof typeof LearningpathsListLevelEnum] +/** + * @export + */ +export const LearningpathsListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type LearningpathsListOfferedByEnum = + (typeof LearningpathsListOfferedByEnum)[keyof typeof LearningpathsListOfferedByEnum] +/** + * @export + */ +export const LearningpathsListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type LearningpathsListPlatformEnum = + (typeof LearningpathsListPlatformEnum)[keyof typeof LearningpathsListPlatformEnum] +/** + * @export + */ +export const LearningpathsListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type LearningpathsListResourceTypeEnum = + (typeof LearningpathsListResourceTypeEnum)[keyof typeof LearningpathsListResourceTypeEnum] +/** + * @export + */ +export const LearningpathsListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type LearningpathsListResourceTypeGroupEnum = + (typeof LearningpathsListResourceTypeGroupEnum)[keyof typeof LearningpathsListResourceTypeGroupEnum] +/** + * @export + */ +export const LearningpathsListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type LearningpathsListSortbyEnum = + (typeof LearningpathsListSortbyEnum)[keyof typeof LearningpathsListSortbyEnum] + +/** + * OfferorsApi - axios parameter creator + * @export + */ +export const OfferorsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * MIT organizations that offer learning resources + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + offerorsList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/offerors/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * MIT organizations that offer learning resources + * @summary Retrieve + * @param {string} code A unique value identifying this learning resource offeror. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + offerorsRetrieve: async ( + code: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'code' is not null or undefined + assertParamExists("offerorsRetrieve", "code", code) + const localVarPath = `/api/v2/offerors/{code}/`.replace( + `{${"code"}}`, + encodeURIComponent(String(code)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * OfferorsApi - functional programming interface + * @export + */ +export const OfferorsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = OfferorsApiAxiosParamCreator(configuration) + return { + /** + * MIT organizations that offer learning resources + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async offerorsList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.offerorsList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["OfferorsApi.offerorsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * MIT organizations that offer learning resources + * @summary Retrieve + * @param {string} code A unique value identifying this learning resource offeror. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async offerorsRetrieve( + code: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.offerorsRetrieve(code, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["OfferorsApi.offerorsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * OfferorsApi - factory interface + * @export + */ +export const OfferorsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = OfferorsApiFp(configuration) + return { + /** + * MIT organizations that offer learning resources + * @summary List + * @param {OfferorsApiOfferorsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + offerorsList( + requestParameters: OfferorsApiOfferorsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .offerorsList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * MIT organizations that offer learning resources + * @summary Retrieve + * @param {OfferorsApiOfferorsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + offerorsRetrieve( + requestParameters: OfferorsApiOfferorsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .offerorsRetrieve(requestParameters.code, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for offerorsList operation in OfferorsApi. + * @export + * @interface OfferorsApiOfferorsListRequest + */ +export interface OfferorsApiOfferorsListRequest { + /** + * Number of results to return per page. + * @type {number} + * @memberof OfferorsApiOfferorsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof OfferorsApiOfferorsList + */ + readonly offset?: number +} + +/** + * Request parameters for offerorsRetrieve operation in OfferorsApi. + * @export + * @interface OfferorsApiOfferorsRetrieveRequest + */ +export interface OfferorsApiOfferorsRetrieveRequest { + /** + * A unique value identifying this learning resource offeror. + * @type {string} + * @memberof OfferorsApiOfferorsRetrieve + */ + readonly code: string +} + +/** + * OfferorsApi - object-oriented interface + * @export + * @class OfferorsApi + * @extends {BaseAPI} + */ +export class OfferorsApi extends BaseAPI { + /** + * MIT organizations that offer learning resources + * @summary List + * @param {OfferorsApiOfferorsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OfferorsApi + */ + public offerorsList( + requestParameters: OfferorsApiOfferorsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return OfferorsApiFp(this.configuration) + .offerorsList(requestParameters.limit, requestParameters.offset, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * MIT organizations that offer learning resources + * @summary Retrieve + * @param {OfferorsApiOfferorsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OfferorsApi + */ + public offerorsRetrieve( + requestParameters: OfferorsApiOfferorsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return OfferorsApiFp(this.configuration) + .offerorsRetrieve(requestParameters.code, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * PlatformsApi - axios parameter creator + * @export + */ +export const PlatformsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Platforms on which learning resources are hosted + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + platformsList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/platforms/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Platforms on which learning resources are hosted + * @summary Retrieve + * @param {string} code A unique value identifying this learning resource platform. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + platformsRetrieve: async ( + code: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'code' is not null or undefined + assertParamExists("platformsRetrieve", "code", code) + const localVarPath = `/api/v2/platforms/{code}/`.replace( + `{${"code"}}`, + encodeURIComponent(String(code)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * PlatformsApi - functional programming interface + * @export + */ +export const PlatformsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = PlatformsApiAxiosParamCreator(configuration) + return { + /** + * Platforms on which learning resources are hosted + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async platformsList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.platformsList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PlatformsApi.platformsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Platforms on which learning resources are hosted + * @summary Retrieve + * @param {string} code A unique value identifying this learning resource platform. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async platformsRetrieve( + code: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.platformsRetrieve(code, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PlatformsApi.platformsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * PlatformsApi - factory interface + * @export + */ +export const PlatformsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = PlatformsApiFp(configuration) + return { + /** + * Platforms on which learning resources are hosted + * @summary List + * @param {PlatformsApiPlatformsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + platformsList( + requestParameters: PlatformsApiPlatformsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .platformsList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Platforms on which learning resources are hosted + * @summary Retrieve + * @param {PlatformsApiPlatformsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + platformsRetrieve( + requestParameters: PlatformsApiPlatformsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .platformsRetrieve(requestParameters.code, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for platformsList operation in PlatformsApi. + * @export + * @interface PlatformsApiPlatformsListRequest + */ +export interface PlatformsApiPlatformsListRequest { + /** + * Number of results to return per page. + * @type {number} + * @memberof PlatformsApiPlatformsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof PlatformsApiPlatformsList + */ + readonly offset?: number +} + +/** + * Request parameters for platformsRetrieve operation in PlatformsApi. + * @export + * @interface PlatformsApiPlatformsRetrieveRequest + */ +export interface PlatformsApiPlatformsRetrieveRequest { + /** + * A unique value identifying this learning resource platform. + * @type {string} + * @memberof PlatformsApiPlatformsRetrieve + */ + readonly code: string +} + +/** + * PlatformsApi - object-oriented interface + * @export + * @class PlatformsApi + * @extends {BaseAPI} + */ +export class PlatformsApi extends BaseAPI { + /** + * Platforms on which learning resources are hosted + * @summary List + * @param {PlatformsApiPlatformsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PlatformsApi + */ + public platformsList( + requestParameters: PlatformsApiPlatformsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return PlatformsApiFp(this.configuration) + .platformsList(requestParameters.limit, requestParameters.offset, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Platforms on which learning resources are hosted + * @summary Retrieve + * @param {PlatformsApiPlatformsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PlatformsApi + */ + public platformsRetrieve( + requestParameters: PlatformsApiPlatformsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return PlatformsApiFp(this.configuration) + .platformsRetrieve(requestParameters.code, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * PodcastEpisodesApi - axios parameter creator + * @export + */ +export const PodcastEpisodesApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get a paginated list of podcast episodes + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {PodcastEpisodesListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastEpisodesList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: PodcastEpisodesListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/podcast_episodes/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single podcast episode + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastEpisodesRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("podcastEpisodesRetrieve", "id", id) + const localVarPath = `/api/v2/podcast_episodes/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * PodcastEpisodesApi - functional programming interface + * @export + */ +export const PodcastEpisodesApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + PodcastEpisodesApiAxiosParamCreator(configuration) + return { + /** + * Get a paginated list of podcast episodes + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {PodcastEpisodesListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async podcastEpisodesList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: PodcastEpisodesListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.podcastEpisodesList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PodcastEpisodesApi.podcastEpisodesList"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single podcast episode + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async podcastEpisodesRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.podcastEpisodesRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PodcastEpisodesApi.podcastEpisodesRetrieve"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * PodcastEpisodesApi - factory interface + * @export + */ +export const PodcastEpisodesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = PodcastEpisodesApiFp(configuration) + return { + /** + * Get a paginated list of podcast episodes + * @summary List + * @param {PodcastEpisodesApiPodcastEpisodesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastEpisodesList( + requestParameters: PodcastEpisodesApiPodcastEpisodesListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .podcastEpisodesList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single podcast episode + * @summary Retrieve + * @param {PodcastEpisodesApiPodcastEpisodesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastEpisodesRetrieve( + requestParameters: PodcastEpisodesApiPodcastEpisodesRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .podcastEpisodesRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for podcastEpisodesList operation in PodcastEpisodesApi. + * @export + * @interface PodcastEpisodesApiPodcastEpisodesListRequest + */ +export interface PodcastEpisodesApiPodcastEpisodesListRequest { + /** + * + * @type {boolean} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly sortby?: PodcastEpisodesListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof PodcastEpisodesApiPodcastEpisodesList + */ + readonly topic?: Array +} + +/** + * Request parameters for podcastEpisodesRetrieve operation in PodcastEpisodesApi. + * @export + * @interface PodcastEpisodesApiPodcastEpisodesRetrieveRequest + */ +export interface PodcastEpisodesApiPodcastEpisodesRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof PodcastEpisodesApiPodcastEpisodesRetrieve + */ + readonly id: number +} + +/** + * PodcastEpisodesApi - object-oriented interface + * @export + * @class PodcastEpisodesApi + * @extends {BaseAPI} + */ +export class PodcastEpisodesApi extends BaseAPI { + /** + * Get a paginated list of podcast episodes + * @summary List + * @param {PodcastEpisodesApiPodcastEpisodesListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PodcastEpisodesApi + */ + public podcastEpisodesList( + requestParameters: PodcastEpisodesApiPodcastEpisodesListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return PodcastEpisodesApiFp(this.configuration) + .podcastEpisodesList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single podcast episode + * @summary Retrieve + * @param {PodcastEpisodesApiPodcastEpisodesRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PodcastEpisodesApi + */ + public podcastEpisodesRetrieve( + requestParameters: PodcastEpisodesApiPodcastEpisodesRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return PodcastEpisodesApiFp(this.configuration) + .podcastEpisodesRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const PodcastEpisodesListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type PodcastEpisodesListCertificationTypeEnum = + (typeof PodcastEpisodesListCertificationTypeEnum)[keyof typeof PodcastEpisodesListCertificationTypeEnum] +/** + * @export + */ +export const PodcastEpisodesListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type PodcastEpisodesListDeliveryEnum = + (typeof PodcastEpisodesListDeliveryEnum)[keyof typeof PodcastEpisodesListDeliveryEnum] +/** + * @export + */ +export const PodcastEpisodesListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type PodcastEpisodesListDepartmentEnum = + (typeof PodcastEpisodesListDepartmentEnum)[keyof typeof PodcastEpisodesListDepartmentEnum] +/** + * @export + */ +export const PodcastEpisodesListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type PodcastEpisodesListLevelEnum = + (typeof PodcastEpisodesListLevelEnum)[keyof typeof PodcastEpisodesListLevelEnum] +/** + * @export + */ +export const PodcastEpisodesListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type PodcastEpisodesListOfferedByEnum = + (typeof PodcastEpisodesListOfferedByEnum)[keyof typeof PodcastEpisodesListOfferedByEnum] +/** + * @export + */ +export const PodcastEpisodesListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type PodcastEpisodesListPlatformEnum = + (typeof PodcastEpisodesListPlatformEnum)[keyof typeof PodcastEpisodesListPlatformEnum] +/** + * @export + */ +export const PodcastEpisodesListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type PodcastEpisodesListResourceTypeEnum = + (typeof PodcastEpisodesListResourceTypeEnum)[keyof typeof PodcastEpisodesListResourceTypeEnum] +/** + * @export + */ +export const PodcastEpisodesListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type PodcastEpisodesListResourceTypeGroupEnum = + (typeof PodcastEpisodesListResourceTypeGroupEnum)[keyof typeof PodcastEpisodesListResourceTypeGroupEnum] +/** + * @export + */ +export const PodcastEpisodesListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type PodcastEpisodesListSortbyEnum = + (typeof PodcastEpisodesListSortbyEnum)[keyof typeof PodcastEpisodesListSortbyEnum] + +/** + * PodcastsApi - axios parameter creator + * @export + */ +export const PodcastsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {number} learning_resource_id id of the parent learning resource + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsItemsList: async ( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "podcastsItemsList", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/podcasts/{learning_resource_id}/items/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsItemsRetrieve: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("podcastsItemsRetrieve", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "podcastsItemsRetrieve", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = `/api/v2/podcasts/{learning_resource_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a paginated list of podcasts + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {PodcastsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: PodcastsListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/podcasts/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single podcast + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("podcastsRetrieve", "id", id) + const localVarPath = `/api/v2/podcasts/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * PodcastsApi - functional programming interface + * @export + */ +export const PodcastsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = PodcastsApiAxiosParamCreator(configuration) + return { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {number} learning_resource_id id of the parent learning resource + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async podcastsItemsList( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.podcastsItemsList( + learning_resource_id, + limit, + offset, + sortby, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PodcastsApi.podcastsItemsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async podcastsItemsRetrieve( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.podcastsItemsRetrieve( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PodcastsApi.podcastsItemsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a paginated list of podcasts + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {PodcastsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async podcastsList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: PodcastsListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PodcastsApi.podcastsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single podcast + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async podcastsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.podcastsRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PodcastsApi.podcastsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * PodcastsApi - factory interface + * @export + */ +export const PodcastsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = PodcastsApiFp(configuration) + return { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {PodcastsApiPodcastsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsItemsList( + requestParameters: PodcastsApiPodcastsItemsListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .podcastsItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {PodcastsApiPodcastsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsItemsRetrieve( + requestParameters: PodcastsApiPodcastsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .podcastsItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a paginated list of podcasts + * @summary List + * @param {PodcastsApiPodcastsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsList( + requestParameters: PodcastsApiPodcastsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .podcastsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single podcast + * @summary Retrieve + * @param {PodcastsApiPodcastsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + podcastsRetrieve( + requestParameters: PodcastsApiPodcastsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .podcastsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for podcastsItemsList operation in PodcastsApi. + * @export + * @interface PodcastsApiPodcastsItemsListRequest + */ +export interface PodcastsApiPodcastsItemsListRequest { + /** + * id of the parent learning resource + * @type {number} + * @memberof PodcastsApiPodcastsItemsList + */ + readonly learning_resource_id: number + + /** + * Number of results to return per page. + * @type {number} + * @memberof PodcastsApiPodcastsItemsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof PodcastsApiPodcastsItemsList + */ + readonly offset?: number + + /** + * Which field to use when ordering the results. + * @type {string} + * @memberof PodcastsApiPodcastsItemsList + */ + readonly sortby?: string +} + +/** + * Request parameters for podcastsItemsRetrieve operation in PodcastsApi. + * @export + * @interface PodcastsApiPodcastsItemsRetrieveRequest + */ +export interface PodcastsApiPodcastsItemsRetrieveRequest { + /** + * A unique integer value identifying this learning resource relationship. + * @type {number} + * @memberof PodcastsApiPodcastsItemsRetrieve + */ + readonly id: number + + /** + * id of the parent learning resource + * @type {number} + * @memberof PodcastsApiPodcastsItemsRetrieve + */ + readonly learning_resource_id: number +} + +/** + * Request parameters for podcastsList operation in PodcastsApi. + * @export + * @interface PodcastsApiPodcastsListRequest + */ +export interface PodcastsApiPodcastsListRequest { + /** + * + * @type {boolean} + * @memberof PodcastsApiPodcastsList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof PodcastsApiPodcastsList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof PodcastsApiPodcastsList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof PodcastsApiPodcastsList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof PodcastsApiPodcastsList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof PodcastsApiPodcastsList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof PodcastsApiPodcastsList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof PodcastsApiPodcastsList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof PodcastsApiPodcastsList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof PodcastsApiPodcastsList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof PodcastsApiPodcastsList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof PodcastsApiPodcastsList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof PodcastsApiPodcastsList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof PodcastsApiPodcastsList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof PodcastsApiPodcastsList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof PodcastsApiPodcastsList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof PodcastsApiPodcastsList + */ + readonly sortby?: PodcastsListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof PodcastsApiPodcastsList + */ + readonly topic?: Array +} + +/** + * Request parameters for podcastsRetrieve operation in PodcastsApi. + * @export + * @interface PodcastsApiPodcastsRetrieveRequest + */ +export interface PodcastsApiPodcastsRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof PodcastsApiPodcastsRetrieve + */ + readonly id: number +} + +/** + * PodcastsApi - object-oriented interface + * @export + * @class PodcastsApi + * @extends {BaseAPI} + */ +export class PodcastsApi extends BaseAPI { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {PodcastsApiPodcastsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PodcastsApi + */ + public podcastsItemsList( + requestParameters: PodcastsApiPodcastsItemsListRequest, + options?: RawAxiosRequestConfig, + ) { + return PodcastsApiFp(this.configuration) + .podcastsItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {PodcastsApiPodcastsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PodcastsApi + */ + public podcastsItemsRetrieve( + requestParameters: PodcastsApiPodcastsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return PodcastsApiFp(this.configuration) + .podcastsItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a paginated list of podcasts + * @summary List + * @param {PodcastsApiPodcastsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PodcastsApi + */ + public podcastsList( + requestParameters: PodcastsApiPodcastsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return PodcastsApiFp(this.configuration) + .podcastsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single podcast + * @summary Retrieve + * @param {PodcastsApiPodcastsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PodcastsApi + */ + public podcastsRetrieve( + requestParameters: PodcastsApiPodcastsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return PodcastsApiFp(this.configuration) + .podcastsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const PodcastsListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type PodcastsListCertificationTypeEnum = + (typeof PodcastsListCertificationTypeEnum)[keyof typeof PodcastsListCertificationTypeEnum] +/** + * @export + */ +export const PodcastsListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type PodcastsListDeliveryEnum = + (typeof PodcastsListDeliveryEnum)[keyof typeof PodcastsListDeliveryEnum] +/** + * @export + */ +export const PodcastsListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type PodcastsListDepartmentEnum = + (typeof PodcastsListDepartmentEnum)[keyof typeof PodcastsListDepartmentEnum] +/** + * @export + */ +export const PodcastsListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type PodcastsListLevelEnum = + (typeof PodcastsListLevelEnum)[keyof typeof PodcastsListLevelEnum] +/** + * @export + */ +export const PodcastsListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type PodcastsListOfferedByEnum = + (typeof PodcastsListOfferedByEnum)[keyof typeof PodcastsListOfferedByEnum] +/** + * @export + */ +export const PodcastsListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type PodcastsListPlatformEnum = + (typeof PodcastsListPlatformEnum)[keyof typeof PodcastsListPlatformEnum] +/** + * @export + */ +export const PodcastsListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type PodcastsListResourceTypeEnum = + (typeof PodcastsListResourceTypeEnum)[keyof typeof PodcastsListResourceTypeEnum] +/** + * @export + */ +export const PodcastsListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type PodcastsListResourceTypeGroupEnum = + (typeof PodcastsListResourceTypeGroupEnum)[keyof typeof PodcastsListResourceTypeGroupEnum] +/** + * @export + */ +export const PodcastsListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type PodcastsListSortbyEnum = + (typeof PodcastsListSortbyEnum)[keyof typeof PodcastsListSortbyEnum] + +/** + * ProgramsApi - axios parameter creator + * @export + */ +export const ProgramsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get a paginated list of programs + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {ProgramsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + programsList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: ProgramsListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/programs/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single program + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + programsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("programsRetrieve", "id", id) + const localVarPath = `/api/v2/programs/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * ProgramsApi - functional programming interface + * @export + */ +export const ProgramsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = ProgramsApiAxiosParamCreator(configuration) + return { + /** + * Get a paginated list of programs + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {ProgramsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async programsList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: ProgramsListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.programsList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["ProgramsApi.programsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single program + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async programsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.programsRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["ProgramsApi.programsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * ProgramsApi - factory interface + * @export + */ +export const ProgramsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = ProgramsApiFp(configuration) + return { + /** + * Get a paginated list of programs + * @summary List + * @param {ProgramsApiProgramsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + programsList( + requestParameters: ProgramsApiProgramsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .programsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single program + * @summary Retrieve + * @param {ProgramsApiProgramsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + programsRetrieve( + requestParameters: ProgramsApiProgramsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .programsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for programsList operation in ProgramsApi. + * @export + * @interface ProgramsApiProgramsListRequest + */ +export interface ProgramsApiProgramsListRequest { + /** + * + * @type {boolean} + * @memberof ProgramsApiProgramsList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof ProgramsApiProgramsList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof ProgramsApiProgramsList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof ProgramsApiProgramsList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof ProgramsApiProgramsList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof ProgramsApiProgramsList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof ProgramsApiProgramsList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof ProgramsApiProgramsList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof ProgramsApiProgramsList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof ProgramsApiProgramsList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof ProgramsApiProgramsList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof ProgramsApiProgramsList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof ProgramsApiProgramsList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof ProgramsApiProgramsList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof ProgramsApiProgramsList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof ProgramsApiProgramsList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof ProgramsApiProgramsList + */ + readonly sortby?: ProgramsListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof ProgramsApiProgramsList + */ + readonly topic?: Array +} + +/** + * Request parameters for programsRetrieve operation in ProgramsApi. + * @export + * @interface ProgramsApiProgramsRetrieveRequest + */ +export interface ProgramsApiProgramsRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof ProgramsApiProgramsRetrieve + */ + readonly id: number +} + +/** + * ProgramsApi - object-oriented interface + * @export + * @class ProgramsApi + * @extends {BaseAPI} + */ +export class ProgramsApi extends BaseAPI { + /** + * Get a paginated list of programs + * @summary List + * @param {ProgramsApiProgramsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProgramsApi + */ + public programsList( + requestParameters: ProgramsApiProgramsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return ProgramsApiFp(this.configuration) + .programsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single program + * @summary Retrieve + * @param {ProgramsApiProgramsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProgramsApi + */ + public programsRetrieve( + requestParameters: ProgramsApiProgramsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return ProgramsApiFp(this.configuration) + .programsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const ProgramsListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type ProgramsListCertificationTypeEnum = + (typeof ProgramsListCertificationTypeEnum)[keyof typeof ProgramsListCertificationTypeEnum] +/** + * @export + */ +export const ProgramsListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type ProgramsListDeliveryEnum = + (typeof ProgramsListDeliveryEnum)[keyof typeof ProgramsListDeliveryEnum] +/** + * @export + */ +export const ProgramsListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type ProgramsListDepartmentEnum = + (typeof ProgramsListDepartmentEnum)[keyof typeof ProgramsListDepartmentEnum] +/** + * @export + */ +export const ProgramsListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type ProgramsListLevelEnum = + (typeof ProgramsListLevelEnum)[keyof typeof ProgramsListLevelEnum] +/** + * @export + */ +export const ProgramsListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type ProgramsListOfferedByEnum = + (typeof ProgramsListOfferedByEnum)[keyof typeof ProgramsListOfferedByEnum] +/** + * @export + */ +export const ProgramsListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type ProgramsListPlatformEnum = + (typeof ProgramsListPlatformEnum)[keyof typeof ProgramsListPlatformEnum] +/** + * @export + */ +export const ProgramsListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type ProgramsListResourceTypeEnum = + (typeof ProgramsListResourceTypeEnum)[keyof typeof ProgramsListResourceTypeEnum] +/** + * @export + */ +export const ProgramsListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type ProgramsListResourceTypeGroupEnum = + (typeof ProgramsListResourceTypeGroupEnum)[keyof typeof ProgramsListResourceTypeGroupEnum] +/** + * @export + */ +export const ProgramsListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type ProgramsListSortbyEnum = + (typeof ProgramsListSortbyEnum)[keyof typeof ProgramsListSortbyEnum] + +/** + * SchoolsApi - axios parameter creator + * @export + */ +export const SchoolsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * MIT schools + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + schoolsList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/schools/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * MIT schools + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource school. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + schoolsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("schoolsRetrieve", "id", id) + const localVarPath = `/api/v2/schools/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * SchoolsApi - functional programming interface + * @export + */ +export const SchoolsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = SchoolsApiAxiosParamCreator(configuration) + return { + /** + * MIT schools + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async schoolsList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.schoolsList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["SchoolsApi.schoolsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * MIT schools + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource school. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async schoolsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.schoolsRetrieve( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["SchoolsApi.schoolsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * SchoolsApi - factory interface + * @export + */ +export const SchoolsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = SchoolsApiFp(configuration) + return { + /** + * MIT schools + * @summary List + * @param {SchoolsApiSchoolsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + schoolsList( + requestParameters: SchoolsApiSchoolsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .schoolsList(requestParameters.limit, requestParameters.offset, options) + .then((request) => request(axios, basePath)) + }, + /** + * MIT schools + * @summary Retrieve + * @param {SchoolsApiSchoolsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + schoolsRetrieve( + requestParameters: SchoolsApiSchoolsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .schoolsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for schoolsList operation in SchoolsApi. + * @export + * @interface SchoolsApiSchoolsListRequest + */ +export interface SchoolsApiSchoolsListRequest { + /** + * Number of results to return per page. + * @type {number} + * @memberof SchoolsApiSchoolsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof SchoolsApiSchoolsList + */ + readonly offset?: number +} + +/** + * Request parameters for schoolsRetrieve operation in SchoolsApi. + * @export + * @interface SchoolsApiSchoolsRetrieveRequest + */ +export interface SchoolsApiSchoolsRetrieveRequest { + /** + * A unique integer value identifying this learning resource school. + * @type {number} + * @memberof SchoolsApiSchoolsRetrieve + */ + readonly id: number +} + +/** + * SchoolsApi - object-oriented interface + * @export + * @class SchoolsApi + * @extends {BaseAPI} + */ +export class SchoolsApi extends BaseAPI { + /** + * MIT schools + * @summary List + * @param {SchoolsApiSchoolsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SchoolsApi + */ + public schoolsList( + requestParameters: SchoolsApiSchoolsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return SchoolsApiFp(this.configuration) + .schoolsList(requestParameters.limit, requestParameters.offset, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * MIT schools + * @summary Retrieve + * @param {SchoolsApiSchoolsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SchoolsApi + */ + public schoolsRetrieve( + requestParameters: SchoolsApiSchoolsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return SchoolsApiFp(this.configuration) + .schoolsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * TopicsApi - axios parameter creator + * @export + */ +export const TopicsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Topics covered by learning resources + * @summary List + * @param {boolean} [is_toplevel] Filter top-level topics + * @param {number} [limit] Number of results to return per page. + * @param {Array} [name] Topic name + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [parent_topic_id] Parent topic ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + topicsList: async ( + is_toplevel?: boolean, + limit?: number, + name?: Array, + offset?: number, + parent_topic_id?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/topics/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (is_toplevel !== undefined) { + localVarQueryParameter["is_toplevel"] = is_toplevel + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (name) { + localVarQueryParameter["name"] = name + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (parent_topic_id) { + localVarQueryParameter["parent_topic_id"] = parent_topic_id + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Topics covered by learning resources + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource topic. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + topicsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("topicsRetrieve", "id", id) + const localVarPath = `/api/v2/topics/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * TopicsApi - functional programming interface + * @export + */ +export const TopicsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = TopicsApiAxiosParamCreator(configuration) + return { + /** + * Topics covered by learning resources + * @summary List + * @param {boolean} [is_toplevel] Filter top-level topics + * @param {number} [limit] Number of results to return per page. + * @param {Array} [name] Topic name + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [parent_topic_id] Parent topic ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async topicsList( + is_toplevel?: boolean, + limit?: number, + name?: Array, + offset?: number, + parent_topic_id?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.topicsList( + is_toplevel, + limit, + name, + offset, + parent_topic_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["TopicsApi.topicsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Topics covered by learning resources + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource topic. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async topicsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.topicsRetrieve( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["TopicsApi.topicsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * TopicsApi - factory interface + * @export + */ +export const TopicsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = TopicsApiFp(configuration) + return { + /** + * Topics covered by learning resources + * @summary List + * @param {TopicsApiTopicsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + topicsList( + requestParameters: TopicsApiTopicsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .topicsList( + requestParameters.is_toplevel, + requestParameters.limit, + requestParameters.name, + requestParameters.offset, + requestParameters.parent_topic_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Topics covered by learning resources + * @summary Retrieve + * @param {TopicsApiTopicsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + topicsRetrieve( + requestParameters: TopicsApiTopicsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .topicsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for topicsList operation in TopicsApi. + * @export + * @interface TopicsApiTopicsListRequest + */ +export interface TopicsApiTopicsListRequest { + /** + * Filter top-level topics + * @type {boolean} + * @memberof TopicsApiTopicsList + */ + readonly is_toplevel?: boolean + + /** + * Number of results to return per page. + * @type {number} + * @memberof TopicsApiTopicsList + */ + readonly limit?: number + + /** + * Topic name + * @type {Array} + * @memberof TopicsApiTopicsList + */ + readonly name?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof TopicsApiTopicsList + */ + readonly offset?: number + + /** + * Parent topic ID + * @type {Array} + * @memberof TopicsApiTopicsList + */ + readonly parent_topic_id?: Array +} + +/** + * Request parameters for topicsRetrieve operation in TopicsApi. + * @export + * @interface TopicsApiTopicsRetrieveRequest + */ +export interface TopicsApiTopicsRetrieveRequest { + /** + * A unique integer value identifying this learning resource topic. + * @type {number} + * @memberof TopicsApiTopicsRetrieve + */ + readonly id: number +} + +/** + * TopicsApi - object-oriented interface + * @export + * @class TopicsApi + * @extends {BaseAPI} + */ +export class TopicsApi extends BaseAPI { + /** + * Topics covered by learning resources + * @summary List + * @param {TopicsApiTopicsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TopicsApi + */ + public topicsList( + requestParameters: TopicsApiTopicsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return TopicsApiFp(this.configuration) + .topicsList( + requestParameters.is_toplevel, + requestParameters.limit, + requestParameters.name, + requestParameters.offset, + requestParameters.parent_topic_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Topics covered by learning resources + * @summary Retrieve + * @param {TopicsApiTopicsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TopicsApi + */ + public topicsRetrieve( + requestParameters: TopicsApiTopicsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return TopicsApiFp(this.configuration) + .topicsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * UserlistsApi - axios parameter creator + * @export + */ +export const UserlistsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Viewset for UserLists + * @summary Create + * @param {UserListRequest} UserListRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsCreate: async ( + UserListRequest: UserListRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'UserListRequest' is not null or undefined + assertParamExists("userlistsCreate", "UserListRequest", UserListRequest) + const localVarPath = `/api/v2/userlists/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + UserListRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserLists + * @summary Destroy + * @param {number} id A unique integer value identifying this user list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsDestroy: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("userlistsDestroy", "id", id) + const localVarPath = `/api/v2/userlists/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Add + * @param {number} userlist_id id of the parent user list + * @param {UserListRelationshipRequest} UserListRelationshipRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsCreate: async ( + userlist_id: number, + UserListRelationshipRequest: UserListRelationshipRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'userlist_id' is not null or undefined + assertParamExists("userlistsItemsCreate", "userlist_id", userlist_id) + // verify required parameter 'UserListRelationshipRequest' is not null or undefined + assertParamExists( + "userlistsItemsCreate", + "UserListRelationshipRequest", + UserListRelationshipRequest, + ) + const localVarPath = `/api/v2/userlists/{userlist_id}/items/`.replace( + `{${"userlist_id"}}`, + encodeURIComponent(String(userlist_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + UserListRelationshipRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Remove + * @param {number} id A unique integer value identifying this user list relationship. + * @param {number} userlist_id id of the parent user list + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsDestroy: async ( + id: number, + userlist_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("userlistsItemsDestroy", "id", id) + // verify required parameter 'userlist_id' is not null or undefined + assertParamExists("userlistsItemsDestroy", "userlist_id", userlist_id) + const localVarPath = `/api/v2/userlists/{userlist_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"userlist_id"}}`, encodeURIComponent(String(userlist_id))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserListRelationships + * @summary User List Resources List + * @param {number} userlist_id id of the parent user list + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsList: async ( + userlist_id: number, + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'userlist_id' is not null or undefined + assertParamExists("userlistsItemsList", "userlist_id", userlist_id) + const localVarPath = `/api/v2/userlists/{userlist_id}/items/`.replace( + `{${"userlist_id"}}`, + encodeURIComponent(String(userlist_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Update + * @param {number} id A unique integer value identifying this user list relationship. + * @param {number} userlist_id id of the parent user list + * @param {PatchedUserListRelationshipRequest} [PatchedUserListRelationshipRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsPartialUpdate: async ( + id: number, + userlist_id: number, + PatchedUserListRelationshipRequest?: PatchedUserListRelationshipRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("userlistsItemsPartialUpdate", "id", id) + // verify required parameter 'userlist_id' is not null or undefined + assertParamExists( + "userlistsItemsPartialUpdate", + "userlist_id", + userlist_id, + ) + const localVarPath = `/api/v2/userlists/{userlist_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"userlist_id"}}`, encodeURIComponent(String(userlist_id))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedUserListRelationshipRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserListRelationships + * @summary User List Resources Retrieve + * @param {number} id A unique integer value identifying this user list relationship. + * @param {number} userlist_id id of the parent user list + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsRetrieve: async ( + id: number, + userlist_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("userlistsItemsRetrieve", "id", id) + // verify required parameter 'userlist_id' is not null or undefined + assertParamExists("userlistsItemsRetrieve", "userlist_id", userlist_id) + const localVarPath = `/api/v2/userlists/{userlist_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"userlist_id"}}`, encodeURIComponent(String(userlist_id))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserLists + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/userlists/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a list of all userlist items for a user + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsMembershipList: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/userlists/membership/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserLists + * @summary Update + * @param {number} id A unique integer value identifying this user list. + * @param {PatchedUserListRequest} [PatchedUserListRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsPartialUpdate: async ( + id: number, + PatchedUserListRequest?: PatchedUserListRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("userlistsPartialUpdate", "id", id) + const localVarPath = `/api/v2/userlists/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedUserListRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for UserLists + * @summary Retrieve + * @param {number} id A unique integer value identifying this user list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("userlistsRetrieve", "id", id) + const localVarPath = `/api/v2/userlists/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * UserlistsApi - functional programming interface + * @export + */ +export const UserlistsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = UserlistsApiAxiosParamCreator(configuration) + return { + /** + * Viewset for UserLists + * @summary Create + * @param {UserListRequest} UserListRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsCreate( + UserListRequest: UserListRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.userlistsCreate( + UserListRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsCreate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserLists + * @summary Destroy + * @param {number} id A unique integer value identifying this user list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsDestroy( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsDestroy(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsDestroy"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Add + * @param {number} userlist_id id of the parent user list + * @param {UserListRelationshipRequest} UserListRelationshipRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsItemsCreate( + userlist_id: number, + UserListRelationshipRequest: UserListRelationshipRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsItemsCreate( + userlist_id, + UserListRelationshipRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsItemsCreate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Remove + * @param {number} id A unique integer value identifying this user list relationship. + * @param {number} userlist_id id of the parent user list + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsItemsDestroy( + id: number, + userlist_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsItemsDestroy( + id, + userlist_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsItemsDestroy"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resources List + * @param {number} userlist_id id of the parent user list + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsItemsList( + userlist_id: number, + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsItemsList( + userlist_id, + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsItemsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Update + * @param {number} id A unique integer value identifying this user list relationship. + * @param {number} userlist_id id of the parent user list + * @param {PatchedUserListRelationshipRequest} [PatchedUserListRelationshipRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsItemsPartialUpdate( + id: number, + userlist_id: number, + PatchedUserListRelationshipRequest?: PatchedUserListRelationshipRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsItemsPartialUpdate( + id, + userlist_id, + PatchedUserListRelationshipRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsItemsPartialUpdate"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resources Retrieve + * @param {number} id A unique integer value identifying this user list relationship. + * @param {number} userlist_id id of the parent user list + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsItemsRetrieve( + id: number, + userlist_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsItemsRetrieve( + id, + userlist_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsItemsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserLists + * @summary List + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.userlistsList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a list of all userlist items for a user + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsMembershipList( + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsMembershipList(options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsMembershipList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserLists + * @summary Update + * @param {number} id A unique integer value identifying this user list. + * @param {PatchedUserListRequest} [PatchedUserListRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsPartialUpdate( + id: number, + PatchedUserListRequest?: PatchedUserListRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsPartialUpdate( + id, + PatchedUserListRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsPartialUpdate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Viewset for UserLists + * @summary Retrieve + * @param {number} id A unique integer value identifying this user list. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userlistsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.userlistsRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UserlistsApi.userlistsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * UserlistsApi - factory interface + * @export + */ +export const UserlistsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = UserlistsApiFp(configuration) + return { + /** + * Viewset for UserLists + * @summary Create + * @param {UserlistsApiUserlistsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsCreate( + requestParameters: UserlistsApiUserlistsCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsCreate(requestParameters.UserListRequest, options) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserLists + * @summary Destroy + * @param {UserlistsApiUserlistsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsDestroy( + requestParameters: UserlistsApiUserlistsDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsDestroy(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Add + * @param {UserlistsApiUserlistsItemsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsCreate( + requestParameters: UserlistsApiUserlistsItemsCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsItemsCreate( + requestParameters.userlist_id, + requestParameters.UserListRelationshipRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Remove + * @param {UserlistsApiUserlistsItemsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsDestroy( + requestParameters: UserlistsApiUserlistsItemsDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsItemsDestroy( + requestParameters.id, + requestParameters.userlist_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resources List + * @param {UserlistsApiUserlistsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsList( + requestParameters: UserlistsApiUserlistsItemsListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsItemsList( + requestParameters.userlist_id, + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Update + * @param {UserlistsApiUserlistsItemsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsPartialUpdate( + requestParameters: UserlistsApiUserlistsItemsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsItemsPartialUpdate( + requestParameters.id, + requestParameters.userlist_id, + requestParameters.PatchedUserListRelationshipRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserListRelationships + * @summary User List Resources Retrieve + * @param {UserlistsApiUserlistsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsItemsRetrieve( + requestParameters: UserlistsApiUserlistsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsItemsRetrieve( + requestParameters.id, + requestParameters.userlist_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserLists + * @summary List + * @param {UserlistsApiUserlistsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsList( + requestParameters: UserlistsApiUserlistsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a list of all userlist items for a user + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsMembershipList( + options?: RawAxiosRequestConfig, + ): AxiosPromise> { + return localVarFp + .userlistsMembershipList(options) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserLists + * @summary Update + * @param {UserlistsApiUserlistsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsPartialUpdate( + requestParameters: UserlistsApiUserlistsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsPartialUpdate( + requestParameters.id, + requestParameters.PatchedUserListRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Viewset for UserLists + * @summary Retrieve + * @param {UserlistsApiUserlistsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userlistsRetrieve( + requestParameters: UserlistsApiUserlistsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .userlistsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for userlistsCreate operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsCreateRequest + */ +export interface UserlistsApiUserlistsCreateRequest { + /** + * + * @type {UserListRequest} + * @memberof UserlistsApiUserlistsCreate + */ + readonly UserListRequest: UserListRequest +} + +/** + * Request parameters for userlistsDestroy operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsDestroyRequest + */ +export interface UserlistsApiUserlistsDestroyRequest { + /** + * A unique integer value identifying this user list. + * @type {number} + * @memberof UserlistsApiUserlistsDestroy + */ + readonly id: number +} + +/** + * Request parameters for userlistsItemsCreate operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsItemsCreateRequest + */ +export interface UserlistsApiUserlistsItemsCreateRequest { + /** + * id of the parent user list + * @type {number} + * @memberof UserlistsApiUserlistsItemsCreate + */ + readonly userlist_id: number + + /** + * + * @type {UserListRelationshipRequest} + * @memberof UserlistsApiUserlistsItemsCreate + */ + readonly UserListRelationshipRequest: UserListRelationshipRequest +} + +/** + * Request parameters for userlistsItemsDestroy operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsItemsDestroyRequest + */ +export interface UserlistsApiUserlistsItemsDestroyRequest { + /** + * A unique integer value identifying this user list relationship. + * @type {number} + * @memberof UserlistsApiUserlistsItemsDestroy + */ + readonly id: number + + /** + * id of the parent user list + * @type {number} + * @memberof UserlistsApiUserlistsItemsDestroy + */ + readonly userlist_id: number +} + +/** + * Request parameters for userlistsItemsList operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsItemsListRequest + */ +export interface UserlistsApiUserlistsItemsListRequest { + /** + * id of the parent user list + * @type {number} + * @memberof UserlistsApiUserlistsItemsList + */ + readonly userlist_id: number + + /** + * Number of results to return per page. + * @type {number} + * @memberof UserlistsApiUserlistsItemsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof UserlistsApiUserlistsItemsList + */ + readonly offset?: number +} + +/** + * Request parameters for userlistsItemsPartialUpdate operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsItemsPartialUpdateRequest + */ +export interface UserlistsApiUserlistsItemsPartialUpdateRequest { + /** + * A unique integer value identifying this user list relationship. + * @type {number} + * @memberof UserlistsApiUserlistsItemsPartialUpdate + */ + readonly id: number + + /** + * id of the parent user list + * @type {number} + * @memberof UserlistsApiUserlistsItemsPartialUpdate + */ + readonly userlist_id: number + + /** + * + * @type {PatchedUserListRelationshipRequest} + * @memberof UserlistsApiUserlistsItemsPartialUpdate + */ + readonly PatchedUserListRelationshipRequest?: PatchedUserListRelationshipRequest +} + +/** + * Request parameters for userlistsItemsRetrieve operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsItemsRetrieveRequest + */ +export interface UserlistsApiUserlistsItemsRetrieveRequest { + /** + * A unique integer value identifying this user list relationship. + * @type {number} + * @memberof UserlistsApiUserlistsItemsRetrieve + */ + readonly id: number + + /** + * id of the parent user list + * @type {number} + * @memberof UserlistsApiUserlistsItemsRetrieve + */ + readonly userlist_id: number +} + +/** + * Request parameters for userlistsList operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsListRequest + */ +export interface UserlistsApiUserlistsListRequest { + /** + * Number of results to return per page. + * @type {number} + * @memberof UserlistsApiUserlistsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof UserlistsApiUserlistsList + */ + readonly offset?: number +} + +/** + * Request parameters for userlistsPartialUpdate operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsPartialUpdateRequest + */ +export interface UserlistsApiUserlistsPartialUpdateRequest { + /** + * A unique integer value identifying this user list. + * @type {number} + * @memberof UserlistsApiUserlistsPartialUpdate + */ + readonly id: number + + /** + * + * @type {PatchedUserListRequest} + * @memberof UserlistsApiUserlistsPartialUpdate + */ + readonly PatchedUserListRequest?: PatchedUserListRequest +} + +/** + * Request parameters for userlistsRetrieve operation in UserlistsApi. + * @export + * @interface UserlistsApiUserlistsRetrieveRequest + */ +export interface UserlistsApiUserlistsRetrieveRequest { + /** + * A unique integer value identifying this user list. + * @type {number} + * @memberof UserlistsApiUserlistsRetrieve + */ + readonly id: number +} + +/** + * UserlistsApi - object-oriented interface + * @export + * @class UserlistsApi + * @extends {BaseAPI} + */ +export class UserlistsApi extends BaseAPI { + /** + * Viewset for UserLists + * @summary Create + * @param {UserlistsApiUserlistsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsCreate( + requestParameters: UserlistsApiUserlistsCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsCreate(requestParameters.UserListRequest, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserLists + * @summary Destroy + * @param {UserlistsApiUserlistsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsDestroy( + requestParameters: UserlistsApiUserlistsDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsDestroy(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Add + * @param {UserlistsApiUserlistsItemsCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsItemsCreate( + requestParameters: UserlistsApiUserlistsItemsCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsItemsCreate( + requestParameters.userlist_id, + requestParameters.UserListRelationshipRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Remove + * @param {UserlistsApiUserlistsItemsDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsItemsDestroy( + requestParameters: UserlistsApiUserlistsItemsDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsItemsDestroy( + requestParameters.id, + requestParameters.userlist_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserListRelationships + * @summary User List Resources List + * @param {UserlistsApiUserlistsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsItemsList( + requestParameters: UserlistsApiUserlistsItemsListRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsItemsList( + requestParameters.userlist_id, + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserListRelationships + * @summary User List Resource Relationship Update + * @param {UserlistsApiUserlistsItemsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsItemsPartialUpdate( + requestParameters: UserlistsApiUserlistsItemsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsItemsPartialUpdate( + requestParameters.id, + requestParameters.userlist_id, + requestParameters.PatchedUserListRelationshipRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserListRelationships + * @summary User List Resources Retrieve + * @param {UserlistsApiUserlistsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsItemsRetrieve( + requestParameters: UserlistsApiUserlistsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsItemsRetrieve( + requestParameters.id, + requestParameters.userlist_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserLists + * @summary List + * @param {UserlistsApiUserlistsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsList( + requestParameters: UserlistsApiUserlistsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsList(requestParameters.limit, requestParameters.offset, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a list of all userlist items for a user + * @summary List + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsMembershipList(options?: RawAxiosRequestConfig) { + return UserlistsApiFp(this.configuration) + .userlistsMembershipList(options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserLists + * @summary Update + * @param {UserlistsApiUserlistsPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsPartialUpdate( + requestParameters: UserlistsApiUserlistsPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsPartialUpdate( + requestParameters.id, + requestParameters.PatchedUserListRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for UserLists + * @summary Retrieve + * @param {UserlistsApiUserlistsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserlistsApi + */ + public userlistsRetrieve( + requestParameters: UserlistsApiUserlistsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return UserlistsApiFp(this.configuration) + .userlistsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * VideoPlaylistsApi - axios parameter creator + * @export + */ +export const VideoPlaylistsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {number} learning_resource_id id of the parent learning resource + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsItemsList: async ( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "videoPlaylistsItemsList", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/video_playlists/{learning_resource_id}/items/`.replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsItemsRetrieve: async ( + id: number, + learning_resource_id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("videoPlaylistsItemsRetrieve", "id", id) + // verify required parameter 'learning_resource_id' is not null or undefined + assertParamExists( + "videoPlaylistsItemsRetrieve", + "learning_resource_id", + learning_resource_id, + ) + const localVarPath = + `/api/v2/video_playlists/{learning_resource_id}/items/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace( + `{${"learning_resource_id"}}`, + encodeURIComponent(String(learning_resource_id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Get a paginated list of video playlists + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {VideoPlaylistsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: VideoPlaylistsListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/video_playlists/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single video playlist + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("videoPlaylistsRetrieve", "id", id) + const localVarPath = `/api/v2/video_playlists/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * VideoPlaylistsApi - functional programming interface + * @export + */ +export const VideoPlaylistsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + VideoPlaylistsApiAxiosParamCreator(configuration) + return { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {number} learning_resource_id id of the parent learning resource + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [sortby] Which field to use when ordering the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async videoPlaylistsItemsList( + learning_resource_id: number, + limit?: number, + offset?: number, + sortby?: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.videoPlaylistsItemsList( + learning_resource_id, + limit, + offset, + sortby, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["VideoPlaylistsApi.videoPlaylistsItemsList"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {number} id A unique integer value identifying this learning resource relationship. + * @param {number} learning_resource_id id of the parent learning resource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async videoPlaylistsItemsRetrieve( + id: number, + learning_resource_id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.videoPlaylistsItemsRetrieve( + id, + learning_resource_id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["VideoPlaylistsApi.videoPlaylistsItemsRetrieve"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Get a paginated list of video playlists + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {VideoPlaylistsListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async videoPlaylistsList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: VideoPlaylistsListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.videoPlaylistsList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["VideoPlaylistsApi.videoPlaylistsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single video playlist + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async videoPlaylistsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.videoPlaylistsRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["VideoPlaylistsApi.videoPlaylistsRetrieve"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * VideoPlaylistsApi - factory interface + * @export + */ +export const VideoPlaylistsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = VideoPlaylistsApiFp(configuration) + return { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {VideoPlaylistsApiVideoPlaylistsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsItemsList( + requestParameters: VideoPlaylistsApiVideoPlaylistsItemsListRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .videoPlaylistsItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {VideoPlaylistsApiVideoPlaylistsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsItemsRetrieve( + requestParameters: VideoPlaylistsApiVideoPlaylistsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .videoPlaylistsItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Get a paginated list of video playlists + * @summary List + * @param {VideoPlaylistsApiVideoPlaylistsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsList( + requestParameters: VideoPlaylistsApiVideoPlaylistsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .videoPlaylistsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single video playlist + * @summary Retrieve + * @param {VideoPlaylistsApiVideoPlaylistsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videoPlaylistsRetrieve( + requestParameters: VideoPlaylistsApiVideoPlaylistsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .videoPlaylistsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for videoPlaylistsItemsList operation in VideoPlaylistsApi. + * @export + * @interface VideoPlaylistsApiVideoPlaylistsItemsListRequest + */ +export interface VideoPlaylistsApiVideoPlaylistsItemsListRequest { + /** + * id of the parent learning resource + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsItemsList + */ + readonly learning_resource_id: number + + /** + * Number of results to return per page. + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsItemsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsItemsList + */ + readonly offset?: number + + /** + * Which field to use when ordering the results. + * @type {string} + * @memberof VideoPlaylistsApiVideoPlaylistsItemsList + */ + readonly sortby?: string +} + +/** + * Request parameters for videoPlaylistsItemsRetrieve operation in VideoPlaylistsApi. + * @export + * @interface VideoPlaylistsApiVideoPlaylistsItemsRetrieveRequest + */ +export interface VideoPlaylistsApiVideoPlaylistsItemsRetrieveRequest { + /** + * A unique integer value identifying this learning resource relationship. + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsItemsRetrieve + */ + readonly id: number + + /** + * id of the parent learning resource + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsItemsRetrieve + */ + readonly learning_resource_id: number +} + +/** + * Request parameters for videoPlaylistsList operation in VideoPlaylistsApi. + * @export + * @interface VideoPlaylistsApiVideoPlaylistsListRequest + */ +export interface VideoPlaylistsApiVideoPlaylistsListRequest { + /** + * + * @type {boolean} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly sortby?: VideoPlaylistsListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof VideoPlaylistsApiVideoPlaylistsList + */ + readonly topic?: Array +} + +/** + * Request parameters for videoPlaylistsRetrieve operation in VideoPlaylistsApi. + * @export + * @interface VideoPlaylistsApiVideoPlaylistsRetrieveRequest + */ +export interface VideoPlaylistsApiVideoPlaylistsRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof VideoPlaylistsApiVideoPlaylistsRetrieve + */ + readonly id: number +} + +/** + * VideoPlaylistsApi - object-oriented interface + * @export + * @class VideoPlaylistsApi + * @extends {BaseAPI} + */ +export class VideoPlaylistsApi extends BaseAPI { + /** + * Get a list of related learning resources for a learning resource. + * @summary Nested Learning Resource List + * @param {VideoPlaylistsApiVideoPlaylistsItemsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VideoPlaylistsApi + */ + public videoPlaylistsItemsList( + requestParameters: VideoPlaylistsApiVideoPlaylistsItemsListRequest, + options?: RawAxiosRequestConfig, + ) { + return VideoPlaylistsApiFp(this.configuration) + .videoPlaylistsItemsList( + requestParameters.learning_resource_id, + requestParameters.limit, + requestParameters.offset, + requestParameters.sortby, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a singe related learning resource for a learning resource. + * @summary Nested Learning Resource Retrieve + * @param {VideoPlaylistsApiVideoPlaylistsItemsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VideoPlaylistsApi + */ + public videoPlaylistsItemsRetrieve( + requestParameters: VideoPlaylistsApiVideoPlaylistsItemsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return VideoPlaylistsApiFp(this.configuration) + .videoPlaylistsItemsRetrieve( + requestParameters.id, + requestParameters.learning_resource_id, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Get a paginated list of video playlists + * @summary List + * @param {VideoPlaylistsApiVideoPlaylistsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VideoPlaylistsApi + */ + public videoPlaylistsList( + requestParameters: VideoPlaylistsApiVideoPlaylistsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return VideoPlaylistsApiFp(this.configuration) + .videoPlaylistsList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single video playlist + * @summary Retrieve + * @param {VideoPlaylistsApiVideoPlaylistsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VideoPlaylistsApi + */ + public videoPlaylistsRetrieve( + requestParameters: VideoPlaylistsApiVideoPlaylistsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return VideoPlaylistsApiFp(this.configuration) + .videoPlaylistsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const VideoPlaylistsListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type VideoPlaylistsListCertificationTypeEnum = + (typeof VideoPlaylistsListCertificationTypeEnum)[keyof typeof VideoPlaylistsListCertificationTypeEnum] +/** + * @export + */ +export const VideoPlaylistsListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type VideoPlaylistsListDeliveryEnum = + (typeof VideoPlaylistsListDeliveryEnum)[keyof typeof VideoPlaylistsListDeliveryEnum] +/** + * @export + */ +export const VideoPlaylistsListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type VideoPlaylistsListDepartmentEnum = + (typeof VideoPlaylistsListDepartmentEnum)[keyof typeof VideoPlaylistsListDepartmentEnum] +/** + * @export + */ +export const VideoPlaylistsListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type VideoPlaylistsListLevelEnum = + (typeof VideoPlaylistsListLevelEnum)[keyof typeof VideoPlaylistsListLevelEnum] +/** + * @export + */ +export const VideoPlaylistsListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type VideoPlaylistsListOfferedByEnum = + (typeof VideoPlaylistsListOfferedByEnum)[keyof typeof VideoPlaylistsListOfferedByEnum] +/** + * @export + */ +export const VideoPlaylistsListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type VideoPlaylistsListPlatformEnum = + (typeof VideoPlaylistsListPlatformEnum)[keyof typeof VideoPlaylistsListPlatformEnum] +/** + * @export + */ +export const VideoPlaylistsListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type VideoPlaylistsListResourceTypeEnum = + (typeof VideoPlaylistsListResourceTypeEnum)[keyof typeof VideoPlaylistsListResourceTypeEnum] +/** + * @export + */ +export const VideoPlaylistsListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type VideoPlaylistsListResourceTypeGroupEnum = + (typeof VideoPlaylistsListResourceTypeGroupEnum)[keyof typeof VideoPlaylistsListResourceTypeGroupEnum] +/** + * @export + */ +export const VideoPlaylistsListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type VideoPlaylistsListSortbyEnum = + (typeof VideoPlaylistsListSortbyEnum)[keyof typeof VideoPlaylistsListSortbyEnum] + +/** + * VideosApi - axios parameter creator + * @export + */ +export const VideosApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Get a paginated list of videos + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {VideosListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videosList: async ( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: VideosListSortbyEnum, + topic?: Array, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v2/videos/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (certification !== undefined) { + localVarQueryParameter["certification"] = certification + } + + if (certification_type) { + localVarQueryParameter["certification_type"] = certification_type + } + + if (course_feature) { + localVarQueryParameter["course_feature"] = course_feature + } + + if (delivery) { + localVarQueryParameter["delivery"] = delivery + } + + if (department) { + localVarQueryParameter["department"] = department + } + + if (free !== undefined) { + localVarQueryParameter["free"] = free + } + + if (level) { + localVarQueryParameter["level"] = level + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offered_by) { + localVarQueryParameter["offered_by"] = offered_by + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (platform) { + localVarQueryParameter["platform"] = platform + } + + if (professional !== undefined) { + localVarQueryParameter["professional"] = professional + } + + if (readable_id) { + localVarQueryParameter["readable_id"] = readable_id + } + + if (resource_id) { + localVarQueryParameter["resource_id"] = resource_id + } + + if (resource_type) { + localVarQueryParameter["resource_type"] = resource_type + } + + if (resource_type_group) { + localVarQueryParameter["resource_type_group"] = resource_type_group + } + + if (sortby !== undefined) { + localVarQueryParameter["sortby"] = sortby + } + + if (topic) { + localVarQueryParameter["topic"] = topic + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a single video + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videosRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("videosRetrieve", "id", id) + const localVarPath = `/api/v2/videos/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} + +/** + * VideosApi - functional programming interface + * @export + */ +export const VideosApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = VideosApiAxiosParamCreator(configuration) + return { + /** + * Get a paginated list of videos + * @summary List + * @param {boolean} [certification] + * @param {Array} [certification_type] The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @param {Array} [course_feature] Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @param {Array>} [delivery] The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @param {Array} [department] The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean} [free] The course/program is offered for free + * @param {Array} [level] The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @param {number} [limit] Number of results to return per page. + * @param {Array} [offered_by] The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @param {number} [offset] The initial index from which to return the results. + * @param {Array} [platform] The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @param {boolean} [professional] + * @param {Array} [readable_id] A unique text identifier for the resources + * @param {Array} [resource_id] Comma-separated list of learning resource IDs + * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @param {Array} [resource_type_group] The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @param {VideosListSortbyEnum} [sortby] Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @param {Array} [topic] Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async videosList( + certification?: boolean, + certification_type?: Array, + course_feature?: Array, + delivery?: Array>, + department?: Array, + free?: boolean, + level?: Array, + limit?: number, + offered_by?: Array, + offset?: number, + platform?: Array, + professional?: boolean, + readable_id?: Array, + resource_id?: Array, + resource_type?: Array, + resource_type_group?: Array, + sortby?: VideosListSortbyEnum, + topic?: Array, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.videosList( + certification, + certification_type, + course_feature, + delivery, + department, + free, + level, + limit, + offered_by, + offset, + platform, + professional, + readable_id, + resource_id, + resource_type, + resource_type_group, + sortby, + topic, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["VideosApi.videosList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Retrieve a single video + * @summary Retrieve + * @param {number} id A unique integer value identifying this learning resource. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async videosRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.videosRetrieve( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["VideosApi.videosRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} + +/** + * VideosApi - factory interface + * @export + */ +export const VideosApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = VideosApiFp(configuration) + return { + /** + * Get a paginated list of videos + * @summary List + * @param {VideosApiVideosListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videosList( + requestParameters: VideosApiVideosListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .videosList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(axios, basePath)) + }, + /** + * Retrieve a single video + * @summary Retrieve + * @param {VideosApiVideosRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + videosRetrieve( + requestParameters: VideosApiVideosRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .videosRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } +} + +/** + * Request parameters for videosList operation in VideosApi. + * @export + * @interface VideosApiVideosListRequest + */ +export interface VideosApiVideosListRequest { + /** + * + * @type {boolean} + * @memberof VideosApiVideosList + */ + readonly certification?: boolean + + /** + * The type of certification offered * `micromasters` - MicroMasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate + * @type {Array<'completion' | 'micromasters' | 'none' | 'professional'>} + * @memberof VideosApiVideosList + */ + readonly certification_type?: Array + + /** + * Content feature for the resources. Load the \'api/v1/course_features\' endpoint for a list of course features + * @type {Array} + * @memberof VideosApiVideosList + */ + readonly course_feature?: Array + + /** + * The delivery of course/program resources * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * `offline` - Offline + * @type {Array>} + * @memberof VideosApiVideosList + */ + readonly delivery?: Array> + + /** + * The department that offers learning resources * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `SP` - Special Programs * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @type {Array<'1' | '10' | '11' | '12' | '14' | '15' | '16' | '17' | '18' | '2' | '20' | '21A' | '21G' | '21H' | '21L' | '21M' | '22' | '24' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'CC' | 'CMS-W' | 'EC' | 'ES' | 'ESD' | 'HST' | 'IDS' | 'MAS' | 'PE' | 'SP' | 'STS' | 'WGS'>} + * @memberof VideosApiVideosList + */ + readonly department?: Array + + /** + * The course/program is offered for free + * @type {boolean} + * @memberof VideosApiVideosList + */ + readonly free?: boolean + + /** + * The academic level of the resources * `undergraduate` - Undergraduate * `graduate` - Graduate * `high_school` - High School * `noncredit` - Non-Credit * `advanced` - Advanced * `intermediate` - Intermediate * `introductory` - Introductory + * @type {Array<'advanced' | 'graduate' | 'high_school' | 'intermediate' | 'introductory' | 'noncredit' | 'undergraduate'>} + * @memberof VideosApiVideosList + */ + readonly level?: Array + + /** + * Number of results to return per page. + * @type {number} + * @memberof VideosApiVideosList + */ + readonly limit?: number + + /** + * The organization that offers a learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `climate` - MIT Climate + * @type {Array<'bootcamps' | 'climate' | 'mitpe' | 'mitx' | 'ocw' | 'see' | 'xpro'>} + * @memberof VideosApiVideosList + */ + readonly offered_by?: Array + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof VideosApiVideosList + */ + readonly offset?: number + + /** + * The platform on which learning resources are offered * `edx` - edX * `ocw` - MIT OpenCourseWare * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `csail` - CSAIL * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics * `whu` - WHU * `susskind` - Susskind * `globalalumni` - Global Alumni * `simplilearn` - Simplilearn * `emeritus` - Emeritus * `podcast` - Podcast * `youtube` - YouTube * `canvas` - Canvas * `climate` - MIT Climate * `ovs` - ODL Video Service + * @type {Array<'bootcamps' | 'canvas' | 'climate' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'ovs' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro' | 'youtube'>} + * @memberof VideosApiVideosList + */ + readonly platform?: Array + + /** + * + * @type {boolean} + * @memberof VideosApiVideosList + */ + readonly professional?: boolean + + /** + * A unique text identifier for the resources + * @type {Array} + * @memberof VideosApiVideosList + */ + readonly readable_id?: Array + + /** + * Comma-separated list of learning resource IDs + * @type {Array} + * @memberof VideosApiVideosList + */ + readonly resource_id?: Array + + /** + * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode * `video` - Video * `video_playlist` - Video Playlist * `document` - Document + * @type {Array<'course' | 'document' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program' | 'video' | 'video_playlist'>} + * @memberof VideosApiVideosList + */ + readonly resource_type?: Array + + /** + * The resource type group of the learning resources * `course` - Course * `program` - Program * `learning_material` - Learning Material + * @type {Array<'course' | 'learning_material' | 'program'>} + * @memberof VideosApiVideosList + */ + readonly resource_type_group?: Array + + /** + * Sort By * `id` - Object ID ascending * `-id` - Object ID descending * `readable_id` - Readable ID ascending * `-readable_id` - Readable ID descending * `last_modified` - Last Modified Date ascending * `-last_modified` - Last Modified Date descending * `new` - Newest resources first * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending * `views` - Popularity ascending * `-views` - Popularity descending * `upcoming` - Next start date ascending + * @type {'-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | '-views' | 'id' | 'last_modified' | 'mitcoursenumber' | 'new' | 'readable_id' | 'start_date' | 'upcoming' | 'views'} + * @memberof VideosApiVideosList + */ + readonly sortby?: VideosListSortbyEnum + + /** + * Topics covered by the resources. Load the \'/api/v1/topics\' endpoint for a list of topics + * @type {Array} + * @memberof VideosApiVideosList + */ + readonly topic?: Array +} + +/** + * Request parameters for videosRetrieve operation in VideosApi. + * @export + * @interface VideosApiVideosRetrieveRequest + */ +export interface VideosApiVideosRetrieveRequest { + /** + * A unique integer value identifying this learning resource. + * @type {number} + * @memberof VideosApiVideosRetrieve + */ + readonly id: number +} + +/** + * VideosApi - object-oriented interface + * @export + * @class VideosApi + * @extends {BaseAPI} + */ +export class VideosApi extends BaseAPI { + /** + * Get a paginated list of videos + * @summary List + * @param {VideosApiVideosListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VideosApi + */ + public videosList( + requestParameters: VideosApiVideosListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return VideosApiFp(this.configuration) + .videosList( + requestParameters.certification, + requestParameters.certification_type, + requestParameters.course_feature, + requestParameters.delivery, + requestParameters.department, + requestParameters.free, + requestParameters.level, + requestParameters.limit, + requestParameters.offered_by, + requestParameters.offset, + requestParameters.platform, + requestParameters.professional, + requestParameters.readable_id, + requestParameters.resource_id, + requestParameters.resource_type, + requestParameters.resource_type_group, + requestParameters.sortby, + requestParameters.topic, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a single video + * @summary Retrieve + * @param {VideosApiVideosRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VideosApi + */ + public videosRetrieve( + requestParameters: VideosApiVideosRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return VideosApiFp(this.configuration) + .videosRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * @export + */ +export const VideosListCertificationTypeEnum = { + Completion: "completion", + Micromasters: "micromasters", + None: "none", + Professional: "professional", +} as const +export type VideosListCertificationTypeEnum = + (typeof VideosListCertificationTypeEnum)[keyof typeof VideosListCertificationTypeEnum] +/** + * @export + */ +export const VideosListDeliveryEnum = { + Online: "online", + Hybrid: "hybrid", + InPerson: "in_person", + Offline: "offline", +} as const +export type VideosListDeliveryEnum = + (typeof VideosListDeliveryEnum)[keyof typeof VideosListDeliveryEnum] +/** + * @export + */ +export const VideosListDepartmentEnum = { + _1: "1", + _10: "10", + _11: "11", + _12: "12", + _14: "14", + _15: "15", + _16: "16", + _17: "17", + _18: "18", + _2: "2", + _20: "20", + _21A: "21A", + _21G: "21G", + _21H: "21H", + _21L: "21L", + _21M: "21M", + _22: "22", + _24: "24", + _3: "3", + _4: "4", + _5: "5", + _6: "6", + _7: "7", + _8: "8", + _9: "9", + Cc: "CC", + CmsW: "CMS-W", + Ec: "EC", + Es: "ES", + Esd: "ESD", + Hst: "HST", + Ids: "IDS", + Mas: "MAS", + Pe: "PE", + Sp: "SP", + Sts: "STS", + Wgs: "WGS", +} as const +export type VideosListDepartmentEnum = + (typeof VideosListDepartmentEnum)[keyof typeof VideosListDepartmentEnum] +/** + * @export + */ +export const VideosListLevelEnum = { + Advanced: "advanced", + Graduate: "graduate", + HighSchool: "high_school", + Intermediate: "intermediate", + Introductory: "introductory", + Noncredit: "noncredit", + Undergraduate: "undergraduate", +} as const +export type VideosListLevelEnum = + (typeof VideosListLevelEnum)[keyof typeof VideosListLevelEnum] +/** + * @export + */ +export const VideosListOfferedByEnum = { + Bootcamps: "bootcamps", + Climate: "climate", + Mitpe: "mitpe", + Mitx: "mitx", + Ocw: "ocw", + See: "see", + Xpro: "xpro", +} as const +export type VideosListOfferedByEnum = + (typeof VideosListOfferedByEnum)[keyof typeof VideosListOfferedByEnum] +/** + * @export + */ +export const VideosListPlatformEnum = { + Bootcamps: "bootcamps", + Canvas: "canvas", + Climate: "climate", + Csail: "csail", + Ctl: "ctl", + Edx: "edx", + Emeritus: "emeritus", + Globalalumni: "globalalumni", + Mitpe: "mitpe", + Mitxonline: "mitxonline", + Ocw: "ocw", + Oll: "oll", + Ovs: "ovs", + Podcast: "podcast", + Scc: "scc", + See: "see", + Simplilearn: "simplilearn", + Susskind: "susskind", + Whu: "whu", + Xpro: "xpro", + Youtube: "youtube", +} as const +export type VideosListPlatformEnum = + (typeof VideosListPlatformEnum)[keyof typeof VideosListPlatformEnum] +/** + * @export + */ +export const VideosListResourceTypeEnum = { + Course: "course", + Document: "document", + LearningPath: "learning_path", + Podcast: "podcast", + PodcastEpisode: "podcast_episode", + Program: "program", + Video: "video", + VideoPlaylist: "video_playlist", +} as const +export type VideosListResourceTypeEnum = + (typeof VideosListResourceTypeEnum)[keyof typeof VideosListResourceTypeEnum] +/** + * @export + */ +export const VideosListResourceTypeGroupEnum = { + Course: "course", + LearningMaterial: "learning_material", + Program: "program", +} as const +export type VideosListResourceTypeGroupEnum = + (typeof VideosListResourceTypeGroupEnum)[keyof typeof VideosListResourceTypeGroupEnum] +/** + * @export + */ +export const VideosListSortbyEnum = { + Id: "-id", + LastModified: "-last_modified", + Mitcoursenumber: "-mitcoursenumber", + ReadableId: "-readable_id", + StartDate: "-start_date", + Views: "-views", + Id2: "id", + LastModified2: "last_modified", + Mitcoursenumber2: "mitcoursenumber", + New: "new", + ReadableId2: "readable_id", + StartDate2: "start_date", + Upcoming: "upcoming", + Views2: "views", +} as const +export type VideosListSortbyEnum = + (typeof VideosListSortbyEnum)[keyof typeof VideosListSortbyEnum] diff --git a/frontends/api/src/generated/v2/base.ts b/frontends/api/src/generated/v2/base.ts new file mode 100644 index 0000000000..04ea9231a7 --- /dev/null +++ b/frontends/api/src/generated/v2/base.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * MIT Learn API + * MIT public API + * + * The version of the OpenAPI document: 0.0.1 (v2) + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from "./configuration" +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios" +import globalAxios from "axios" + +export const BASE_PATH = "http://localhost".replace(/\/+$/, "") + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +} + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string + options: RawAxiosRequestConfig +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios, + ) { + if (configuration) { + this.configuration = configuration + this.basePath = configuration.basePath ?? basePath + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor( + public field: string, + msg?: string, + ) { + super(msg) + this.name = "RequiredError" + } +} + +interface ServerMap { + [key: string]: { + url: string + description: string + }[] +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = {} diff --git a/frontends/api/src/generated/v2/common.ts b/frontends/api/src/generated/v2/common.ts new file mode 100644 index 0000000000..e18b2c162f --- /dev/null +++ b/frontends/api/src/generated/v2/common.ts @@ -0,0 +1,202 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * MIT Learn API + * MIT public API + * + * The version of the OpenAPI document: 0.0.1 (v2) + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from "./configuration" +import type { RequestArgs } from "./base" +import type { AxiosInstance, AxiosResponse } from "axios" +import { RequiredError } from "./base" + +/** + * + * @export + */ +export const DUMMY_BASE_URL = "https://example.com" + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown, +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, + ) + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration, +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === "function" + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey + object[keyParamName] = localVarApiKeyValue + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration, +) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { + username: configuration.username, + password: configuration.password, + } + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === "function" + ? await configuration.accessToken() + : await configuration.accessToken + object["Authorization"] = "Bearer " + accessToken + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === "function" + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken + object["Authorization"] = "Bearer " + localVarAccessTokenValue + } +} + +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = "", +): void { + if (parameter == null) return + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + ;(parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key), + ) + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== "" ? "." : ""}${currentKey}`, + ), + ) + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter) + } else { + urlSearchParams.set(key, parameter) + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search) + setFlattenedQueryParams(searchParams, objects) + url.search = searchParams.toString() +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration, +) { + const nonString = typeof value !== "string" + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) + : nonString + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || "" +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration, +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) + + axiosArgs.url, + } + return axios.request(axiosRequestArgs) + } +} diff --git a/frontends/api/src/generated/v2/configuration.ts b/frontends/api/src/generated/v2/configuration.ts new file mode 100644 index 0000000000..2f2dbc15f2 --- /dev/null +++ b/frontends/api/src/generated/v2/configuration.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * MIT Learn API + * MIT public API + * + * The version of the OpenAPI document: 0.0.1 (v2) + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise) + username?: string + password?: string + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise) + basePath?: string + serverIndex?: number + baseOptions?: any + formDataCtor?: new () => any +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise) + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise) + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey + this.username = param.username + this.password = param.password + this.accessToken = param.accessToken + this.basePath = param.basePath + this.serverIndex = param.serverIndex + this.baseOptions = param.baseOptions + this.formDataCtor = param.formDataCtor + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + "^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$", + "i", + ) + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === "application/json-patch+json") + ) + } +} diff --git a/frontends/api/src/generated/v2/index.ts b/frontends/api/src/generated/v2/index.ts new file mode 100644 index 0000000000..fccb9c7950 --- /dev/null +++ b/frontends/api/src/generated/v2/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * MIT Learn API + * MIT public API + * + * The version of the OpenAPI document: 0.0.1 (v2) + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from "./api" +export * from "./configuration" diff --git a/learning_resources/migrations/0114_course_credits_earned.py b/learning_resources/migrations/0114_course_credits_earned.py new file mode 100644 index 0000000000..b293637b10 --- /dev/null +++ b/learning_resources/migrations/0114_course_credits_earned.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.30 on 2026-04-30 12:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("learning_resources", "0113_alter_learningresourcerelationship_options"), + ] + + operations = [ + migrations.AddField( + model_name="course", + name="credits_earned", + field=models.FloatField(blank=True, null=True), + ), + ] diff --git a/learning_resources/models.py b/learning_resources/models.py index 58993ffee5..00662b1d6e 100644 --- a/learning_resources/models.py +++ b/learning_resources/models.py @@ -892,6 +892,7 @@ class Course(LearningResourceDetailModel): primary_key=True, ) course_numbers = JSONField(null=True, blank=True) + credits_earned = models.FloatField(null=True, blank=True) @property def runs(self): diff --git a/learning_resources/serializers.py b/learning_resources/serializers.py index ddece6b272..049fcdaacf 100644 --- a/learning_resources/serializers.py +++ b/learning_resources/serializers.py @@ -2,6 +2,7 @@ import json import logging +import random from datetime import UTC from decimal import Decimal from uuid import uuid4 @@ -14,6 +15,7 @@ from drf_spectacular.utils import extend_schema_field from isodate import parse_duration from langchain_text_splitters import RecursiveJsonSplitter +from mitol.api_versioning.mixins import VersionedSerializerMixin from rest_framework import serializers from rest_framework.exceptions import ValidationError @@ -70,7 +72,9 @@ def _get_program_child_resource_map( return {resource.id: resource for resource in child_resources} -class LearningResourceInstructorSerializer(serializers.ModelSerializer): +class LearningResourceInstructorSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer for LearningResourceInstructor model """ @@ -80,7 +84,9 @@ class Meta: exclude = COMMON_IGNORED_FIELDS -class LearningResourcePriceSerializer(serializers.ModelSerializer): +class LearningResourcePriceSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer for LearningResourcePrice model """ @@ -90,7 +96,9 @@ class Meta: exclude = "id", *COMMON_IGNORED_FIELDS -class LearningResourceTopicSerializer(serializers.ModelSerializer): +class LearningResourceTopicSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer for LearningResourceTopic model """ @@ -142,7 +150,9 @@ class LearningResourceTypeField(serializers.ReadOnlyField): """Field for LearningResource.resource_type""" -class LearningResourceOfferorSerializer(serializers.ModelSerializer): +class LearningResourceOfferorSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for LearningResourceOfferor with basic details""" channel_url = serializers.CharField(read_only=True, allow_null=True) @@ -190,7 +200,9 @@ def to_representation(self, value): return sorted([tag.name for tag in value.all()]) -class LearningResourcePlatformSerializer(serializers.ModelSerializer): +class LearningResourcePlatformSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for LearningResourcePlatform""" class Meta: @@ -198,21 +210,25 @@ class Meta: fields = ("code", "name") -class LearningResourceBaseDepartmentSerializer(serializers.ModelSerializer): +class LearningResourceBaseDepartmentSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer for LearningResourceDepartment, minus school The absence of the departments list is to avoid a circular serialization structure. """ - channel_url = serializers.CharField(read_only=True, allow_null=True) + url = serializers.CharField(read_only=True, allow_null=True, source="channel_url") class Meta: model = models.LearningResourceDepartment - fields = ["department_id", "name", "channel_url"] + fields = ["department_id", "name", "url"] -class LearningResourceBaseSchoolSerializer(serializers.ModelSerializer): +class LearningResourceBaseSchoolSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Base serializer for LearningResourceSchool model, minus departments list @@ -246,7 +262,9 @@ class Meta: fields = [*LearningResourceBaseSchoolSerializer.Meta.fields, "departments"] -class LearningResourceContentTagSerializer(serializers.ModelSerializer): +class LearningResourceContentTagSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for LearningResourceContentTag""" class Meta: @@ -254,7 +272,9 @@ class Meta: fields = ["id", "name"] -class LearningResourceImageSerializer(serializers.ModelSerializer): +class LearningResourceImageSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for LearningResourceImage""" class Meta: @@ -373,7 +393,9 @@ def to_representation(self, instance): return LEARNING_MATERIAL_RESOURCE_TYPE_GROUP -class LearningResourceRunSerializer(serializers.ModelSerializer): +class LearningResourceRunSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """Serializer for the LearningResourceRun model""" instructors = LearningResourceInstructorSerializer( @@ -388,6 +410,11 @@ class LearningResourceRunSerializer(serializers.ModelSerializer): format = serializers.ListField(child=FormatSerializer(), read_only=True) pace = serializers.ListField(child=PaceSerializer(), read_only=True) resource_prices = LearningResourcePriceSerializer(read_only=True, many=True) + enrollment_url = serializers.SerializerMethodField() + + def get_enrollment_url(self, instance) -> str | None: + """Return a URL for enrollment, derived from the run URL.""" + return f"{instance.url.rstrip('/')}/enroll/" if instance.url else None class Meta: model = models.LearningResourceRun @@ -415,7 +442,7 @@ class CourseNumberSerializer(serializers.Serializer): listing_type = serializers.CharField() -class ProgramSerializer(serializers.ModelSerializer): +class ProgramSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for the Program model""" course_count = serializers.IntegerField(read_only=True) @@ -427,7 +454,7 @@ class Meta: exclude = ("learning_resource", *COMMON_IGNORED_FIELDS) -class CourseSerializer(serializers.ModelSerializer): +class CourseSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for the Course model""" course_numbers = CourseNumberSerializer(many=True, allow_null=True) @@ -437,7 +464,9 @@ class Meta: exclude = ("learning_resource", *COMMON_IGNORED_FIELDS) -class LearningPathSerializer(serializers.ModelSerializer, ResourceListMixin): +class LearningPathSerializer( + VersionedSerializerMixin, serializers.ModelSerializer, ResourceListMixin +): """Serializer for the LearningPath model""" class Meta: @@ -445,7 +474,7 @@ class Meta: exclude = ("learning_resource", "author", *COMMON_IGNORED_FIELDS) -class PodcastEpisodeSerializer(serializers.ModelSerializer): +class PodcastEpisodeSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Serializer for PodcastEpisode """ @@ -461,7 +490,7 @@ class Meta: exclude = ("learning_resource", *COMMON_IGNORED_FIELDS) -class PodcastSerializer(serializers.ModelSerializer): +class PodcastSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Serializer for Podcasts """ @@ -473,7 +502,7 @@ class Meta: exclude = ("learning_resource", *COMMON_IGNORED_FIELDS) -class VideoChannelSerializer(serializers.ModelSerializer): +class VideoChannelSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for the VideoChannel model""" class Meta: @@ -487,6 +516,11 @@ class CaptionUrlSerializer(serializers.Serializer): language = serializers.CharField() language_name = serializers.CharField() url = serializers.URLField() + word_count = serializers.SerializerMethodField() + + def get_word_count(self, obj) -> int: + url = obj.get("url", "") if isinstance(obj, dict) else "" + return random.Random(url).randint(100, 5000) # noqa: S311 class NullableURLField(serializers.URLField): @@ -496,21 +530,26 @@ def to_representation(self, value): return super().to_representation(value) if value else None -class VideoSerializer(serializers.ModelSerializer): +class VideoSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for the Video model""" caption_urls = CaptionUrlSerializer(many=True, read_only=True) streaming_url = NullableURLField(allow_blank=True, allow_null=True, read_only=True) - cover_image_url = NullableURLField( - allow_blank=True, allow_null=True, read_only=True + thumbnail_url = NullableURLField( + allow_blank=True, allow_null=True, read_only=True, source="cover_image_url" ) class Meta: model = models.Video - exclude = ("learning_resource", "transcript", *COMMON_IGNORED_FIELDS) + exclude = ( + "learning_resource", + "transcript", + "cover_image_url", + *COMMON_IGNORED_FIELDS, + ) -class VideoPlaylistSerializer(serializers.ModelSerializer): +class VideoPlaylistSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for the VideoPlaylist model""" channel = VideoChannelSerializer(read_only=True, allow_null=True) @@ -523,7 +562,9 @@ class Meta: exclude = ("learning_resource", *COMMON_IGNORED_FIELDS) -class MicroLearningPathRelationshipSerializer(serializers.ModelSerializer): +class MicroLearningPathRelationshipSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer containing only parent and child ids for a learning path relationship """ @@ -539,7 +580,9 @@ class Meta: fields = ("id", "parent", "child") -class MicroUserListRelationshipSerializer(serializers.ModelSerializer): +class MicroUserListRelationshipSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer containing only parent and child ids for a user list relationship """ @@ -1107,7 +1150,9 @@ def render_chunks(self): ] -class LearningResourceRelationshipChildField(serializers.ModelSerializer): +class LearningResourceRelationshipChildField( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer field for the LearningResourceRelationship model that uses the LearningResourceSerializer to serialize the child resources @@ -1127,7 +1172,9 @@ class Meta: ) -class LearningResourceBaseSerializer(serializers.ModelSerializer, WriteableTopicsMixin): +class LearningResourceBaseSerializer( + VersionedSerializerMixin, serializers.ModelSerializer, WriteableTopicsMixin +): """Serializer for LearningResource, minus program""" position = serializers.IntegerField(read_only=True, allow_null=True) @@ -1335,7 +1382,7 @@ class VideoPlaylistResourceSerializer(LearningResourceBaseSerializer): video_playlist = VideoPlaylistSerializer(read_only=True) -class ContentFileSerializer(serializers.ModelSerializer): +class ContentFileSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Serializer class for course run ContentFiles """ @@ -1541,7 +1588,9 @@ def to_representation(self, instance): return serializer_cls(instance=instance, context=self.context).data -class LearningResourceRelationshipSerializer(serializers.ModelSerializer): +class LearningResourceRelationshipSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """CRUD serializer for LearningResourceRelationship""" resource = LearningResourceSerializer(read_only=True, source="child") @@ -1621,7 +1670,9 @@ class Meta(LearningResourceRelationshipSerializer.Meta): read_only_fields = ("parent",) -class UserListSerializer(serializers.ModelSerializer, WriteableTopicsMixin): +class UserListSerializer( + VersionedSerializerMixin, serializers.ModelSerializer, WriteableTopicsMixin +): """ Simplified serializer for UserList model. """ @@ -1671,7 +1722,9 @@ class Meta: read_only_fields = ["author"] -class UserListRelationshipSerializer(serializers.ModelSerializer): +class UserListRelationshipSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer for UserListRelationship model """ @@ -1790,7 +1843,9 @@ class LearningResourceDisplayInfoResponseSerializer( id = serializers.IntegerField() -class LearningResourceSummarySerializer(serializers.ModelSerializer): +class LearningResourceSummarySerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Minimal serializer for LearningResource - returns only essential fields for sitemap generation and other use cases requiring minimal data transfer. diff --git a/learning_resources/serializers_test.py b/learning_resources/serializers_test.py index 8e8ee3d30a..e9b878806c 100644 --- a/learning_resources/serializers_test.py +++ b/learning_resources/serializers_test.py @@ -62,7 +62,8 @@ def test_serialize_course_to_json(): { "course_numbers": serializers.CourseNumberSerializer( instance=course.course_numbers, many=True - ).data + ).data, + "credits_earned": course.credits_earned, }, ) @@ -167,9 +168,14 @@ def test_serialize_video_resource_playlists_to_json(): assert serializer.data["playlists"] == [playlist.learning_resource.id] -def test_serialize_video_resource_with_video_object(): +@pytest.mark.parametrize( + ("version", "image_field"), + [("v1", "cover_image_url"), ("v2", "thumbnail_url")], +) +def test_serialize_video_resource_with_video_object(rf, version, image_field): """ Verify that VideoResourceSerializer correctly serializes a video with a Video object + for both v1 and v2 API versions. """ video = factories.VideoFactory.create( duration="PT10M30S", @@ -178,13 +184,17 @@ def test_serialize_video_resource_with_video_object(): resource = LearningResource.objects.for_serialization().get( pk=video.learning_resource.pk ) - serializer = serializers.VideoResourceSerializer(instance=resource) + request = rf.get("/") + request.version = version + serializer = serializers.VideoResourceSerializer( + instance=resource, context={"request": request} + ) assert serializer.data["video"] == { "id": video.id, "duration": "PT10M30S", "caption_urls": [], - "cover_image_url": None, + image_field: None, "streaming_url": None, } assert serializer.data["content_files"] == [] @@ -360,7 +370,7 @@ def test_learning_resource_serializer( # noqa: PLR0913 { "department_id": dept.department_id, "name": dept.name, - "channel_url": frontend_absolute_url( + "url": frontend_absolute_url( f"/c/department/{Channel.objects.get(department_detail__department=dept).name}/", ), "school": { @@ -424,6 +434,22 @@ def test_serialize_run_related_models(): assert attr in serializer.data["instructors"][0] +@pytest.mark.parametrize( + ("run_url", "expected"), + [ + ("https://example.com/course", "https://example.com/course/enroll/"), + ("https://example.com/course/", "https://example.com/course/enroll/"), + ("", None), + (None, None), + ], +) +def test_run_serializer_enrollment_url(run_url, expected): + """enrollment_url is derived from the run url with a single trailing slash.""" + run = factories.LearningResourceRunFactory.create(url=run_url) + serializer = serializers.LearningResourceRunSerializer(run) + assert serializer.data["enrollment_url"] == expected + + @pytest.mark.parametrize( ("data", "error"), [ @@ -664,7 +690,7 @@ def test_content_file_serializer(settings, expected_types, has_channels): { "name": dept.name, "department_id": dept.department_id, - "channel_url": frontend_absolute_url( + "url": frontend_absolute_url( f"/c/department/{Channel.objects.get(department_detail__department=dept).name}/" ) if has_channels diff --git a/learning_resources/transforms/__init__.py b/learning_resources/transforms/__init__.py new file mode 100644 index 0000000000..7f4d96e8a4 --- /dev/null +++ b/learning_resources/transforms/__init__.py @@ -0,0 +1,3 @@ +"""API version transforms for learning_resources.""" + +from learning_resources.transforms.v2 import * # noqa: F403 diff --git a/learning_resources/transforms/v2.py b/learning_resources/transforms/v2.py new file mode 100644 index 0000000000..baf27265e4 --- /dev/null +++ b/learning_resources/transforms/v2.py @@ -0,0 +1,222 @@ +"""v2 transforms for learning_resources serializers. + +These transforms maintain backwards compatibility for v1 clients when +the v2 API introduces breaking changes. + +""" + +from mitol.api_versioning.transforms import Transform + + +class DepartmentRenameChannelUrlToUrl(Transform): + """v2 renames channel_url to url on LearningResourceBaseDepartmentSerializer.""" + + version = "v2" + description = "Rename channel_url to url on base Department" + serializer = ( + "learning_resources.serializers.LearningResourceBaseDepartmentSerializer" + ) + + def to_representation(self, data, request, instance): # noqa: ARG002 + """Rename url back to channel_url for v1 clients.""" + if "url" in data: + data["channel_url"] = data.pop("url") + return data + + def to_internal_value(self, data, request): # noqa: ARG002 + """Convert channel_url from v1 clients to url for v2.""" + if "channel_url" in data: + data["url"] = data.pop("channel_url") + return data + + def transform_schema(self, schema): + """Swap url/channel_url in schema and keep old ordering for v1.""" + props = schema.get("properties", {}) + if "url" in props: + props["channel_url"] = props.pop("url") + + # Keep full Department property order stable in v0/v1 specs. + if "channel_url" in props and "school" in props: + ordered_keys = ["department_id", "name", "channel_url", "school"] + new_props = {k: props[k] for k in ordered_keys if k in props} + for key, value in props.items(): + if key not in new_props: + new_props[key] = value + schema["properties"] = new_props + + required = schema.get("required", []) + if "url" in required: + required[required.index("url")] = "channel_url" + required.sort() + return schema + + +class FullDepartmentRenameChannelUrlToUrl(DepartmentRenameChannelUrlToUrl): + """v2 renames channel_url to url on LearningResourceDepartmentSerializer. + + Needed because drf-spectacular emits a separate schema component for the + full Department serializer even though the field is inherited, and the + runtime transform lookup uses exact serializer-class matching. + """ + + version = "v2" + description = "Rename channel_url to url on full Department" + serializer = "learning_resources.serializers.LearningResourceDepartmentSerializer" + + +class RunAddEnrollmentUrl(Transform): + """v2 adds enrollment_url to LearningResourceRunSerializer.""" + + version = "v2" + description = "Add enrollment_url field to Run" + serializer = "learning_resources.serializers.LearningResourceRunSerializer" + + def to_representation(self, data, request, instance): # noqa: ARG002 + """Remove enrollment_url for v1 clients.""" + data.pop("enrollment_url", None) + return data + + def transform_schema(self, schema): + """Remove enrollment_url from schema for older versions.""" + schema.get("properties", {}).pop("enrollment_url", None) + required = schema.get("required", []) + if "enrollment_url" in required: + required.remove("enrollment_url") + return schema + + +class VideoAddThumbnailUrl(Transform): + """v2 adds thumbnail_url to VideoSerializer.""" + + version = "v2" + description = "Add thumbnail_url field to Video" + serializer = "learning_resources.serializers.VideoSerializer" + + def to_representation(self, data, request, instance): # noqa: ARG002 + """Remove thumbnail_url for v1 clients.""" + data.pop("thumbnail_url", None) + return data + + def transform_schema(self, schema): + """Remove thumbnail_url from schema for older versions.""" + schema.get("properties", {}).pop("thumbnail_url", None) + required = schema.get("required", []) + if "thumbnail_url" in required: + required.remove("thumbnail_url") + return schema + + +class VideoRemoveCoverImageUrl(Transform): + """v2 removes cover_image_url from VideoSerializer.""" + + version = "v2" + description = "Restore v1 cover_image_url property ordering on Video" + serializer = "learning_resources.serializers.VideoSerializer" + + def to_representation(self, data, request, instance): # noqa: ARG002 + """Restore cover_image_url for v1 clients.""" + if "cover_image_url" not in data: + if "thumbnail_url" in data: + data["cover_image_url"] = data["thumbnail_url"] + elif instance is not None: + data["cover_image_url"] = getattr(instance, "cover_image_url", "") + else: + data["cover_image_url"] = "" + return data + + def transform_schema(self, schema): + """Restore cover_image_url shape/order for older Video schemas.""" + props = schema.get("properties", {}) + required = schema.get("required", []) + + is_video_response = any( + key in props for key in ("id", "caption_urls", "streaming_url") + ) + if not is_video_response: + # v1 request schemas did not include cover_image_url. + props.pop("cover_image_url", None) + if "cover_image_url" in required: + required.remove("cover_image_url") + return schema + + cover = { + "type": "string", + "format": "uri", + "readOnly": True, + "nullable": True, + } + + # Force the legacy response shape for cover_image_url. + props["cover_image_url"] = cover + + # Keep legacy property order: ... streaming_url, cover_image_url, duration. + new_props = {} + inserted = False + for key, value in props.items(): + if key == "cover_image_url": + continue + if key == "duration" and not inserted: + new_props["cover_image_url"] = cover + inserted = True + new_props[key] = value + if not inserted: + new_props["cover_image_url"] = cover + schema["properties"] = new_props + + if "cover_image_url" not in required: + if "duration" in required: + required.insert(required.index("duration"), "cover_image_url") + else: + required.append("cover_image_url") + return schema + + +class CourseAddCreditsEarned(Transform): + """v2 adds credits_earned to CourseSerializer.""" + + version = "v2" + description = "Add credits_earned field to Course" + serializer = "learning_resources.serializers.CourseSerializer" + + def to_representation(self, data, request, instance): # noqa: ARG002 + """Remove credits_earned for v1 clients.""" + data.pop("credits_earned", None) + return data + + def to_internal_value(self, data, request): # noqa: ARG002 + """Drop credits_earned from v1 client requests.""" + data.pop("credits_earned", None) + return data + + def transform_schema(self, schema): + """Remove credits_earned from schema for older versions.""" + schema.get("properties", {}).pop("credits_earned", None) + required = schema.get("required", []) + if "credits_earned" in required: + required.remove("credits_earned") + return schema + + +class CaptionUrlAddWordCount(Transform): + """v2 adds word_count to CaptionUrlSerializer entries in VideoSerializer.""" + + version = "v2" + description = "Add word_count to caption URL entries" + serializer = "learning_resources.serializers.VideoSerializer" + component_name = "CaptionUrl" + + def to_representation(self, data, request, instance): # noqa: ARG002 + """Strip word_count from each caption entry for v1 clients.""" + if "caption_urls" in data and isinstance(data["caption_urls"], list): + for caption in data["caption_urls"]: + if isinstance(caption, dict): + caption.pop("word_count", None) + return data + + def transform_schema(self, schema): + """Remove word_count from the CaptionUrl component for older versions.""" + schema.get("properties", {}).pop("word_count", None) + required = schema.get("required", []) + if "word_count" in required: + required.remove("word_count") + return schema diff --git a/learning_resources/urls.py b/learning_resources/urls.py index a491382edb..2491906326 100644 --- a/learning_resources/urls.py +++ b/learning_resources/urls.py @@ -139,8 +139,11 @@ v0_urls = v0_router.urls +v2_urls = v1_urls + app_name = "lr" urlpatterns = [ + re_path(r"^api/v2/", include((v2_urls, "v2"))), re_path(r"^api/v1/", include((v1_urls, "v1"))), re_path(r"^api/v0/", include((v0_urls, "v0"))), path("podcasts/rss_feed", views.podcast_rss_feed, name="podcast-rss-feed"), diff --git a/learning_resources/views_test.py b/learning_resources/views_test.py index 097ccfb195..f13d3c8428 100644 --- a/learning_resources/views_test.py +++ b/learning_resources/views_test.py @@ -2,6 +2,7 @@ import random from datetime import timedelta +from types import SimpleNamespace import pytest from django.conf import settings @@ -46,7 +47,6 @@ ) from learning_resources.serializers import ( ContentFileSerializer, - LearningResourceDepartmentSerializer, LearningResourceDisplayInfoResponseSerializer, LearningResourceOfferorDetailSerializer, LearningResourcePlatformSerializer, @@ -115,6 +115,29 @@ def test_get_course_detail_endpoint(client, url): ) +@pytest.mark.parametrize( + ("url", "version"), + [ + ("lr:v1:courses_api-detail", "v1"), + ("lr:v2:courses_api-detail", "v2"), + ], +) +def test_run_enrollment_url_versioning(client, url, version): + """enrollment_url should appear on runs for v2 only, derived from run.url.""" + course = CourseFactory.create() + run = course.learning_resource.runs.first() + run.url = "https://example.com/course" + run.save() + + resp = client.get(reverse(url, args=[course.learning_resource.id])) + run_data = next(r for r in resp.data["runs"] if r["id"] == run.id) + + if version == "v2": + assert run_data["enrollment_url"] == "https://example.com/course/enroll/" + else: + assert "enrollment_url" not in run_data + + @pytest.mark.parametrize( "url", [ @@ -718,43 +741,72 @@ def test_topic_channel_url(client, published): assert resp.status_code == 404 -def test_departments_list_endpoint(client): - """Test departments list endpoint""" +@pytest.mark.parametrize( + ("version", "url_key"), + [("v1", "channel_url"), ("v2", "url")], +) +def test_departments_list_endpoint(client, version, url_key): + """Test departments list endpoint for both v1 and v2""" departments = sorted( LearningResourceDepartmentFactory.create_batch(3), key=lambda department: department.department_id, ) - resp = client.get(reverse("lr:v1:departments_api-list")) + resp = client.get(reverse(f"lr:{version}:departments_api-list")) assert resp.data.get("count") == 3 for i in range(3): - assert ( - resp.data.get("results")[i] - == LearningResourceDepartmentSerializer(instance=departments[i]).data - ) + dept = departments[i] + assert resp.data.get("results")[i] == { + "department_id": dept.department_id, + "name": dept.name, + url_key: dept.channel_url, + "school": { + "id": dept.school.id, + "name": dept.school.name, + "url": dept.school.url, + }, + } -def test_departments_detail_endpoint(client): - """Test departments detail endpoint""" +@pytest.mark.parametrize( + ("version", "url_key"), + [("v1", "channel_url"), ("v2", "url")], +) +def test_departments_detail_endpoint(client, version, url_key): + """Test departments detail endpoint for both v1 and v2""" department = LearningResourceDepartmentFactory.create( department_id="ABC", name="Alpha Beta Charlie" ) + expected = { + "department_id": department.department_id, + "name": department.name, + url_key: department.channel_url, + "school": { + "id": department.school.id, + "name": department.school.name, + "url": department.school.url, + }, + } for dept_id in ("abc", "aBc", "ABC"): - resp = client.get(reverse("lr:v1:departments_api-detail", args=[dept_id])) - assert ( - resp.data == LearningResourceDepartmentSerializer(instance=department).data + resp = client.get( + reverse(f"lr:{version}:departments_api-detail", args=[dept_id]) ) + assert resp.data == expected -def test_schools_list_endpoint(client): - """Test schools list endpoint""" +@pytest.mark.parametrize( + ("version", "url_key"), + [("v1", "channel_url"), ("v2", "url")], +) +def test_schools_list_endpoint(client, version, url_key): + """Test schools list endpoint for both v1 and v2""" schools = sorted( [dept.school for dept in LearningResourceDepartmentFactory.create_batch(3)], key=lambda school: school.id, ) - resp = client.get(reverse("lr:v1:schools_api-list")) + resp = client.get(reverse(f"lr:{version}:schools_api-list")) assert resp.data.get("count") == 3 for i in range(3): assert resp.data.get("results")[i] == { @@ -765,24 +817,37 @@ def test_schools_list_endpoint(client): { "department_id": dept.department_id, "name": dept.name, - "channel_url": None, + url_key: dept.channel_url, } for dept in schools[i].departments.all().order_by("department_id") ], } -def test_schools_detail_endpoint(client): - """Test schools detail endpoint""" - department = LearningResourceDepartmentFactory.create( - department_id="ABC", name="Alpha Beta Charlie" - ) - - for dept_id in ("abc", "aBc", "ABC"): - resp = client.get(reverse("lr:v1:departments_api-detail", args=[dept_id])) - assert ( - resp.data == LearningResourceDepartmentSerializer(instance=department).data - ) +@pytest.mark.parametrize( + ("version", "url_key"), + [("v1", "channel_url"), ("v2", "url")], +) +def test_schools_detail_endpoint(client, version, url_key): + """Test schools detail endpoint for both v1 and v2""" + departments = LearningResourceDepartmentFactory.create_batch(2) + school = departments[0].school + + expected = { + "id": school.id, + "name": school.name, + "url": school.url, + "departments": [ + { + "department_id": dept.department_id, + "name": dept.name, + url_key: dept.channel_url, + } + for dept in school.departments.all().order_by("department_id") + ], + } + resp = client.get(reverse(f"lr:{version}:schools_api-detail", args=[school.id])) + assert resp.data == expected def test_platforms_list_endpoint(client): @@ -883,10 +948,15 @@ def test_get_video_playlist_detail_endpoint(client, url): @pytest.mark.parametrize( - "url", - ["lr:v1:learning_resource_items_api-list", "lr:v1:video_playlist_items_api-list"], + ("url", "api_version"), + [ + ("lr:v1:learning_resource_items_api-list", "v1"), + ("lr:v1:video_playlist_items_api-list", "v1"), + ("lr:v2:learning_resource_items_api-list", "v2"), + ("lr:v2:video_playlist_items_api-list", "v2"), + ], ) -def test_get_video_playlist_items_endpoint(client, url): +def test_get_video_playlist_items_endpoint(client, url, api_version): """Test video playlist items endpoint""" playlist = VideoPlaylistFactory.create().learning_resource videos = VideoFactory.create_batch(2) @@ -920,20 +990,24 @@ def test_get_video_playlist_items_endpoint(client, url): ) ): assert resp.data.get("results")[idx]["id"] == resource_relationship.id - assert ( - resp.data.get("results")[idx]["resource"] - == VideoResourceSerializer(instance=resource_relationship.child).data - ) + mock_request = SimpleNamespace(version=api_version) + expected = VideoResourceSerializer( + instance=resource_relationship.child, + context={"request": mock_request}, + ).data + assert resp.data.get("results")[idx]["resource"] == expected @pytest.mark.parametrize( - ("url", "params"), + ("url", "params", "api_version"), [ - ("lr:v1:videos_api-list", ""), - ("lr:v1:learning_resources_api-list", "resource_type=video"), + ("lr:v1:videos_api-list", "", "v1"), + ("lr:v1:learning_resources_api-list", "resource_type=video", "v1"), + ("lr:v2:videos_api-list", "", "v2"), + ("lr:v2:learning_resources_api-list", "resource_type=video", "v2"), ], ) -def test_list_video_endpoint(client, url, params): +def test_list_video_endpoint(client, url, params, api_version): """Test video endpoint""" videos = sorted(VideoFactory.create_batch(2), key=lambda resource: resource.id) @@ -943,12 +1017,13 @@ def test_list_video_endpoint(client, url, params): resp = client.get(f"{reverse(url)}?{params}") assert resp.data.get("count") == 2 + mock_request = SimpleNamespace(version=api_version) for idx, video in enumerate(videos): assert resp.data.get("results")[idx]["id"] == video.learning_resource.id - assert ( - resp.data.get("results")[idx]["video"] - == VideoSerializer(instance=video).data - ) + expected = VideoSerializer( + instance=video, context={"request": mock_request} + ).data + assert resp.data.get("results")[idx]["video"] == expected @pytest.mark.parametrize( @@ -975,16 +1050,24 @@ def test_list_video_endpoint_returns_playlists(client, url, params): @pytest.mark.parametrize( - "url", ["lr:v1:videos_api-detail", "lr:v1:learning_resources_api-detail"] + ("url", "api_version"), + [ + ("lr:v1:videos_api-detail", "v1"), + ("lr:v1:learning_resources_api-detail", "v1"), + ("lr:v2:videos_api-detail", "v2"), + ("lr:v2:learning_resources_api-detail", "v2"), + ], ) -def test_get_video_detail_endpoint(client, url): +def test_get_video_detail_endpoint(client, url, api_version): """Test video detail endpoint""" video = VideoFactory.create() resp = client.get(reverse(url, args=[video.learning_resource.id])) + mock_request = SimpleNamespace(version=api_version) + expected = VideoSerializer(instance=video, context={"request": mock_request}).data assert resp.data.get("readable_id") == video.learning_resource.readable_id - assert resp.data.get("video") == VideoSerializer(instance=video).data + assert resp.data.get("video") == expected @pytest.mark.parametrize( diff --git a/learning_resources_search/serializers.py b/learning_resources_search/serializers.py index 9911598dba..f2674bde7d 100644 --- a/learning_resources_search/serializers.py +++ b/learning_resources_search/serializers.py @@ -11,6 +11,10 @@ from django.db.models import Q from drf_spectacular.plumbing import build_choice_description_list from drf_spectacular.utils import extend_schema_field +from mitol.api_versioning.mixins import ( + VersionedSerializerMixin, + transform_dict_backwards, +) from rest_framework import serializers from rest_framework.utils.urls import replace_query_param @@ -638,7 +642,7 @@ def get_metadata(self, instance) -> SearchResponseMetadata: } -class PercolateQuerySerializer(serializers.ModelSerializer): +class PercolateQuerySerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Serializer for PercolateQuery objects """ @@ -660,8 +664,17 @@ class LearningResourcesSearchResponseSerializer(SearchResponseSerializer): @extend_schema_field(LearningResourceSerializer(many=True)) def get_results(self, instance): + request = self.context.get("request") hits = instance.get("hits", {}).get("hits", []) - return (hit.get("_source") for hit in hits) + return ( + transform_dict_backwards( + hit.get("_source"), + LearningResourceSerializer, + request, + recursive=True, + ) + for hit in hits + ) class ContentFileSearchResponseSerializer(SearchResponseSerializer): @@ -671,8 +684,17 @@ class ContentFileSearchResponseSerializer(SearchResponseSerializer): @extend_schema_field(ContentFileSerializer(many=True)) def get_results(self, instance): + request = self.context.get("request") hits = instance.get("hits", {}).get("hits", []) - return (hit.get("_source") for hit in hits) + return ( + transform_dict_backwards( + hit.get("_source"), + ContentFileSerializer, + request, + recursive=True, + ) + for hit in hits + ) class PercolateQuerySubscriptionRequestSerializer( diff --git a/learning_resources_search/urls.py b/learning_resources_search/urls.py index 3e5825b619..1854d8d02c 100644 --- a/learning_resources_search/urls.py +++ b/learning_resources_search/urls.py @@ -39,8 +39,11 @@ ), ] +v2_urls = v1_urls + app_name = "lr_search" urlpatterns = [ + re_path(r"^api/v2/", include((v2_urls, "v2"))), re_path(r"^api/v1/", include((v1_urls, "v1"))), re_path(r"^api/v0/", include((v0_urls, "v0"))), ] diff --git a/main/settings.py b/main/settings.py index 2d36ae984d..3aad8db067 100644 --- a/main/settings.py +++ b/main/settings.py @@ -130,6 +130,7 @@ "widgets", "learning_resources", "learning_resources_search", + "mitol.api_versioning.apps.ApiVersioningApp", "openapi", "articles", "oauth2_provider", @@ -682,7 +683,7 @@ def get_all_config_keys(): ], "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", - "ALLOWED_VERSIONS": ["v0", "v1"], + "ALLOWED_VERSIONS": ["v0", "v1", "v2"], "ORDERING_PARAM": "sortby", } diff --git a/news_events/serializers.py b/news_events/serializers.py index bac6736545..dacfd4e29c 100644 --- a/news_events/serializers.py +++ b/news_events/serializers.py @@ -1,5 +1,6 @@ """Serializers for news_events""" +from mitol.api_versioning.mixins import VersionedSerializerMixin from rest_framework import serializers from news_events import models @@ -8,7 +9,7 @@ COMMON_IGNORED_FIELDS = ("created_on", "updated_on") -class FeedImageSerializer(serializers.ModelSerializer): +class FeedImageSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for FeedImage""" class Meta: @@ -16,7 +17,7 @@ class Meta: exclude = COMMON_IGNORED_FIELDS -class FeedSourceSerializer(serializers.ModelSerializer): +class FeedSourceSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """FeedSource serializer""" image = FeedImageSerializer() @@ -26,7 +27,7 @@ class Meta: exclude = COMMON_IGNORED_FIELDS -class FeedEventDetailSerializer(serializers.ModelSerializer): +class FeedEventDetailSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """FeedEventDetail serializer""" class Meta: @@ -34,7 +35,7 @@ class Meta: exclude = ("feed_item", *COMMON_IGNORED_FIELDS) -class FeedNewsDetailSerializer(serializers.ModelSerializer): +class FeedNewsDetailSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """FeedNewsDetail serializer""" class Meta: @@ -42,7 +43,7 @@ class Meta: exclude = ("feed_item", *COMMON_IGNORED_FIELDS) -class FeedItemBaseSerializer(serializers.ModelSerializer): +class FeedItemBaseSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Base serializer for FeedItem""" feed_type = serializers.CharField(source="source.feed_type") diff --git a/openapi/settings_spectacular.py b/openapi/settings_spectacular.py index 601169e59c..920525528b 100644 --- a/openapi/settings_spectacular.py +++ b/openapi/settings_spectacular.py @@ -15,5 +15,6 @@ "POSTPROCESSING_HOOKS": [ "drf_spectacular.hooks.postprocess_schema_enums", "openapi.hooks.postprocess_x_enum_descriptions", + "mitol.api_versioning.schema_hooks.postprocess_versioned_schema", ], } diff --git a/openapi/specs/v1.yaml b/openapi/specs/v1.yaml index 0fa8a2af40..063d0f4715 100644 --- a/openapi/specs/v1.yaml +++ b/openapi/specs/v1.yaml @@ -16275,6 +16275,7 @@ components: - channel_subscription_type User: type: object + description: Serializer for article author user fields. properties: first_name: type: string @@ -16377,6 +16378,7 @@ components: - title UserRequest: type: object + description: Serializer for article author user fields. properties: first_name: type: string diff --git a/openapi/specs/v2.yaml b/openapi/specs/v2.yaml new file mode 100644 index 0000000000..7fa9980fe5 --- /dev/null +++ b/openapi/specs/v2.yaml @@ -0,0 +1,15828 @@ +openapi: 3.0.3 +info: + title: MIT Learn API + version: 0.0.1 (v2) + description: MIT public API +paths: + /api/v2/content_file_search/: + get: + operationId: content_file_search_retrieve + description: Search for content files + summary: Search + parameters: + - in: query + name: aggregations + schema: + type: array + items: + enum: + - topic + - content_feature_type + - platform + - offered_by + type: string + description: |- + * `topic` - topic + * `content_feature_type` - content_feature_type + * `platform` - platform + * `offered_by` - offered_by + description: Show resource counts by category + - in: query + name: content_feature_type + schema: + type: array + items: + type: string + minLength: 1 + description: The feature type of the content file. Possible options are at + api/v1/course_features/ + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations + - in: query + name: id + schema: + type: array + items: + type: integer + description: The id value for the content file + - in: query + name: limit + schema: + type: integer + description: Number of results to return per page + - in: query + name: ocw_topic + schema: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + - in: query + name: offered_by + schema: + type: array + items: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + - in: query + name: offset + schema: + type: integer + description: The initial index from which to return the results + - in: query + name: platform + schema: + type: array + items: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` - Open\ + \ Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` - Bootcamps\n\ + * `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman College of\ + \ Computing\n* `ctl` - Center for Transportation & Logistics\n* `whu` -\ + \ WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n* `simplilearn`\ + \ - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` - Podcast\n* `youtube`\ + \ - YouTube\n* `canvas` - Canvas\n* `climate` - MIT Climate\n* `ovs` - ODL\ + \ Video Service" + - in: query + name: q + schema: + type: string + minLength: 1 + description: The search text + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: The id value of the parent learning resource for the content + file + - in: query + name: run_id + schema: + type: array + items: + type: integer + description: The id value of the run that the content file belongs to + - in: query + name: sortby + schema: + enum: + - id + - -id + - resource_readable_id + - -resource_readable_id + type: string + minLength: 1 + description: |- + if the parameter starts with '-' the sort is in descending order + + * `id` - id + * `-id` - -id + * `resource_readable_id` - resource_readable_id + * `-resource_readable_id` - -resource_readable_id + - in: query + name: topic + schema: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + tags: + - content_file_search + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContentFileSearchResponse' + description: '' + /api/v2/contentfiles/: + get: + operationId: contentfiles_list + description: Viewset for ContentFiles + summary: List + parameters: + - in: query + name: content_feature_type + schema: + type: array + items: + type: string + description: Content feature type for the content file. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: edx_module_id + schema: + type: array + items: + type: string + description: The edx module id of the content file + explode: true + style: form + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource the content file belongs to + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources the content file belongs to is offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: The id of the learning resource the content file belongs to + explode: true + style: form + - in: query + name: run_id + schema: + type: array + items: + type: number + description: The id of the learning resource run the content file belongs + to + explode: true + style: form + tags: + - contentfiles + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedContentFileList' + description: '' + /api/v2/contentfiles/{id}/: + get: + operationId: contentfiles_retrieve + description: Viewset for ContentFiles + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this contentfile. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + tags: + - contentfiles + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContentFile' + description: '' + /api/v2/course_features/: + get: + operationId: course_features_list + description: Course Features and Content Feature Types + summary: List + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - course_features + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceContentTagList' + description: '' + /api/v2/course_features/{id}/: + get: + operationId: course_features_retrieve + description: Course Features and Content Feature Types + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource content + tag. + required: true + tags: + - course_features + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceContentTag' + description: '' + /api/v2/courses/: + get: + operationId: courses_list + description: Get a paginated list of courses + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - courses + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedCourseResourceList' + description: '' + /api/v2/courses/{id}/: + get: + operationId: courses_retrieve + description: Retrieve a single course + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - courses + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CourseResource' + description: '' + /api/v2/courses/{learning_resource_id}/contentfiles/: + get: + operationId: courses_contentfiles_list + description: Show content files for a learning resource + summary: Learning Resource Content File List + parameters: + - in: query + name: content_feature_type + schema: + type: array + items: + type: string + description: Content feature type for the content file. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: edx_module_id + schema: + type: array + items: + type: string + description: The edx module id of the content file + explode: true + style: form + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource the content file belongs to + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources the content file belongs to is offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: The id of the learning resource the content file belongs to + explode: true + style: form + - in: query + name: run_id + schema: + type: array + items: + type: number + description: The id of the learning resource run the content file belongs + to + explode: true + style: form + tags: + - courses + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedContentFileList' + description: '' + /api/v2/courses/{learning_resource_id}/contentfiles/{id}/: + get: + operationId: courses_contentfiles_retrieve + description: Show content files for a learning resource + summary: Learning Resource Content File Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this contentfile. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + tags: + - courses + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContentFile' + description: '' + /api/v2/departments/: + get: + operationId: departments_list + description: MIT academic departments + summary: List + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - departments + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceDepartmentList' + description: '' + /api/v2/departments/{department_id}/: + get: + operationId: departments_retrieve + description: MIT academic departments + summary: Retrieve + parameters: + - in: path + name: department_id + schema: + type: string + description: A unique value identifying this learning resource department. + required: true + tags: + - departments + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceDepartment' + description: '' + /api/v2/featured/: + get: + operationId: featured_list + description: Get a paginated list of featured resources + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - featured + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceList' + description: '' + /api/v2/featured/{id}/: + get: + operationId: featured_retrieve + description: Retrieve a single featured resource + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - featured + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResource' + description: '' + /api/v2/learning_resource_display_info/: + get: + operationId: learning_resource_display_info_list + description: Get a paginated list of learning resource display info + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - learning_resource_display_info + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceDisplayInfoResponseList' + description: '' + /api/v2/learning_resource_display_info/{id}/: + get: + operationId: learning_resource_display_info_retrieve + description: Retrieve display info for a learning resource. + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - learning_resource_display_info + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceDisplayInfoResponse' + description: '' + /api/v2/learning_resources/: + get: + operationId: learning_resources_list + description: Get a paginated list of learning resources. + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceList' + description: '' + /api/v2/learning_resources/{id}/: + get: + operationId: learning_resources_retrieve + description: Retrieve a single learning resource. + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResource' + description: '' + /api/v2/learning_resources/{id}/similar/: + get: + operationId: learning_resources_similar_list + description: |- + Fetch similar learning resources, optionally narrowed by filters. + + Args: + id (integer): The id of the learning resource + + Returns: + QuerySet of similar LearningResource for the resource matching the id parameter + summary: Get similar resources + parameters: + - in: query + name: certification + schema: + type: boolean + nullable: true + description: True if the learning resource offers a certificate + - in: query + name: certification_type + schema: + type: array + items: + enum: + - micromasters + - professional + - completion + - none + type: string + description: |- + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + description: "The type of certificate \n\n* `micromasters` - MicroMasters\ + \ Credential\n* `professional` - Professional Certificate\n* `completion`\ + \ - Certificate of Completion\n* `none` - No Certificate" + - in: query + name: course_feature + schema: + type: array + items: + type: string + minLength: 1 + description: The course feature. Possible options are at api/v1/course_features/ + - in: query + name: delivery + schema: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + description: "The delivery options in which the learning resource is offered\ + \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ + \ - In person\n* `offline` - Offline" + - in: query + name: department + schema: + type: array + items: + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + type: string + description: |- + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + description: "The department that offers the learning resource \ + \ \n\n* `1` - Civil and Environmental Engineering\n* `2` - Mechanical Engineering\n\ + * `3` - Materials Science and Engineering\n* `4` - Architecture\n* `5` -\ + \ Chemistry\n* `6` - Electrical Engineering and Computer Science\n* `7`\ + \ - Biology\n* `8` - Physics\n* `9` - Brain and Cognitive Sciences\n* `10`\ + \ - Chemical Engineering\n* `11` - Urban Studies and Planning\n* `12` -\ + \ Earth, Atmospheric, and Planetary Sciences\n* `14` - Economics\n* `15`\ + \ - Management\n* `16` - Aeronautics and Astronautics\n* `17` - Political\ + \ Science\n* `18` - Mathematics\n* `20` - Biological Engineering\n* `21A`\ + \ - Anthropology\n* `21G` - Global Languages\n* `21H` - History\n* `21L`\ + \ - Literature\n* `21M` - Music and Theater Arts\n* `22` - Nuclear Science\ + \ and Engineering\n* `24` - Linguistics and Philosophy\n* `CC` - Concourse\n\ + * `CMS-W` - Comparative Media Studies/Writing\n* `EC` - Edgerton Center\n\ + * `ES` - Experimental Study Group\n* `ESD` - Engineering Systems Division\n\ + * `HST` - Medical Engineering and Science\n* `IDS` - Data, Systems, and\ + \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ + \ Education and Recreation\n* `SP` - Special Programs\n* `STS` - Science,\ + \ Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: free + schema: + type: boolean + nullable: true + - in: path + name: id + schema: + type: integer + required: true + - in: query + name: level + schema: + type: array + items: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + type: string + description: |- + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + - in: query + name: limit + schema: + type: integer + - in: query + name: ocw_topic + schema: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + - in: query + name: offered_by + schema: + type: array + items: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + - in: query + name: platform + schema: + type: array + items: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` - Open\ + \ Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` - Bootcamps\n\ + * `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman College of\ + \ Computing\n* `ctl` - Center for Transportation & Logistics\n* `whu` -\ + \ WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n* `simplilearn`\ + \ - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` - Podcast\n* `youtube`\ + \ - YouTube\n* `canvas` - Canvas\n* `climate` - MIT Climate\n* `ovs` - ODL\ + \ Video Service" + - in: query + name: professional + schema: + type: boolean + nullable: true + - in: query + name: resource_type + schema: + type: array + items: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning path + * `podcast` - podcast + * `podcast_episode` - podcast episode + * `video` - video + * `video_playlist` - video playlist + * `document` - document + description: "The type of learning resource \n\n* `course` - course\n\ + * `program` - program\n* `learning_path` - learning path\n* `podcast` -\ + \ podcast\n* `podcast_episode` - podcast episode\n* `video` - video\n* `video_playlist`\ + \ - video playlist\n* `document` - document" + - in: query + name: resource_type_group + schema: + type: array + items: + enum: + - course + - program + - learning_material + type: string + description: |- + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + description: "The category of learning resource \n\n* `course`\ + \ - Course\n* `program` - Program\n* `learning_material` - Learning Material" + - in: query + name: topic + schema: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LearningResource' + description: '' + /api/v2/learning_resources/{id}/vector_similar/: + get: + operationId: learning_resources_vector_similar_list + description: |- + Fetch similar learning resources, optionally narrowed by Qdrant filters. + + Args: + id (integer): The id of the learning resource + + Returns: + QuerySet of similar LearningResource for the resource matching the id parameter + summary: Get similar resources using vector embeddings + parameters: + - in: query + name: certification + schema: + type: boolean + nullable: true + description: True if the learning resource offers a certificate + - in: query + name: certification_type + schema: + type: array + items: + enum: + - micromasters + - professional + - completion + - none + type: string + description: |- + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + description: "The type of certificate \n\n* `micromasters` - MicroMasters\ + \ Credential\n* `professional` - Professional Certificate\n* `completion`\ + \ - Certificate of Completion\n* `none` - No Certificate" + - in: query + name: course_feature + schema: + type: array + items: + type: string + minLength: 1 + description: The course feature. Possible options are at api/v1/course_features/ + - in: query + name: delivery + schema: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + description: "The delivery options in which the learning resource is offered\ + \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ + \ - In person\n* `offline` - Offline" + - in: query + name: department + schema: + type: array + items: + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + type: string + description: |- + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + description: "The department that offers the learning resource \ + \ \n\n* `1` - Civil and Environmental Engineering\n* `2` - Mechanical Engineering\n\ + * `3` - Materials Science and Engineering\n* `4` - Architecture\n* `5` -\ + \ Chemistry\n* `6` - Electrical Engineering and Computer Science\n* `7`\ + \ - Biology\n* `8` - Physics\n* `9` - Brain and Cognitive Sciences\n* `10`\ + \ - Chemical Engineering\n* `11` - Urban Studies and Planning\n* `12` -\ + \ Earth, Atmospheric, and Planetary Sciences\n* `14` - Economics\n* `15`\ + \ - Management\n* `16` - Aeronautics and Astronautics\n* `17` - Political\ + \ Science\n* `18` - Mathematics\n* `20` - Biological Engineering\n* `21A`\ + \ - Anthropology\n* `21G` - Global Languages\n* `21H` - History\n* `21L`\ + \ - Literature\n* `21M` - Music and Theater Arts\n* `22` - Nuclear Science\ + \ and Engineering\n* `24` - Linguistics and Philosophy\n* `CC` - Concourse\n\ + * `CMS-W` - Comparative Media Studies/Writing\n* `EC` - Edgerton Center\n\ + * `ES` - Experimental Study Group\n* `ESD` - Engineering Systems Division\n\ + * `HST` - Medical Engineering and Science\n* `IDS` - Data, Systems, and\ + \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ + \ Education and Recreation\n* `SP` - Special Programs\n* `STS` - Science,\ + \ Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: free + schema: + type: boolean + nullable: true + - in: path + name: id + schema: + type: integer + required: true + - in: query + name: level + schema: + type: array + items: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + type: string + description: |- + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + - in: query + name: limit + schema: + type: integer + - in: query + name: ocw_topic + schema: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + - in: query + name: offered_by + schema: + type: array + items: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + - in: query + name: platform + schema: + type: array + items: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` - Open\ + \ Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` - Bootcamps\n\ + * `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman College of\ + \ Computing\n* `ctl` - Center for Transportation & Logistics\n* `whu` -\ + \ WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n* `simplilearn`\ + \ - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` - Podcast\n* `youtube`\ + \ - YouTube\n* `canvas` - Canvas\n* `climate` - MIT Climate\n* `ovs` - ODL\ + \ Video Service" + - in: query + name: professional + schema: + type: boolean + nullable: true + - in: query + name: resource_type + schema: + type: array + items: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning path + * `podcast` - podcast + * `podcast_episode` - podcast episode + * `video` - video + * `video_playlist` - video playlist + * `document` - document + description: "The type of learning resource \n\n* `course` - course\n\ + * `program` - program\n* `learning_path` - learning path\n* `podcast` -\ + \ podcast\n* `podcast_episode` - podcast episode\n* `video` - video\n* `video_playlist`\ + \ - video playlist\n* `document` - document" + - in: query + name: resource_type_group + schema: + type: array + items: + enum: + - course + - program + - learning_material + type: string + description: |- + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + description: "The category of learning resource \n\n* `course`\ + \ - Course\n* `program` - Program\n* `learning_material` - Learning Material" + - in: query + name: topic + schema: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LearningResource' + description: '' + /api/v2/learning_resources/{learning_resource_id}/contentfiles/: + get: + operationId: learning_resources_contentfiles_list + description: Show content files for a learning resource + summary: Learning Resource Content File List + parameters: + - in: query + name: content_feature_type + schema: + type: array + items: + type: string + description: Content feature type for the content file. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: edx_module_id + schema: + type: array + items: + type: string + description: The edx module id of the content file + explode: true + style: form + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource the content file belongs to + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources the content file belongs to is offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: The id of the learning resource the content file belongs to + explode: true + style: form + - in: query + name: run_id + schema: + type: array + items: + type: number + description: The id of the learning resource run the content file belongs + to + explode: true + style: form + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedContentFileList' + description: '' + /api/v2/learning_resources/{learning_resource_id}/contentfiles/{id}/: + get: + operationId: learning_resources_contentfiles_retrieve + description: Show content files for a learning resource + summary: Learning Resource Content File Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this contentfile. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContentFile' + description: '' + /api/v2/learning_resources/{learning_resource_id}/items/: + get: + operationId: learning_resources_items_list + description: Get a list of related learning resources for a learning resource. + summary: Nested Learning Resource List + parameters: + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - name: sortby + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceRelationshipList' + description: '' + /api/v2/learning_resources/{learning_resource_id}/items/{id}/: + get: + operationId: learning_resources_items_retrieve + description: Get a singe related learning resource for a learning resource. + summary: Nested Learning Resource Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource relationship. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceRelationship' + description: '' + /api/v2/learning_resources/{id}/learning_paths/: + patch: + operationId: learning_resources_learning_paths_partial_update + description: Set Learning Path Relationships on a given Learning Resource. + summary: Set Learning Path Relationships + parameters: + - in: path + name: id + schema: + type: integer + description: id of the learning resource + required: true + - in: query + name: learning_path_id + schema: + type: array + items: + type: integer + description: id of the parent learning path + tags: + - learning_resources + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchedLearningResourceRelationshipRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PatchedLearningResourceRelationshipRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PatchedLearningResourceRelationshipRequest' + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LearningResourceRelationship' + description: '' + /api/v2/learning_resources/{id}/userlists/: + patch: + operationId: learning_resources_userlists_partial_update + description: Set User List Relationships on a given Learning Resource. + summary: Set User List Relationships + parameters: + - in: path + name: id + schema: + type: integer + description: id of the learning resource + required: true + - in: query + name: userlist_id + schema: + type: array + items: + type: integer + description: id of the parent user list + tags: + - learning_resources + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchedUserListRelationshipRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PatchedUserListRelationshipRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PatchedUserListRelationshipRequest' + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserListRelationship' + description: '' + /api/v2/learning_resources/summary/: + get: + operationId: learning_resources_summary_list + description: Get a paginated list of learning resources with summary fields + summary: Get learning resources summary + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - learning_resources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceSummaryList' + description: '' + /api/v2/learning_resources_search/: + get: + operationId: learning_resources_search_retrieve + description: Search for learning resources + summary: Search + parameters: + - in: query + name: aggregations + schema: + type: array + items: + enum: + - resource_type + - certification + - certification_type + - offered_by + - platform + - topic + - department + - level + - course_feature + - professional + - free + - delivery + - resource_type_group + - resource_category + type: string + description: |- + * `resource_type` - resource_type + * `certification` - certification + * `certification_type` - certification_type + * `offered_by` - offered_by + * `platform` - platform + * `topic` - topic + * `department` - department + * `level` - level + * `course_feature` - course_feature + * `professional` - professional + * `free` - free + * `delivery` - delivery + * `resource_type_group` - resource_type_group + * `resource_category` - resource_category + description: Show resource counts by category + - in: query + name: certification + schema: + type: boolean + nullable: true + description: True if the learning resource offers a certificate + - in: query + name: certification_type + schema: + type: array + items: + enum: + - micromasters + - professional + - completion + - none + type: string + description: |- + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + description: "The type of certificate \n\n* `micromasters` - MicroMasters\ + \ Credential\n* `professional` - Professional Certificate\n* `completion`\ + \ - Certificate of Completion\n* `none` - No Certificate" + - in: query + name: content_file_score_weight + schema: + type: number + format: double + maximum: 1 + minimum: 0 + nullable: true + description: Score weight for content file data. 1 is the default. 0 means + content files are ignored + - in: query + name: course_feature + schema: + type: array + items: + type: string + minLength: 1 + description: The course feature. Possible options are at api/v1/course_features/ + - in: query + name: delivery + schema: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + description: "The delivery options in which the learning resource is offered\ + \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ + \ - In person\n* `offline` - Offline" + - in: query + name: department + schema: + type: array + items: + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + type: string + description: |- + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + description: "The department that offers the learning resource \ + \ \n\n* `1` - Civil and Environmental Engineering\n* `2` - Mechanical Engineering\n\ + * `3` - Materials Science and Engineering\n* `4` - Architecture\n* `5` -\ + \ Chemistry\n* `6` - Electrical Engineering and Computer Science\n* `7`\ + \ - Biology\n* `8` - Physics\n* `9` - Brain and Cognitive Sciences\n* `10`\ + \ - Chemical Engineering\n* `11` - Urban Studies and Planning\n* `12` -\ + \ Earth, Atmospheric, and Planetary Sciences\n* `14` - Economics\n* `15`\ + \ - Management\n* `16` - Aeronautics and Astronautics\n* `17` - Political\ + \ Science\n* `18` - Mathematics\n* `20` - Biological Engineering\n* `21A`\ + \ - Anthropology\n* `21G` - Global Languages\n* `21H` - History\n* `21L`\ + \ - Literature\n* `21M` - Music and Theater Arts\n* `22` - Nuclear Science\ + \ and Engineering\n* `24` - Linguistics and Philosophy\n* `CC` - Concourse\n\ + * `CMS-W` - Comparative Media Studies/Writing\n* `EC` - Edgerton Center\n\ + * `ES` - Experimental Study Group\n* `ESD` - Engineering Systems Division\n\ + * `HST` - Medical Engineering and Science\n* `IDS` - Data, Systems, and\ + \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ + \ Education and Recreation\n* `SP` - Special Programs\n* `STS` - Science,\ + \ Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations + - in: query + name: free + schema: + type: boolean + nullable: true + - in: query + name: id + schema: + type: array + items: + type: integer + description: The id value for the learning resource + - in: query + name: level + schema: + type: array + items: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + type: string + description: |- + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + - in: query + name: limit + schema: + type: integer + description: Number of results to return per page + - in: query + name: max_incompleteness_penalty + schema: + type: number + format: double + maximum: 100 + minimum: 0 + nullable: true + description: Maximum score penalty for incomplete OCW courses in percent. + An OCW course with completeness = 0 will have this score penalty. Partially + complete courses have a linear penalty proportional to the degree of incompleteness. + Only affects results if there is a search term. + - in: query + name: min_score + schema: + type: number + format: double + maximum: 50 + minimum: 0 + nullable: true + description: Minimum score value a text query result needs to have to be displayed + - in: query + name: ocw_topic + schema: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + - in: query + name: offered_by + schema: + type: array + items: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + - in: query + name: offset + schema: + type: integer + description: The initial index from which to return the results + - in: query + name: platform + schema: + type: array + items: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` - Open\ + \ Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` - Bootcamps\n\ + * `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman College of\ + \ Computing\n* `ctl` - Center for Transportation & Logistics\n* `whu` -\ + \ WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n* `simplilearn`\ + \ - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` - Podcast\n* `youtube`\ + \ - YouTube\n* `canvas` - Canvas\n* `climate` - MIT Climate\n* `ovs` - ODL\ + \ Video Service" + - in: query + name: professional + schema: + type: boolean + nullable: true + - in: query + name: q + schema: + type: string + minLength: 1 + description: The search text + - in: query + name: resource_category + schema: + type: array + items: + type: string + minLength: 1 + description: The resource category for the resource + - in: query + name: resource_type + schema: + type: array + items: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning path + * `podcast` - podcast + * `podcast_episode` - podcast episode + * `video` - video + * `video_playlist` - video playlist + * `document` - document + description: "The type of learning resource \n\n* `course` - course\n\ + * `program` - program\n* `learning_path` - learning path\n* `podcast` -\ + \ podcast\n* `podcast_episode` - podcast episode\n* `video` - video\n* `video_playlist`\ + \ - video playlist\n* `document` - document" + - in: query + name: resource_type_group + schema: + type: array + items: + enum: + - course + - program + - learning_material + type: string + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + - in: query + name: search_mode + schema: + enum: + - phrase + - best_fields + - most_fields + - hybrid + type: string + minLength: 1 + description: "The open search search type for text queries \n\n\ + * `phrase` - phrase\n* `best_fields` - best_fields\n* `most_fields` - most_fields\n\ + * `hybrid` - hybrid\n\n* `phrase` - phrase\n* `best_fields` - best_fields\n\ + * `most_fields` - most_fields\n* `hybrid` - hybrid" + - in: query + name: show_ocw_files + schema: + type: boolean + nullable: true + default: false + description: Whether to include select OCW content files in search results. + - in: query + name: slop + schema: + type: integer + nullable: true + description: Allowed distance for phrase search + - in: query + name: sortby + schema: + enum: + - featured + - id + - -id + - readable_id + - -readable_id + - last_modified + - -last_modified + - new + - start_date + - -start_date + - mitcoursenumber + - -mitcoursenumber + - views + - -views + - upcoming + type: string + minLength: 1 + description: |- + If the parameter starts with '-' the sort is in descending order + + * `featured` - Featured + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + - in: query + name: yearly_decay_percent + schema: + type: number + format: double + maximum: 10 + minimum: 0 + nullable: true + description: Relevance score penalty percent per year for for resources without + upcoming runs. Only affects results if there is a search term. + tags: + - learning_resources_search + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourcesSearchResponse' + description: '' + /api/v2/learning_resources_user_subscription/: + get: + operationId: learning_resources_user_subscription_list + description: View for listing percolate query subscriptions for a user + summary: List subscribed queries + parameters: + - in: query + name: aggregations + schema: + type: array + items: + enum: + - resource_type + - certification + - certification_type + - offered_by + - platform + - topic + - department + - level + - course_feature + - professional + - free + - delivery + - resource_type_group + - resource_category + type: string + description: |- + * `resource_type` - resource_type + * `certification` - certification + * `certification_type` - certification_type + * `offered_by` - offered_by + * `platform` - platform + * `topic` - topic + * `department` - department + * `level` - level + * `course_feature` - course_feature + * `professional` - professional + * `free` - free + * `delivery` - delivery + * `resource_type_group` - resource_type_group + * `resource_category` - resource_category + description: Show resource counts by category + - in: query + name: certification + schema: + type: boolean + nullable: true + description: True if the learning resource offers a certificate + - in: query + name: certification_type + schema: + type: array + items: + enum: + - micromasters + - professional + - completion + - none + type: string + description: |- + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + description: "The type of certificate \n\n* `micromasters` - MicroMasters\ + \ Credential\n* `professional` - Professional Certificate\n* `completion`\ + \ - Certificate of Completion\n* `none` - No Certificate" + - in: query + name: content_file_score_weight + schema: + type: number + format: double + maximum: 1 + minimum: 0 + nullable: true + description: Score weight for content file data. 1 is the default. 0 means + content files are ignored + - in: query + name: course_feature + schema: + type: array + items: + type: string + minLength: 1 + description: The course feature. Possible options are at api/v1/course_features/ + - in: query + name: delivery + schema: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + description: "The delivery options in which the learning resource is offered\ + \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ + \ - In person\n* `offline` - Offline" + - in: query + name: department + schema: + type: array + items: + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + type: string + description: |- + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + description: "The department that offers the learning resource \ + \ \n\n* `1` - Civil and Environmental Engineering\n* `2` - Mechanical Engineering\n\ + * `3` - Materials Science and Engineering\n* `4` - Architecture\n* `5` -\ + \ Chemistry\n* `6` - Electrical Engineering and Computer Science\n* `7`\ + \ - Biology\n* `8` - Physics\n* `9` - Brain and Cognitive Sciences\n* `10`\ + \ - Chemical Engineering\n* `11` - Urban Studies and Planning\n* `12` -\ + \ Earth, Atmospheric, and Planetary Sciences\n* `14` - Economics\n* `15`\ + \ - Management\n* `16` - Aeronautics and Astronautics\n* `17` - Political\ + \ Science\n* `18` - Mathematics\n* `20` - Biological Engineering\n* `21A`\ + \ - Anthropology\n* `21G` - Global Languages\n* `21H` - History\n* `21L`\ + \ - Literature\n* `21M` - Music and Theater Arts\n* `22` - Nuclear Science\ + \ and Engineering\n* `24` - Linguistics and Philosophy\n* `CC` - Concourse\n\ + * `CMS-W` - Comparative Media Studies/Writing\n* `EC` - Edgerton Center\n\ + * `ES` - Experimental Study Group\n* `ESD` - Engineering Systems Division\n\ + * `HST` - Medical Engineering and Science\n* `IDS` - Data, Systems, and\ + \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ + \ Education and Recreation\n* `SP` - Special Programs\n* `STS` - Science,\ + \ Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations + - in: query + name: free + schema: + type: boolean + nullable: true + - in: query + name: id + schema: + type: array + items: + type: integer + description: The id value for the learning resource + - in: query + name: level + schema: + type: array + items: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + type: string + description: |- + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + - in: query + name: limit + schema: + type: integer + description: Number of results to return per page + - in: query + name: max_incompleteness_penalty + schema: + type: number + format: double + maximum: 100 + minimum: 0 + nullable: true + description: Maximum score penalty for incomplete OCW courses in percent. + An OCW course with completeness = 0 will have this score penalty. Partially + complete courses have a linear penalty proportional to the degree of incompleteness. + Only affects results if there is a search term. + - in: query + name: min_score + schema: + type: number + format: double + maximum: 50 + minimum: 0 + nullable: true + description: Minimum score value a text query result needs to have to be displayed + - in: query + name: ocw_topic + schema: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + - in: query + name: offered_by + schema: + type: array + items: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + - in: query + name: offset + schema: + type: integer + description: The initial index from which to return the results + - in: query + name: platform + schema: + type: array + items: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` - Open\ + \ Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` - Bootcamps\n\ + * `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman College of\ + \ Computing\n* `ctl` - Center for Transportation & Logistics\n* `whu` -\ + \ WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n* `simplilearn`\ + \ - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` - Podcast\n* `youtube`\ + \ - YouTube\n* `canvas` - Canvas\n* `climate` - MIT Climate\n* `ovs` - ODL\ + \ Video Service" + - in: query + name: professional + schema: + type: boolean + nullable: true + - in: query + name: q + schema: + type: string + minLength: 1 + description: The search text + - in: query + name: resource_category + schema: + type: array + items: + type: string + minLength: 1 + description: The resource category for the resource + - in: query + name: resource_type + schema: + type: array + items: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning path + * `podcast` - podcast + * `podcast_episode` - podcast episode + * `video` - video + * `video_playlist` - video playlist + * `document` - document + description: "The type of learning resource \n\n* `course` - course\n\ + * `program` - program\n* `learning_path` - learning path\n* `podcast` -\ + \ podcast\n* `podcast_episode` - podcast episode\n* `video` - video\n* `video_playlist`\ + \ - video playlist\n* `document` - document" + - in: query + name: resource_type_group + schema: + type: array + items: + enum: + - course + - program + - learning_material + type: string + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + - in: query + name: search_mode + schema: + enum: + - phrase + - best_fields + - most_fields + - hybrid + type: string + minLength: 1 + description: "The open search search type for text queries \n\n\ + * `phrase` - phrase\n* `best_fields` - best_fields\n* `most_fields` - most_fields\n\ + * `hybrid` - hybrid\n\n* `phrase` - phrase\n* `best_fields` - best_fields\n\ + * `most_fields` - most_fields\n* `hybrid` - hybrid" + - in: query + name: show_ocw_files + schema: + type: boolean + nullable: true + default: false + description: Whether to include select OCW content files in search results. + - in: query + name: slop + schema: + type: integer + nullable: true + description: Allowed distance for phrase search + - in: query + name: sortby + schema: + enum: + - featured + - id + - -id + - readable_id + - -readable_id + - last_modified + - -last_modified + - new + - start_date + - -start_date + - mitcoursenumber + - -mitcoursenumber + - views + - -views + - upcoming + type: string + minLength: 1 + description: |- + If the parameter starts with '-' the sort is in descending order + + * `featured` - Featured + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + - in: query + name: yearly_decay_percent + schema: + type: number + format: double + maximum: 10 + minimum: 0 + nullable: true + description: Relevance score penalty percent per year for for resources without + upcoming runs. Only affects results if there is a search term. + tags: + - learning_resources_user_subscription + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PercolateQuery' + description: '' + /api/v2/learning_resources_user_subscription/{id}/unsubscribe/: + delete: + operationId: learning_resources_user_subscription_unsubscribe_destroy + description: |- + Unsubscribe a user from a query + + Args: + pk (integer): The id of the query + + Returns: + PercolateQuerySerializer: The percolate query + summary: Unsubscribe user from query + parameters: + - in: path + name: id + schema: + type: integer + required: true + tags: + - learning_resources_user_subscription + responses: + '204': + description: No response body + /api/v2/learning_resources_user_subscription/check/: + get: + operationId: learning_resources_user_subscription_check_list + description: View for listing percolate query subscriptions for a user + summary: Check if a user is subscribed to a specific query + parameters: + - in: query + name: aggregations + schema: + type: array + items: + enum: + - resource_type + - certification + - certification_type + - offered_by + - platform + - topic + - department + - level + - course_feature + - professional + - free + - delivery + - resource_type_group + - resource_category + type: string + description: |- + * `resource_type` - resource_type + * `certification` - certification + * `certification_type` - certification_type + * `offered_by` - offered_by + * `platform` - platform + * `topic` - topic + * `department` - department + * `level` - level + * `course_feature` - course_feature + * `professional` - professional + * `free` - free + * `delivery` - delivery + * `resource_type_group` - resource_type_group + * `resource_category` - resource_category + description: Show resource counts by category + - in: query + name: certification + schema: + type: boolean + nullable: true + description: True if the learning resource offers a certificate + - in: query + name: certification_type + schema: + type: array + items: + enum: + - micromasters + - professional + - completion + - none + type: string + description: |- + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + description: "The type of certificate \n\n* `micromasters` - MicroMasters\ + \ Credential\n* `professional` - Professional Certificate\n* `completion`\ + \ - Certificate of Completion\n* `none` - No Certificate" + - in: query + name: content_file_score_weight + schema: + type: number + format: double + maximum: 1 + minimum: 0 + nullable: true + description: Score weight for content file data. 1 is the default. 0 means + content files are ignored + - in: query + name: course_feature + schema: + type: array + items: + type: string + minLength: 1 + description: The course feature. Possible options are at api/v1/course_features/ + - in: query + name: delivery + schema: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + description: "The delivery options in which the learning resource is offered\ + \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ + \ - In person\n* `offline` - Offline" + - in: query + name: department + schema: + type: array + items: + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + type: string + description: |- + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + description: "The department that offers the learning resource \ + \ \n\n* `1` - Civil and Environmental Engineering\n* `2` - Mechanical Engineering\n\ + * `3` - Materials Science and Engineering\n* `4` - Architecture\n* `5` -\ + \ Chemistry\n* `6` - Electrical Engineering and Computer Science\n* `7`\ + \ - Biology\n* `8` - Physics\n* `9` - Brain and Cognitive Sciences\n* `10`\ + \ - Chemical Engineering\n* `11` - Urban Studies and Planning\n* `12` -\ + \ Earth, Atmospheric, and Planetary Sciences\n* `14` - Economics\n* `15`\ + \ - Management\n* `16` - Aeronautics and Astronautics\n* `17` - Political\ + \ Science\n* `18` - Mathematics\n* `20` - Biological Engineering\n* `21A`\ + \ - Anthropology\n* `21G` - Global Languages\n* `21H` - History\n* `21L`\ + \ - Literature\n* `21M` - Music and Theater Arts\n* `22` - Nuclear Science\ + \ and Engineering\n* `24` - Linguistics and Philosophy\n* `CC` - Concourse\n\ + * `CMS-W` - Comparative Media Studies/Writing\n* `EC` - Edgerton Center\n\ + * `ES` - Experimental Study Group\n* `ESD` - Engineering Systems Division\n\ + * `HST` - Medical Engineering and Science\n* `IDS` - Data, Systems, and\ + \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ + \ Education and Recreation\n* `SP` - Special Programs\n* `STS` - Science,\ + \ Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations + - in: query + name: free + schema: + type: boolean + nullable: true + - in: query + name: id + schema: + type: array + items: + type: integer + description: The id value for the learning resource + - in: query + name: level + schema: + type: array + items: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + type: string + description: |- + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + - in: query + name: limit + schema: + type: integer + description: Number of results to return per page + - in: query + name: max_incompleteness_penalty + schema: + type: number + format: double + maximum: 100 + minimum: 0 + nullable: true + description: Maximum score penalty for incomplete OCW courses in percent. + An OCW course with completeness = 0 will have this score penalty. Partially + complete courses have a linear penalty proportional to the degree of incompleteness. + Only affects results if there is a search term. + - in: query + name: min_score + schema: + type: number + format: double + maximum: 50 + minimum: 0 + nullable: true + description: Minimum score value a text query result needs to have to be displayed + - in: query + name: ocw_topic + schema: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + - in: query + name: offered_by + schema: + type: array + items: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + - in: query + name: offset + schema: + type: integer + description: The initial index from which to return the results + - in: query + name: platform + schema: + type: array + items: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` - Open\ + \ Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` - Bootcamps\n\ + * `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman College of\ + \ Computing\n* `ctl` - Center for Transportation & Logistics\n* `whu` -\ + \ WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n* `simplilearn`\ + \ - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` - Podcast\n* `youtube`\ + \ - YouTube\n* `canvas` - Canvas\n* `climate` - MIT Climate\n* `ovs` - ODL\ + \ Video Service" + - in: query + name: professional + schema: + type: boolean + nullable: true + - in: query + name: q + schema: + type: string + minLength: 1 + description: The search text + - in: query + name: resource_category + schema: + type: array + items: + type: string + minLength: 1 + description: The resource category for the resource + - in: query + name: resource_type + schema: + type: array + items: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning path + * `podcast` - podcast + * `podcast_episode` - podcast episode + * `video` - video + * `video_playlist` - video playlist + * `document` - document + description: "The type of learning resource \n\n* `course` - course\n\ + * `program` - program\n* `learning_path` - learning path\n* `podcast` -\ + \ podcast\n* `podcast_episode` - podcast episode\n* `video` - video\n* `video_playlist`\ + \ - video playlist\n* `document` - document" + - in: query + name: resource_type_group + schema: + type: array + items: + enum: + - course + - program + - learning_material + type: string + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + - in: query + name: search_mode + schema: + enum: + - phrase + - best_fields + - most_fields + - hybrid + type: string + minLength: 1 + description: "The open search search type for text queries \n\n\ + * `phrase` - phrase\n* `best_fields` - best_fields\n* `most_fields` - most_fields\n\ + * `hybrid` - hybrid\n\n* `phrase` - phrase\n* `best_fields` - best_fields\n\ + * `most_fields` - most_fields\n* `hybrid` - hybrid" + - in: query + name: show_ocw_files + schema: + type: boolean + nullable: true + default: false + description: Whether to include select OCW content files in search results. + - in: query + name: slop + schema: + type: integer + nullable: true + description: Allowed distance for phrase search + - in: query + name: sortby + schema: + enum: + - featured + - id + - -id + - readable_id + - -readable_id + - last_modified + - -last_modified + - new + - start_date + - -start_date + - mitcoursenumber + - -mitcoursenumber + - views + - -views + - upcoming + type: string + minLength: 1 + description: |- + If the parameter starts with '-' the sort is in descending order + + * `featured` - Featured + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: source_type + schema: + enum: + - search_subscription_type + - channel_subscription_type + type: string + default: search_subscription_type + minLength: 1 + description: |- + The subscription type + + * `search_subscription_type` - search_subscription_type + * `channel_subscription_type` - channel_subscription_type + - in: query + name: topic + schema: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + - in: query + name: yearly_decay_percent + schema: + type: number + format: double + maximum: 10 + minimum: 0 + nullable: true + description: Relevance score penalty percent per year for for resources without + upcoming runs. Only affects results if there is a search term. + tags: + - learning_resources_user_subscription + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PercolateQuery' + description: '' + /api/v2/learning_resources_user_subscription/subscribe/: + post: + operationId: learning_resources_user_subscription_subscribe_create + description: Subscribe a user to query + summary: Subscribe user to query + parameters: + - in: query + name: aggregations + schema: + type: array + items: + enum: + - resource_type + - certification + - certification_type + - offered_by + - platform + - topic + - department + - level + - course_feature + - professional + - free + - delivery + - resource_type_group + - resource_category + type: string + description: |- + * `resource_type` - resource_type + * `certification` - certification + * `certification_type` - certification_type + * `offered_by` - offered_by + * `platform` - platform + * `topic` - topic + * `department` - department + * `level` - level + * `course_feature` - course_feature + * `professional` - professional + * `free` - free + * `delivery` - delivery + * `resource_type_group` - resource_type_group + * `resource_category` - resource_category + description: Show resource counts by category + - in: query + name: certification + schema: + type: boolean + nullable: true + description: True if the learning resource offers a certificate + - in: query + name: certification_type + schema: + type: array + items: + enum: + - micromasters + - professional + - completion + - none + type: string + description: |- + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + description: "The type of certificate \n\n* `micromasters` - MicroMasters\ + \ Credential\n* `professional` - Professional Certificate\n* `completion`\ + \ - Certificate of Completion\n* `none` - No Certificate" + - in: query + name: content_file_score_weight + schema: + type: number + format: double + maximum: 1 + minimum: 0 + nullable: true + description: Score weight for content file data. 1 is the default. 0 means + content files are ignored + - in: query + name: course_feature + schema: + type: array + items: + type: string + minLength: 1 + description: The course feature. Possible options are at api/v1/course_features/ + - in: query + name: delivery + schema: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + description: "The delivery options in which the learning resource is offered\ + \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ + \ - In person\n* `offline` - Offline" + - in: query + name: department + schema: + type: array + items: + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + type: string + description: |- + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + description: "The department that offers the learning resource \ + \ \n\n* `1` - Civil and Environmental Engineering\n* `2` - Mechanical Engineering\n\ + * `3` - Materials Science and Engineering\n* `4` - Architecture\n* `5` -\ + \ Chemistry\n* `6` - Electrical Engineering and Computer Science\n* `7`\ + \ - Biology\n* `8` - Physics\n* `9` - Brain and Cognitive Sciences\n* `10`\ + \ - Chemical Engineering\n* `11` - Urban Studies and Planning\n* `12` -\ + \ Earth, Atmospheric, and Planetary Sciences\n* `14` - Economics\n* `15`\ + \ - Management\n* `16` - Aeronautics and Astronautics\n* `17` - Political\ + \ Science\n* `18` - Mathematics\n* `20` - Biological Engineering\n* `21A`\ + \ - Anthropology\n* `21G` - Global Languages\n* `21H` - History\n* `21L`\ + \ - Literature\n* `21M` - Music and Theater Arts\n* `22` - Nuclear Science\ + \ and Engineering\n* `24` - Linguistics and Philosophy\n* `CC` - Concourse\n\ + * `CMS-W` - Comparative Media Studies/Writing\n* `EC` - Edgerton Center\n\ + * `ES` - Experimental Study Group\n* `ESD` - Engineering Systems Division\n\ + * `HST` - Medical Engineering and Science\n* `IDS` - Data, Systems, and\ + \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ + \ Education and Recreation\n* `SP` - Special Programs\n* `STS` - Science,\ + \ Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations + - in: query + name: free + schema: + type: boolean + nullable: true + - in: query + name: id + schema: + type: array + items: + type: integer + description: The id value for the learning resource + - in: query + name: level + schema: + type: array + items: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + type: string + description: |- + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + - in: query + name: limit + schema: + type: integer + description: Number of results to return per page + - in: query + name: max_incompleteness_penalty + schema: + type: number + format: double + maximum: 100 + minimum: 0 + nullable: true + description: Maximum score penalty for incomplete OCW courses in percent. + An OCW course with completeness = 0 will have this score penalty. Partially + complete courses have a linear penalty proportional to the degree of incompleteness. + Only affects results if there is a search term. + - in: query + name: min_score + schema: + type: number + format: double + maximum: 50 + minimum: 0 + nullable: true + description: Minimum score value a text query result needs to have to be displayed + - in: query + name: ocw_topic + schema: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + - in: query + name: offered_by + schema: + type: array + items: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + - in: query + name: offset + schema: + type: integer + description: The initial index from which to return the results + - in: query + name: platform + schema: + type: array + items: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` - Open\ + \ Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` - Bootcamps\n\ + * `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman College of\ + \ Computing\n* `ctl` - Center for Transportation & Logistics\n* `whu` -\ + \ WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n* `simplilearn`\ + \ - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` - Podcast\n* `youtube`\ + \ - YouTube\n* `canvas` - Canvas\n* `climate` - MIT Climate\n* `ovs` - ODL\ + \ Video Service" + - in: query + name: professional + schema: + type: boolean + nullable: true + - in: query + name: q + schema: + type: string + minLength: 1 + description: The search text + - in: query + name: resource_category + schema: + type: array + items: + type: string + minLength: 1 + description: The resource category for the resource + - in: query + name: resource_type + schema: + type: array + items: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning path + * `podcast` - podcast + * `podcast_episode` - podcast episode + * `video` - video + * `video_playlist` - video playlist + * `document` - document + description: "The type of learning resource \n\n* `course` - course\n\ + * `program` - program\n* `learning_path` - learning path\n* `podcast` -\ + \ podcast\n* `podcast_episode` - podcast episode\n* `video` - video\n* `video_playlist`\ + \ - video playlist\n* `document` - document" + - in: query + name: resource_type_group + schema: + type: array + items: + enum: + - course + - program + - learning_material + type: string + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + - in: query + name: search_mode + schema: + enum: + - phrase + - best_fields + - most_fields + - hybrid + type: string + minLength: 1 + description: "The open search search type for text queries \n\n\ + * `phrase` - phrase\n* `best_fields` - best_fields\n* `most_fields` - most_fields\n\ + * `hybrid` - hybrid\n\n* `phrase` - phrase\n* `best_fields` - best_fields\n\ + * `most_fields` - most_fields\n* `hybrid` - hybrid" + - in: query + name: show_ocw_files + schema: + type: boolean + nullable: true + default: false + description: Whether to include select OCW content files in search results. + - in: query + name: slop + schema: + type: integer + nullable: true + description: Allowed distance for phrase search + - in: query + name: sortby + schema: + enum: + - featured + - id + - -id + - readable_id + - -readable_id + - last_modified + - -last_modified + - new + - start_date + - -start_date + - mitcoursenumber + - -mitcoursenumber + - views + - -views + - upcoming + type: string + minLength: 1 + description: |- + If the parameter starts with '-' the sort is in descending order + + * `featured` - Featured + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: source_type + schema: + enum: + - search_subscription_type + - channel_subscription_type + type: string + default: search_subscription_type + minLength: 1 + description: |- + The subscription type + + * `search_subscription_type` - search_subscription_type + * `channel_subscription_type` - channel_subscription_type + - in: query + name: topic + schema: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + - in: query + name: yearly_decay_percent + schema: + type: number + format: double + maximum: 10 + minimum: 0 + nullable: true + description: Relevance score penalty percent per year for for resources without + upcoming runs. Only affects results if there is a search term. + tags: + - learning_resources_user_subscription + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PercolateQuerySubscriptionRequestRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PercolateQuerySubscriptionRequestRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PercolateQuerySubscriptionRequestRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PercolateQuery' + description: '' + /api/v2/learningpaths/: + get: + operationId: learningpaths_list + description: Get a paginated list of learning paths + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - learningpaths + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningPathResourceList' + description: '' + post: + operationId: learningpaths_create + description: Create a learning path + summary: Create + tags: + - learningpaths + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathResourceRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/LearningPathResourceRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/LearningPathResourceRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathResource' + description: '' + /api/v2/learningpaths/{id}/: + get: + operationId: learningpaths_retrieve + description: Retrive a single learning path + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - learningpaths + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathResource' + description: '' + patch: + operationId: learningpaths_partial_update + description: Update individual fields of a learning path + summary: Update + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - learningpaths + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchedLearningPathResourceRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PatchedLearningPathResourceRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PatchedLearningPathResourceRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathResource' + description: '' + delete: + operationId: learningpaths_destroy + description: Remove a learning path + summary: Destroy + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - learningpaths + responses: + '204': + description: No response body + /api/v2/learningpaths/{learning_resource_id}/items/: + get: + operationId: learningpaths_items_list + description: Viewset for LearningPath related resources + parameters: + - in: path + name: learning_resource_id + schema: + type: integer + description: The learning resource id of the learning path + required: true + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - name: sortby + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + tags: + - learningpaths + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningPathRelationshipList' + description: '' + post: + operationId: learningpaths_items_create + description: Viewset for LearningPath related resources + summary: Learning Path Resource Relationship Add + parameters: + - in: path + name: learning_resource_id + schema: + type: integer + description: The learning resource id of the learning path + required: true + tags: + - learningpaths + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathRelationshipCreateRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/LearningPathRelationshipCreateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/LearningPathRelationshipCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathRelationship' + description: '' + /api/v2/learningpaths/{learning_resource_id}/items/{id}/: + get: + operationId: learningpaths_items_retrieve + description: Get a singe related learning resource for a learning resource. + summary: Nested Learning Resource Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource relationship. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: The learning resource id of the learning path + required: true + tags: + - learningpaths + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathRelationship' + description: '' + patch: + operationId: learningpaths_items_partial_update + description: Viewset for LearningPath related resources + summary: Learning Path Resource Relationship Update + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource relationship. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: The learning resource id of the learning path + required: true + tags: + - learningpaths + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchedLearningPathRelationshipCreateRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PatchedLearningPathRelationshipCreateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PatchedLearningPathRelationshipCreateRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningPathRelationshipCreate' + description: '' + delete: + operationId: learningpaths_items_destroy + description: Viewset for LearningPath related resources + summary: Learning Path Resource Relationship Remove + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource relationship. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: The learning resource id of the learning path + required: true + tags: + - learningpaths + responses: + '204': + description: No response body + /api/v2/learningpaths/membership/: + get: + operationId: learningpaths_membership_list + description: Get a list of all learning path items + summary: List + tags: + - learningpaths + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MicroLearningPathRelationship' + description: '' + /api/v2/offerors/: + get: + operationId: offerors_list + description: MIT organizations that offer learning resources + summary: List + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - offerors + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceOfferorDetailList' + description: '' + /api/v2/offerors/{code}/: + get: + operationId: offerors_retrieve + description: MIT organizations that offer learning resources + summary: Retrieve + parameters: + - in: path + name: code + schema: + type: string + description: A unique value identifying this learning resource offeror. + required: true + tags: + - offerors + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceOfferorDetail' + description: '' + /api/v2/platforms/: + get: + operationId: platforms_list + description: Platforms on which learning resources are hosted + summary: List + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - platforms + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourcePlatformList' + description: '' + /api/v2/platforms/{code}/: + get: + operationId: platforms_retrieve + description: Platforms on which learning resources are hosted + summary: Retrieve + parameters: + - in: path + name: code + schema: + type: string + description: A unique value identifying this learning resource platform. + required: true + tags: + - platforms + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourcePlatform' + description: '' + /api/v2/podcast_episodes/: + get: + operationId: podcast_episodes_list + description: Get a paginated list of podcast episodes + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - podcast_episodes + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPodcastEpisodeResourceList' + description: '' + /api/v2/podcast_episodes/{id}/: + get: + operationId: podcast_episodes_retrieve + description: Retrieve a single podcast episode + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - podcast_episodes + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PodcastEpisodeResource' + description: '' + /api/v2/podcasts/: + get: + operationId: podcasts_list + description: Get a paginated list of podcasts + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - podcasts + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPodcastResourceList' + description: '' + /api/v2/podcasts/{id}/: + get: + operationId: podcasts_retrieve + description: Retrieve a single podcast + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - podcasts + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PodcastResource' + description: '' + /api/v2/podcasts/{learning_resource_id}/items/: + get: + operationId: podcasts_items_list + description: Get a list of related learning resources for a learning resource. + summary: Nested Learning Resource List + parameters: + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - name: sortby + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + tags: + - podcasts + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceRelationshipList' + description: '' + /api/v2/podcasts/{learning_resource_id}/items/{id}/: + get: + operationId: podcasts_items_retrieve + description: Get a singe related learning resource for a learning resource. + summary: Nested Learning Resource Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource relationship. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + tags: + - podcasts + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceRelationship' + description: '' + /api/v2/programs/: + get: + operationId: programs_list + description: Get a paginated list of programs + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - programs + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedProgramResourceList' + description: '' + /api/v2/programs/{id}/: + get: + operationId: programs_retrieve + description: Retrieve a single program + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - programs + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProgramResource' + description: '' + /api/v2/schools/: + get: + operationId: schools_list + description: MIT schools + summary: List + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - schools + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceSchoolList' + description: '' + /api/v2/schools/{id}/: + get: + operationId: schools_retrieve + description: MIT schools + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource school. + required: true + tags: + - schools + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceSchool' + description: '' + /api/v2/topics/: + get: + operationId: topics_list + description: Topics covered by learning resources + summary: List + parameters: + - in: query + name: is_toplevel + schema: + type: boolean + description: Filter top-level topics + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: name + schema: + type: array + items: + type: string + description: Topic name + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: parent_topic_id + schema: + type: array + items: + type: number + description: Parent topic ID + explode: true + style: form + tags: + - topics + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceTopicList' + description: '' + /api/v2/topics/{id}/: + get: + operationId: topics_retrieve + description: Topics covered by learning resources + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource topic. + required: true + tags: + - topics + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceTopic' + description: '' + /api/v2/userlists/: + get: + operationId: userlists_list + description: Viewset for UserLists + summary: List + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - userlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedUserListList' + description: '' + post: + operationId: userlists_create + description: Viewset for UserLists + summary: Create + tags: + - userlists + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserListRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/UserListRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/UserListRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/UserList' + description: '' + /api/v2/userlists/{id}/: + get: + operationId: userlists_retrieve + description: Viewset for UserLists + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this user list. + required: true + tags: + - userlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserList' + description: '' + patch: + operationId: userlists_partial_update + description: Viewset for UserLists + summary: Update + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this user list. + required: true + tags: + - userlists + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchedUserListRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PatchedUserListRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PatchedUserListRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserList' + description: '' + delete: + operationId: userlists_destroy + description: Viewset for UserLists + summary: Destroy + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this user list. + required: true + tags: + - userlists + responses: + '204': + description: No response body + /api/v2/userlists/{userlist_id}/items/: + get: + operationId: userlists_items_list + description: Viewset for UserListRelationships + summary: User List Resources List + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: path + name: userlist_id + schema: + type: integer + description: id of the parent user list + required: true + tags: + - userlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedUserListRelationshipList' + description: '' + post: + operationId: userlists_items_create + description: Viewset for UserListRelationships + summary: User List Resource Relationship Add + parameters: + - in: path + name: userlist_id + schema: + type: integer + description: id of the parent user list + required: true + tags: + - userlists + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserListRelationshipRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/UserListRelationshipRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/UserListRelationshipRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/UserListRelationship' + description: '' + /api/v2/userlists/{userlist_id}/items/{id}/: + get: + operationId: userlists_items_retrieve + description: Viewset for UserListRelationships + summary: User List Resources Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this user list relationship. + required: true + - in: path + name: userlist_id + schema: + type: integer + description: id of the parent user list + required: true + tags: + - userlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserListRelationship' + description: '' + patch: + operationId: userlists_items_partial_update + description: Viewset for UserListRelationships + summary: User List Resource Relationship Update + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this user list relationship. + required: true + - in: path + name: userlist_id + schema: + type: integer + description: id of the parent user list + required: true + tags: + - userlists + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchedUserListRelationshipRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PatchedUserListRelationshipRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/PatchedUserListRelationshipRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserListRelationship' + description: '' + delete: + operationId: userlists_items_destroy + description: Viewset for UserListRelationships + summary: User List Resource Relationship Remove + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this user list relationship. + required: true + - in: path + name: userlist_id + schema: + type: integer + description: id of the parent user list + required: true + tags: + - userlists + responses: + '204': + description: No response body + /api/v2/userlists/membership/: + get: + operationId: userlists_membership_list + description: Get a list of all userlist items for a user + summary: List + tags: + - userlists + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MicroUserListRelationship' + description: '' + /api/v2/video_playlists/: + get: + operationId: video_playlists_list + description: Get a paginated list of video playlists + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - video_playlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedVideoPlaylistResourceList' + description: '' + /api/v2/video_playlists/{id}/: + get: + operationId: video_playlists_retrieve + description: Retrieve a single video playlist + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - video_playlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VideoPlaylistResource' + description: '' + /api/v2/video_playlists/{learning_resource_id}/items/: + get: + operationId: video_playlists_items_list + description: Get a list of related learning resources for a learning resource. + summary: Nested Learning Resource List + parameters: + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - name: sortby + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + tags: + - video_playlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLearningResourceRelationshipList' + description: '' + /api/v2/video_playlists/{learning_resource_id}/items/{id}/: + get: + operationId: video_playlists_items_retrieve + description: Get a singe related learning resource for a learning resource. + summary: Nested Learning Resource Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource relationship. + required: true + - in: path + name: learning_resource_id + schema: + type: integer + description: id of the parent learning resource + required: true + tags: + - video_playlists + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LearningResourceRelationship' + description: '' + /api/v2/videos/: + get: + operationId: videos_list + description: Get a paginated list of videos + summary: List + parameters: + - in: query + name: certification + schema: + type: boolean + - in: query + name: certification_type + schema: + type: array + items: + type: string + enum: + - completion + - micromasters + - none + - professional + description: |- + The type of certification offered + + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + explode: true + style: form + - in: query + name: course_feature + schema: + type: array + items: + type: string + description: Content feature for the resources. Load the 'api/v1/course_features' + endpoint for a list of course features + explode: true + style: form + - in: query + name: delivery + schema: + type: array + items: + type: array + items: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + enum: + - hybrid + - in_person + - offline + - online + description: |- + The delivery of course/program resources + + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + explode: true + style: form + - in: query + name: department + schema: + type: array + items: + type: string + enum: + - '1' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '2' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + description: |- + The department that offers learning resources + + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + explode: true + style: form + - in: query + name: free + schema: + type: boolean + description: The course/program is offered for free + - in: query + name: level + schema: + type: array + items: + type: string + enum: + - advanced + - graduate + - high_school + - intermediate + - introductory + - noncredit + - undergraduate + description: |- + The academic level of the resources + + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + explode: true + style: form + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - in: query + name: offered_by + schema: + type: array + items: + type: string + enum: + - bootcamps + - climate + - mitpe + - mitx + - ocw + - see + - xpro + description: |- + The organization that offers a learning resource + + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + explode: true + style: form + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: platform + schema: + type: array + items: + type: string + enum: + - bootcamps + - canvas + - climate + - csail + - ctl + - edx + - emeritus + - globalalumni + - mitpe + - mitxonline + - ocw + - oll + - ovs + - podcast + - scc + - see + - simplilearn + - susskind + - whu + - xpro + - youtube + description: |- + The platform on which learning resources are offered + + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + explode: true + style: form + - in: query + name: professional + schema: + type: boolean + - in: query + name: readable_id + schema: + type: array + items: + type: string + description: A unique text identifier for the resources + explode: true + style: form + - in: query + name: resource_id + schema: + type: array + items: + type: integer + description: Comma-separated list of learning resource IDs + explode: true + style: form + - in: query + name: resource_type + schema: + type: array + items: + type: string + enum: + - course + - document + - learning_path + - podcast + - podcast_episode + - program + - video + - video_playlist + description: |- + The type of learning resource + + * `course` - Course + * `program` - Program + * `learning_path` - Learning Path + * `podcast` - Podcast + * `podcast_episode` - Podcast Episode + * `video` - Video + * `video_playlist` - Video Playlist + * `document` - Document + explode: true + style: form + - in: query + name: resource_type_group + schema: + type: array + items: + type: string + enum: + - course + - learning_material + - program + description: |- + The resource type group of the learning resources + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + explode: true + style: form + - in: query + name: sortby + schema: + type: string + enum: + - -id + - -last_modified + - -mitcoursenumber + - -readable_id + - -start_date + - -views + - id + - last_modified + - mitcoursenumber + - new + - readable_id + - start_date + - upcoming + - views + description: |- + Sort By + + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + - in: query + name: topic + schema: + type: array + items: + type: string + description: Topics covered by the resources. Load the '/api/v1/topics' endpoint + for a list of topics + explode: true + style: form + tags: + - videos + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedVideoResourceList' + description: '' + /api/v2/videos/{id}/: + get: + operationId: videos_retrieve + description: Retrieve a single video + summary: Retrieve + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this learning resource. + required: true + tags: + - videos + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VideoResource' + description: '' +components: + schemas: + AggregationsEnum: + enum: + - resource_type + - certification + - certification_type + - offered_by + - platform + - topic + - department + - level + - course_feature + - professional + - free + - delivery + - resource_type_group + - resource_category + type: string + description: |- + * `resource_type` - resource_type + * `certification` - certification + * `certification_type` - certification_type + * `offered_by` - offered_by + * `platform` - platform + * `topic` - topic + * `department` - department + * `level` - level + * `course_feature` - course_feature + * `professional` - professional + * `free` - free + * `delivery` - delivery + * `resource_type_group` - resource_type_group + * `resource_category` - resource_category + x-enum-descriptions: + - resource_type + - certification + - certification_type + - offered_by + - platform + - topic + - department + - level + - course_feature + - professional + - free + - delivery + - resource_type_group + - resource_category + AvailabilityEnum: + enum: + - dated + - anytime + type: string + description: |- + * `dated` - Dated + * `anytime` - Anytime + x-enum-descriptions: + - Dated + - Anytime + CaptionUrl: + type: object + description: Serializer for caption URL entries + properties: + language: + type: string + language_name: + type: string + url: + type: string + format: uri + word_count: + type: integer + readOnly: true + required: + - language + - language_name + - url + - word_count + CaptionUrlRequest: + type: object + description: Serializer for caption URL entries + properties: + language: + type: string + minLength: 1 + language_name: + type: string + minLength: 1 + url: + type: string + format: uri + minLength: 1 + required: + - language + - language_name + - url + CertificationTypeEnum: + enum: + - micromasters + - professional + - completion + - none + type: string + description: |- + * `micromasters` - MicroMasters Credential + * `professional` - Professional Certificate + * `completion` - Certificate of Completion + * `none` - No Certificate + x-enum-descriptions: + - MicroMasters Credential + - Professional Certificate + - Certificate of Completion + - No Certificate + ContentFile: + type: object + description: Serializer class for course run ContentFiles + properties: + id: + type: integer + readOnly: true + run_id: + type: integer + direct_learning_resource_id: + type: integer + nullable: true + run_title: + type: string + run_slug: + type: string + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + semester: + type: string + year: + type: integer + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + readOnly: true + key: + type: string + nullable: true + maxLength: 1024 + uid: + type: string + nullable: true + maxLength: 36 + title: + type: string + nullable: true + maxLength: 1024 + description: + type: string + nullable: true + require_summaries: + type: boolean + readOnly: true + url: + type: string + nullable: true + content_feature_type: + type: array + items: + type: string + content_type: + $ref: '#/components/schemas/ContentTypeEnum' + content: + type: string + nullable: true + content_title: + type: string + nullable: true + maxLength: 1024 + content_author: + type: string + nullable: true + maxLength: 1024 + content_language: + type: string + nullable: true + maxLength: 24 + checksum: + type: string + image_src: + type: string + format: uri + nullable: true + maxLength: 200 + resource_id: + type: string + readOnly: true + resource_readable_id: + type: string + readOnly: true + source_path: + type: string + course_number: + type: array + items: + type: string + description: Extract the course number(s) from the associated course + readOnly: true + file_type: + type: string + nullable: true + maxLength: 128 + file_extension: + type: string + nullable: true + maxLength: 32 + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + run_readable_id: + type: string + edx_module_id: + type: string + nullable: true + maxLength: 1024 + summary: + type: string + flashcards: {} + youtube_id: + type: string + nullable: true + maxLength: 32 + required: + - content_feature_type + - course_number + - departments + - id + - offered_by + - platform + - require_summaries + - resource_id + - resource_readable_id + - topics + ContentFileSearchResponse: + type: object + description: SearchResponseSerializer with OpenAPI annotations for Content Files + search + properties: + count: + type: integer + readOnly: true + next: + type: string + nullable: true + readOnly: true + previous: + type: string + nullable: true + readOnly: true + results: + type: array + items: + $ref: '#/components/schemas/ContentFile' + readOnly: true + metadata: + type: object + properties: + aggregations: + type: object + additionalProperties: + type: array + items: + type: object + properties: + key: + type: string + doc_count: + type: integer + required: + - doc_count + - key + suggestions: + type: array + items: + type: string + required: + - aggregations + - suggestions + readOnly: true + required: + - count + - metadata + - next + - previous + - results + ContentTypeEnum: + enum: + - page + - file + - video + - pdf + type: string + description: |- + * `page` - page + * `file` - file + * `video` - video + * `pdf` - pdf + x-enum-descriptions: + - page + - file + - video + - pdf + Course: + type: object + description: Serializer for the Course model + properties: + course_numbers: + type: array + items: + $ref: '#/components/schemas/CourseNumber' + nullable: true + credits_earned: + type: number + format: double + nullable: true + required: + - course_numbers + CourseNumber: + type: object + description: Serializer for CourseNumber + properties: + value: + type: string + department: + $ref: '#/components/schemas/LearningResourceDepartment' + listing_type: + type: string + required: + - department + - listing_type + - value + CourseNumberRequest: + type: object + description: Serializer for CourseNumber + properties: + value: + type: string + minLength: 1 + department: + $ref: '#/components/schemas/LearningResourceDepartmentRequest' + listing_type: + type: string + minLength: 1 + required: + - department + - listing_type + - value + CourseRequest: + type: object + description: Serializer for the Course model + properties: + course_numbers: + type: array + items: + $ref: '#/components/schemas/CourseNumberRequest' + nullable: true + credits_earned: + type: number + format: double + nullable: true + required: + - course_numbers + CourseResource: + type: object + description: Serializer for course resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/CourseResourceResourceTypeEnum' + default: course + readOnly: true + course: + allOf: + - $ref: '#/components/schemas/Course' + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + resource_category: + type: string + readOnly: true + description: The display category for this resource. + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - course + - course_feature + - delivery + - departments + - format + - free + - id + - image + - offered_by + - pace + - platform + - position + - prices + - professional + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - views + CourseResourceRequest: + type: object + description: Serializer for course resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + CourseResourceResourceTypeEnum: + type: string + enum: + - course + DeliveryEnum: + enum: + - online + - hybrid + - in_person + - offline + type: string + description: |- + * `online` - Online + * `hybrid` - Hybrid + * `in_person` - In person + * `offline` - Offline + x-enum-descriptions: + - Online + - Hybrid + - In person + - Offline + DepartmentEnum: + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10' + - '11' + - '12' + - '14' + - '15' + - '16' + - '17' + - '18' + - '20' + - 21A + - 21G + - 21H + - 21L + - 21M + - '22' + - '24' + - CC + - CMS-W + - EC + - ES + - ESD + - HST + - IDS + - MAS + - PE + - SP + - STS + - WGS + type: string + description: |- + * `1` - Civil and Environmental Engineering + * `2` - Mechanical Engineering + * `3` - Materials Science and Engineering + * `4` - Architecture + * `5` - Chemistry + * `6` - Electrical Engineering and Computer Science + * `7` - Biology + * `8` - Physics + * `9` - Brain and Cognitive Sciences + * `10` - Chemical Engineering + * `11` - Urban Studies and Planning + * `12` - Earth, Atmospheric, and Planetary Sciences + * `14` - Economics + * `15` - Management + * `16` - Aeronautics and Astronautics + * `17` - Political Science + * `18` - Mathematics + * `20` - Biological Engineering + * `21A` - Anthropology + * `21G` - Global Languages + * `21H` - History + * `21L` - Literature + * `21M` - Music and Theater Arts + * `22` - Nuclear Science and Engineering + * `24` - Linguistics and Philosophy + * `CC` - Concourse + * `CMS-W` - Comparative Media Studies/Writing + * `EC` - Edgerton Center + * `ES` - Experimental Study Group + * `ESD` - Engineering Systems Division + * `HST` - Medical Engineering and Science + * `IDS` - Data, Systems, and Society + * `MAS` - Media Arts and Sciences + * `PE` - Athletics, Physical Education and Recreation + * `SP` - Special Programs + * `STS` - Science, Technology, and Society + * `WGS` - Women's and Gender Studies + x-enum-descriptions: + - Civil and Environmental Engineering + - Mechanical Engineering + - Materials Science and Engineering + - Architecture + - Chemistry + - Electrical Engineering and Computer Science + - Biology + - Physics + - Brain and Cognitive Sciences + - Chemical Engineering + - Urban Studies and Planning + - Earth, Atmospheric, and Planetary Sciences + - Economics + - Management + - Aeronautics and Astronautics + - Political Science + - Mathematics + - Biological Engineering + - Anthropology + - Global Languages + - History + - Literature + - Music and Theater Arts + - Nuclear Science and Engineering + - Linguistics and Philosophy + - Concourse + - Comparative Media Studies/Writing + - Edgerton Center + - Experimental Study Group + - Engineering Systems Division + - Medical Engineering and Science + - Data, Systems, and Society + - Media Arts and Sciences + - Athletics, Physical Education and Recreation + - Special Programs + - Science, Technology, and Society + - Women's and Gender Studies + DocumentResource: + type: object + description: Serializer for document resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/DocumentResourceResourceTypeEnum' + default: document + readOnly: true + content_files: + type: array + items: + $ref: '#/components/schemas/ContentFile' + nullable: true + readOnly: true + description: + type: string + nullable: true + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + resource_category: + type: string + readOnly: true + description: The display category for this resource. + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - content_files + - course_feature + - delivery + - departments + - description + - format + - free + - id + - image + - offered_by + - pace + - platform + - position + - prices + - professional + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - views + DocumentResourceRequest: + type: object + description: Serializer for document resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + DocumentResourceResourceTypeEnum: + type: string + enum: + - document + LearningPath: + type: object + description: Serializer for the LearningPath model + properties: + id: + type: integer + readOnly: true + item_count: + type: integer + description: Return the number of items in the list + readOnly: true + required: + - id + - item_count + LearningPathRelationship: + type: object + description: Specialized serializer for a LearningPath relationship + properties: + id: + type: integer + readOnly: true + resource: + allOf: + - $ref: '#/components/schemas/LearningResource' + readOnly: true + position: + type: integer + maximum: 2147483647 + minimum: 0 + parent: + type: integer + child: + type: integer + required: + - child + - id + - parent + - resource + LearningPathRelationshipCreate: + type: object + description: |- + Create serializer for nested learning path items. + + The parent is derived from the nested route and must not be client-supplied. + properties: + id: + type: integer + readOnly: true + resource: + allOf: + - $ref: '#/components/schemas/LearningResource' + readOnly: true + position: + type: integer + maximum: 2147483647 + minimum: 0 + parent: + type: integer + readOnly: true + child: + type: integer + required: + - child + - id + - parent + - resource + LearningPathRelationshipCreateRequest: + type: object + description: |- + Create serializer for nested learning path items. + + The parent is derived from the nested route and must not be client-supplied. + properties: + position: + type: integer + maximum: 2147483647 + minimum: 0 + child: + type: integer + required: + - child + LearningPathResource: + type: object + description: CRUD serializer for LearningPath resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/LearningPathResourceResourceTypeEnum' + default: learning_path + readOnly: true + resource_category: + type: string + description: The display category for this resource. + readOnly: true + default: Learning Path + learning_path: + allOf: + - $ref: '#/components/schemas/LearningPath' + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - course_feature + - delivery + - departments + - format + - free + - id + - image + - learning_path + - offered_by + - pace + - platform + - position + - prices + - professional + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - views + LearningPathResourceRequest: + type: object + description: CRUD serializer for LearningPath resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + LearningPathResourceResourceTypeEnum: + type: string + enum: + - learning_path + LearningResource: + oneOf: + - $ref: '#/components/schemas/ProgramResource' + - $ref: '#/components/schemas/CourseResource' + - $ref: '#/components/schemas/LearningPathResource' + - $ref: '#/components/schemas/PodcastResource' + - $ref: '#/components/schemas/PodcastEpisodeResource' + - $ref: '#/components/schemas/VideoPlaylistResource' + - $ref: '#/components/schemas/VideoResource' + - $ref: '#/components/schemas/DocumentResource' + discriminator: + propertyName: resource_type + mapping: + program: '#/components/schemas/ProgramResource' + course: '#/components/schemas/CourseResource' + learning_path: '#/components/schemas/LearningPathResource' + podcast: '#/components/schemas/PodcastResource' + podcast_episode: '#/components/schemas/PodcastEpisodeResource' + video_playlist: '#/components/schemas/VideoPlaylistResource' + video: '#/components/schemas/VideoResource' + document: '#/components/schemas/DocumentResource' + LearningResourceBaseDepartment: + type: object + description: |- + Serializer for LearningResourceDepartment, minus school + + The absence of the departments list is to avoid a circular serialization structure. + properties: + department_id: + type: string + maxLength: 6 + name: + type: string + maxLength: 256 + url: + type: string + readOnly: true + nullable: true + required: + - department_id + - name + - url + LearningResourceBaseSchool: + type: object + description: |- + Base serializer for LearningResourceSchool model, minus departments list + + The absence of the departments list is to avoid a circular serialization structure. + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 256 + url: + type: string + format: uri + maxLength: 200 + required: + - id + - name + - url + LearningResourceBaseSchoolRequest: + type: object + description: |- + Base serializer for LearningResourceSchool model, minus departments list + + The absence of the departments list is to avoid a circular serialization structure. + properties: + name: + type: string + minLength: 1 + maxLength: 256 + url: + type: string + format: uri + minLength: 1 + maxLength: 200 + required: + - name + - url + LearningResourceContentTag: + type: object + description: Serializer for LearningResourceContentTag + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 128 + required: + - id + - name + LearningResourceDepartment: + type: object + description: Full serializer for LearningResourceDepartment, including school + properties: + department_id: + type: string + maxLength: 6 + name: + type: string + maxLength: 256 + url: + type: string + readOnly: true + nullable: true + school: + allOf: + - $ref: '#/components/schemas/LearningResourceBaseSchool' + readOnly: true + nullable: true + required: + - department_id + - name + - school + - url + LearningResourceDepartmentRequest: + type: object + description: Full serializer for LearningResourceDepartment, including school + properties: + department_id: + type: string + minLength: 1 + maxLength: 6 + name: + type: string + minLength: 1 + maxLength: 256 + required: + - department_id + - name + LearningResourceDisplayInfoResponse: + type: object + description: Serializer for the response of the display info endpoint + properties: + title: + type: string + readOnly: true + description: Title + description: + type: string + readOnly: true + description: Description + full_description: + type: string + readOnly: true + nullable: true + description: Full Description + url: + type: string + readOnly: true + description: Website + free: + type: boolean + readOnly: true + nullable: true + description: Free + topics: + type: array + items: + type: string + readOnly: true + description: Topics + price: + type: string + readOnly: true + nullable: true + description: Price + extra_price_info: + type: string + readOnly: true + nullable: true + description: Extra Price Information + certification: + type: string + readOnly: true + nullable: true + description: Certificate + instructors: + type: array + items: + type: string + readOnly: true + nullable: true + description: Instructors + runs: + type: array + items: + type: object + properties: + location: + type: string + start_date: + type: string + instructors: + type: array + items: + type: string + duration: + type: string + price: + type: string + format: + type: array + items: + type: string + required: + - code + - name + readOnly: true + nullable: true + description: Runs/Sessions + offered_by: + type: string + readOnly: true + nullable: true + description: Offered By + languages: + type: array + items: + type: string + readOnly: true + nullable: true + description: Languages + levels: + type: array + items: + type: string + readOnly: true + nullable: true + description: Levels + departments: + type: array + items: + type: string + readOnly: true + description: Departments + platform: + type: string + readOnly: true + nullable: true + description: Platform + number_of_courses: + type: number + readOnly: true + nullable: true + description: Number of Courses + number_of_programs: + type: number + readOnly: true + nullable: true + description: Number of Programs + program_courses: + type: array + items: + $ref: '#/components/schemas/ResourceChildSummary' + readOnly: true + nullable: true + description: Child courses and programs included in this learning resource + location: + type: string + readOnly: true + nullable: true + description: Location + starts: + type: array + items: + type: string + readOnly: true + nullable: true + description: Starts + format_type: + type: array + items: + type: string + readOnly: true + nullable: true + description: Format + as_taught_in: + type: array + items: + type: string + readOnly: true + nullable: true + description: As Taught In + duration: + type: string + readOnly: true + nullable: true + description: Duration + id: + type: integer + required: + - as_taught_in + - certification + - departments + - description + - duration + - extra_price_info + - format_type + - free + - full_description + - id + - instructors + - languages + - levels + - location + - number_of_courses + - number_of_programs + - offered_by + - platform + - price + - program_courses + - runs + - starts + - title + - topics + - url + LearningResourceImage: + type: object + description: Serializer for LearningResourceImage + properties: + id: + type: integer + readOnly: true + url: + type: string + maxLength: 2048 + description: + type: string + nullable: true + maxLength: 1024 + alt: + type: string + nullable: true + maxLength: 1024 + required: + - id + - url + LearningResourceImageRequest: + type: object + description: Serializer for LearningResourceImage + properties: + url: + type: string + minLength: 1 + maxLength: 2048 + description: + type: string + nullable: true + maxLength: 1024 + alt: + type: string + nullable: true + maxLength: 1024 + required: + - url + LearningResourceInstructor: + type: object + description: Serializer for LearningResourceInstructor model + properties: + id: + type: integer + readOnly: true + first_name: + type: string + nullable: true + maxLength: 128 + last_name: + type: string + nullable: true + maxLength: 128 + full_name: + type: string + nullable: true + maxLength: 256 + required: + - id + LearningResourceInstructorRequest: + type: object + description: Serializer for LearningResourceInstructor model + properties: + first_name: + type: string + nullable: true + maxLength: 128 + last_name: + type: string + nullable: true + maxLength: 128 + full_name: + type: string + nullable: true + maxLength: 256 + LearningResourceOfferor: + type: object + description: Serializer for LearningResourceOfferor with basic details + properties: + code: + type: string + maxLength: 12 + name: + type: string + maxLength: 256 + channel_url: + type: string + readOnly: true + nullable: true + display_facet: + type: boolean + required: + - channel_url + - code + - name + LearningResourceOfferorDetail: + type: object + description: Serializer for LearningResourceOfferor with all details + properties: + code: + type: string + maxLength: 12 + channel_url: + type: string + readOnly: true + nullable: true + name: + type: string + maxLength: 256 + professional: + type: boolean + offerings: + type: array + items: + type: string + maxLength: 128 + audience: + type: array + items: + type: string + maxLength: 128 + formats: + type: array + items: + type: string + maxLength: 128 + fee: + type: array + items: + type: string + maxLength: 128 + certifications: + type: array + items: + type: string + maxLength: 128 + content_types: + type: array + items: + type: string + maxLength: 128 + more_information: + type: string + format: uri + maxLength: 200 + value_prop: + type: string + display_facet: + type: boolean + required: + - channel_url + - code + - name + LearningResourceOfferorRequest: + type: object + description: Serializer for LearningResourceOfferor with basic details + properties: + code: + type: string + minLength: 1 + maxLength: 12 + name: + type: string + minLength: 1 + maxLength: 256 + display_facet: + type: boolean + required: + - code + - name + LearningResourcePlatform: + type: object + description: Serializer for LearningResourcePlatform + properties: + code: + type: string + maxLength: 12 + name: + type: string + maxLength: 256 + required: + - code + LearningResourcePlatformRequest: + type: object + description: Serializer for LearningResourcePlatform + properties: + code: + type: string + minLength: 1 + maxLength: 12 + name: + type: string + minLength: 1 + maxLength: 256 + required: + - code + LearningResourcePrice: + type: object + description: Serializer for LearningResourcePrice model + properties: + amount: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + currency: + type: string + maxLength: 3 + required: + - amount + - currency + LearningResourcePriceRequest: + type: object + description: Serializer for LearningResourcePrice model + properties: + amount: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + currency: + type: string + minLength: 1 + maxLength: 3 + required: + - amount + - currency + LearningResourceRelationship: + type: object + description: CRUD serializer for LearningResourceRelationship + properties: + id: + type: integer + readOnly: true + resource: + allOf: + - $ref: '#/components/schemas/LearningResource' + readOnly: true + position: + type: integer + maximum: 2147483647 + minimum: 0 + relation_type: + $ref: '#/components/schemas/RelationTypeEnum' + parent: + type: integer + child: + type: integer + required: + - child + - id + - parent + - resource + LearningResourceRelationshipChildField: + type: object + description: |- + Serializer field for the LearningResourceRelationship model that uses + the LearningResourceSerializer to serialize the child resources + properties: + child: + type: integer + position: + type: integer + maximum: 2147483647 + minimum: 0 + relation_type: + $ref: '#/components/schemas/RelationTypeEnum' + title: + type: string + readOnly: true + readable_id: + type: string + readOnly: true + required: + - child + - readable_id + - title + LearningResourceRequest: + oneOf: + - $ref: '#/components/schemas/ProgramResourceRequest' + - $ref: '#/components/schemas/CourseResourceRequest' + - $ref: '#/components/schemas/LearningPathResourceRequest' + - $ref: '#/components/schemas/PodcastResourceRequest' + - $ref: '#/components/schemas/PodcastEpisodeResourceRequest' + - $ref: '#/components/schemas/VideoPlaylistResourceRequest' + - $ref: '#/components/schemas/VideoResourceRequest' + - $ref: '#/components/schemas/DocumentResourceRequest' + discriminator: + propertyName: resource_type + mapping: + program: '#/components/schemas/ProgramResourceRequest' + course: '#/components/schemas/CourseResourceRequest' + learning_path: '#/components/schemas/LearningPathResourceRequest' + podcast: '#/components/schemas/PodcastResourceRequest' + podcast_episode: '#/components/schemas/PodcastEpisodeResourceRequest' + video_playlist: '#/components/schemas/VideoPlaylistResourceRequest' + video: '#/components/schemas/VideoResourceRequest' + document: '#/components/schemas/DocumentResourceRequest' + LearningResourceRun: + type: object + description: Serializer for the LearningResourceRun model + properties: + id: + type: integer + readOnly: true + instructors: + type: array + items: + $ref: '#/components/schemas/LearningResourceInstructor' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + readOnly: true + nullable: true + level: + type: array + items: + type: object + properties: + code: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + name: + type: string + required: + - code + - name + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + enrollment_url: + type: string + nullable: true + description: Return a URL for enrollment, derived from the run URL. + readOnly: true + run_id: + type: string + maxLength: 128 + title: + type: string + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + slug: + type: string + nullable: true + maxLength: 1024 + semester: + type: string + nullable: true + maxLength: 20 + year: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + start_date: + type: string + format: date-time + nullable: 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 + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + nullable: true + checksum: + type: string + nullable: true + maxLength: 32 + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - delivery + - enrollment_url + - format + - id + - image + - instructors + - level + - pace + - resource_prices + - run_id + - title + LearningResourceRunRequest: + type: object + description: Serializer for the LearningResourceRun model + properties: + level: + type: array + items: + type: object + properties: + code: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + name: + type: string + required: + - code + - name + run_id: + type: string + minLength: 1 + maxLength: 128 + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + slug: + type: string + nullable: true + maxLength: 1024 + semester: + type: string + nullable: true + maxLength: 20 + year: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + start_date: + type: string + format: date-time + nullable: 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 + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + nullable: true + checksum: + type: string + nullable: true + maxLength: 32 + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - level + - run_id + - title + LearningResourceSchool: + type: object + description: Serializer for LearningResourceSchool model, including list of + departments + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 256 + url: + type: string + format: uri + maxLength: 200 + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceBaseDepartment' + required: + - departments + - id + - name + - url + LearningResourceSummary: + type: object + description: |- + Minimal serializer for LearningResource - returns only essential fields + for sitemap generation and other use cases requiring minimal data transfer. + properties: + id: + type: integer + readOnly: true + last_modified: + type: string + format: date-time + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + required: + - id + LearningResourceTopic: + type: object + description: Serializer for LearningResourceTopic model + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 128 + icon: + type: string + description: The icon to display for the topic. + maxLength: 128 + parent: + type: integer + nullable: true + channel_url: + type: string + readOnly: true + nullable: true + required: + - channel_url + - id + - name + LearningResourcesSearchResponse: + type: object + description: |- + SearchResponseSerializer with OpenAPI annotations for Learning Resources + search + properties: + count: + type: integer + readOnly: true + next: + type: string + nullable: true + readOnly: true + previous: + type: string + nullable: true + readOnly: true + results: + type: array + items: + $ref: '#/components/schemas/LearningResource' + readOnly: true + metadata: + type: object + properties: + aggregations: + type: object + additionalProperties: + type: array + items: + type: object + properties: + key: + type: string + doc_count: + type: integer + required: + - doc_count + - key + suggestions: + type: array + items: + type: string + required: + - aggregations + - suggestions + readOnly: true + required: + - count + - metadata + - next + - previous + - results + LevelEnum: + enum: + - undergraduate + - graduate + - high_school + - noncredit + - advanced + - intermediate + - introductory + type: string + description: |- + * `undergraduate` - Undergraduate + * `graduate` - Graduate + * `high_school` - High School + * `noncredit` - Non-Credit + * `advanced` - Advanced + * `intermediate` - Intermediate + * `introductory` - Introductory + x-enum-descriptions: + - Undergraduate + - Graduate + - High School + - Non-Credit + - Advanced + - Intermediate + - Introductory + MicroLearningPathRelationship: + type: object + description: Serializer containing only parent and child ids for a learning + path relationship + properties: + id: + type: integer + readOnly: true + parent: + type: integer + readOnly: true + description: The id of the parent learning resource + child: + type: integer + readOnly: true + required: + - child + - id + - parent + MicroUserListRelationship: + type: object + description: Serializer containing only parent and child ids for a user list + relationship + properties: + id: + type: integer + readOnly: true + parent: + type: integer + readOnly: true + description: The id of the parent learning resource + child: + type: integer + readOnly: true + required: + - child + - id + - parent + NullEnum: + enum: + - null + OfferedByEnum: + enum: + - mitx + - ocw + - bootcamps + - xpro + - mitpe + - see + - climate + type: string + description: |- + * `mitx` - MITx + * `ocw` - MIT OpenCourseWare + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `climate` - MIT Climate + x-enum-descriptions: + - MITx + - MIT OpenCourseWare + - Bootcamps + - MIT xPRO + - MIT Professional Education + - MIT Sloan Executive Education + - MIT Climate + PaginatedContentFileList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ContentFile' + PaginatedCourseResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/CourseResource' + PaginatedLearningPathRelationshipList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningPathRelationship' + PaginatedLearningPathResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningPathResource' + PaginatedLearningResourceContentTagList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceContentTag' + PaginatedLearningResourceDepartmentList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + PaginatedLearningResourceDisplayInfoResponseList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceDisplayInfoResponse' + PaginatedLearningResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResource' + PaginatedLearningResourceOfferorDetailList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceOfferorDetail' + PaginatedLearningResourcePlatformList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourcePlatform' + PaginatedLearningResourceRelationshipList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceRelationship' + PaginatedLearningResourceSchoolList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceSchool' + PaginatedLearningResourceSummaryList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceSummary' + PaginatedLearningResourceTopicList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + PaginatedPodcastEpisodeResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PodcastEpisodeResource' + PaginatedPodcastResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PodcastResource' + PaginatedProgramResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ProgramResource' + PaginatedUserListList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/UserList' + PaginatedUserListRelationshipList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/UserListRelationship' + PaginatedVideoPlaylistResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/VideoPlaylistResource' + PaginatedVideoResourceList: + type: object + required: + - count + - results + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/VideoResource' + PatchedLearningPathRelationshipCreateRequest: + type: object + description: |- + Create serializer for nested learning path items. + + The parent is derived from the nested route and must not be client-supplied. + properties: + position: + type: integer + maximum: 2147483647 + minimum: 0 + child: + type: integer + PatchedLearningPathResourceRequest: + type: object + description: CRUD serializer for LearningPath resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + PatchedLearningResourceRelationshipRequest: + type: object + description: CRUD serializer for LearningResourceRelationship + properties: + position: + type: integer + maximum: 2147483647 + minimum: 0 + relation_type: + $ref: '#/components/schemas/RelationTypeEnum' + parent: + type: integer + child: + type: integer + PatchedUserListRelationshipRequest: + type: object + description: Serializer for UserListRelationship model + properties: + position: + type: integer + maximum: 2147483647 + minimum: 0 + parent: + type: integer + child: + type: integer + PatchedUserListRequest: + type: object + description: Simplified serializer for UserList model. + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + privacy_level: + $ref: '#/components/schemas/PrivacyLevelEnum' + PercolateQuery: + type: object + description: Serializer for PercolateQuery objects + properties: + id: + type: integer + readOnly: true + source_description: + type: string + readOnly: true + source_label: + type: string + readOnly: true + original_query: {} + query: {} + source_type: + $ref: '#/components/schemas/SourceTypeEnum' + display_label: + type: string + description: Friendly display label for the query + maxLength: 255 + required: + - id + - original_query + - query + - source_description + - source_label + - source_type + PercolateQuerySubscriptionRequestRequest: + type: object + description: |- + PercolateQuerySubscriptionRequestSerializer with + OpenAPI annotations for Percolate Subscription requests + properties: + q: + type: string + minLength: 1 + description: The search text + offset: + type: integer + description: The initial index from which to return the results + limit: + type: integer + description: Number of results to return per page + offered_by: + type: array + items: + $ref: '#/components/schemas/OfferedByEnum' + description: "The organization that offers the learning resource \ + \ \n\n* `mitx` - MITx\n* `ocw` - MIT OpenCourseWare\n* `bootcamps`\ + \ - Bootcamps\n* `xpro` - MIT xPRO\n* `mitpe` - MIT Professional Education\n\ + * `see` - MIT Sloan Executive Education\n* `climate` - MIT Climate" + platform: + type: array + items: + $ref: '#/components/schemas/PlatformEnum' + description: "The platform on which the learning resource is offered \ + \ \n\n* `edx` - edX\n* `ocw` - MIT OpenCourseWare\n* `oll` -\ + \ Open Learning Library\n* `mitxonline` - MITx Online\n* `bootcamps` -\ + \ Bootcamps\n* `xpro` - MIT xPRO\n* `csail` - CSAIL\n* `mitpe` - MIT Professional\ + \ Education\n* `see` - MIT Sloan Executive Education\n* `scc` - Schwarzman\ + \ College of Computing\n* `ctl` - Center for Transportation & Logistics\n\ + * `whu` - WHU\n* `susskind` - Susskind\n* `globalalumni` - Global Alumni\n\ + * `simplilearn` - Simplilearn\n* `emeritus` - Emeritus\n* `podcast` -\ + \ Podcast\n* `youtube` - YouTube\n* `canvas` - Canvas\n* `climate` - MIT\ + \ Climate\n* `ovs` - ODL Video Service" + topic: + type: array + items: + type: string + minLength: 1 + description: The topic name. To see a list of options go to api/v1/topics/ + ocw_topic: + type: array + items: + type: string + minLength: 1 + description: The ocw topic name. + dev_mode: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations + id: + type: array + items: + type: integer + description: The id value for the learning resource + sortby: + allOf: + - $ref: '#/components/schemas/SortbyEnum' + description: |- + If the parameter starts with '-' the sort is in descending order + + * `featured` - Featured + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + resource_type: + type: array + items: + $ref: '#/components/schemas/PercolateQuerySubscriptionRequestResourceTypeEnum' + description: "The type of learning resource \n\n* `course` -\ + \ course\n* `program` - program\n* `learning_path` - learning path\n*\ + \ `podcast` - podcast\n* `podcast_episode` - podcast episode\n* `video`\ + \ - video\n* `video_playlist` - video playlist\n* `document` - document" + free: + type: boolean + nullable: true + professional: + type: boolean + nullable: true + yearly_decay_percent: + type: number + format: double + maximum: 10 + minimum: 0 + nullable: true + description: Relevance score penalty percent per year for for resources + without upcoming runs. Only affects results if there is a search term. + certification: + type: boolean + nullable: true + description: True if the learning resource offers a certificate + certification_type: + type: array + items: + $ref: '#/components/schemas/CertificationTypeEnum' + description: "The type of certificate \n\n* `micromasters` -\ + \ MicroMasters Credential\n* `professional` - Professional Certificate\n\ + * `completion` - Certificate of Completion\n* `none` - No Certificate" + department: + type: array + items: + $ref: '#/components/schemas/DepartmentEnum' + description: "The department that offers the learning resource \ + \ \n\n* `1` - Civil and Environmental Engineering\n* `2` - Mechanical\ + \ Engineering\n* `3` - Materials Science and Engineering\n* `4` - Architecture\n\ + * `5` - Chemistry\n* `6` - Electrical Engineering and Computer Science\n\ + * `7` - Biology\n* `8` - Physics\n* `9` - Brain and Cognitive Sciences\n\ + * `10` - Chemical Engineering\n* `11` - Urban Studies and Planning\n*\ + \ `12` - Earth, Atmospheric, and Planetary Sciences\n* `14` - Economics\n\ + * `15` - Management\n* `16` - Aeronautics and Astronautics\n* `17` - Political\ + \ Science\n* `18` - Mathematics\n* `20` - Biological Engineering\n* `21A`\ + \ - Anthropology\n* `21G` - Global Languages\n* `21H` - History\n* `21L`\ + \ - Literature\n* `21M` - Music and Theater Arts\n* `22` - Nuclear Science\ + \ and Engineering\n* `24` - Linguistics and Philosophy\n* `CC` - Concourse\n\ + * `CMS-W` - Comparative Media Studies/Writing\n* `EC` - Edgerton Center\n\ + * `ES` - Experimental Study Group\n* `ESD` - Engineering Systems Division\n\ + * `HST` - Medical Engineering and Science\n* `IDS` - Data, Systems, and\ + \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ + \ Education and Recreation\n* `SP` - Special Programs\n* `STS` - Science,\ + \ Technology, and Society\n* `WGS` - Women's and Gender Studies" + level: + type: array + items: + $ref: '#/components/schemas/LevelEnum' + course_feature: + type: array + items: + type: string + minLength: 1 + description: The course feature. Possible options are at api/v1/course_features/ + aggregations: + type: array + items: + $ref: '#/components/schemas/AggregationsEnum' + description: Show resource counts by category + delivery: + type: array + items: + $ref: '#/components/schemas/DeliveryEnum' + description: "The delivery options in which the learning resource is offered\ + \ \n\n* `online` - Online\n* `hybrid` - Hybrid\n* `in_person`\ + \ - In person\n* `offline` - Offline" + resource_type_group: + type: array + items: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + resource_category: + type: array + items: + type: string + minLength: 1 + description: The resource category for the resource + search_mode: + allOf: + - $ref: '#/components/schemas/SearchModeEnum' + description: "The open search search type for text queries \n\ + \n* `phrase` - phrase\n* `best_fields` - best_fields\n* `most_fields`\ + \ - most_fields\n* `hybrid` - hybrid\n\n* `phrase` - phrase\n* `best_fields`\ + \ - best_fields\n* `most_fields` - most_fields\n* `hybrid` - hybrid" + slop: + type: integer + nullable: true + description: Allowed distance for phrase search + min_score: + type: number + format: double + maximum: 50 + minimum: 0 + nullable: true + description: Minimum score value a text query result needs to have to be + displayed + max_incompleteness_penalty: + type: number + format: double + maximum: 100 + minimum: 0 + nullable: true + description: Maximum score penalty for incomplete OCW courses in percent. + An OCW course with completeness = 0 will have this score penalty. Partially + complete courses have a linear penalty proportional to the degree of incompleteness. + Only affects results if there is a search term. + content_file_score_weight: + type: number + format: double + maximum: 1 + minimum: 0 + nullable: true + description: Score weight for content file data. 1 is the default. 0 means + content files are ignored + show_ocw_files: + type: boolean + nullable: true + default: false + description: Whether to include select OCW content files in search results. + source_type: + allOf: + - $ref: '#/components/schemas/SourceTypeEnum' + default: search_subscription_type + description: |- + The subscription type + + * `search_subscription_type` - search_subscription_type + * `channel_subscription_type` - channel_subscription_type + PercolateQuerySubscriptionRequestResourceTypeEnum: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning path + * `podcast` - podcast + * `podcast_episode` - podcast episode + * `video` - video + * `video_playlist` - video playlist + * `document` - document + x-enum-descriptions: + - course + - program + - learning path + - podcast + - podcast episode + - video + - video playlist + - document + PlatformEnum: + enum: + - edx + - ocw + - oll + - mitxonline + - bootcamps + - xpro + - csail + - mitpe + - see + - scc + - ctl + - whu + - susskind + - globalalumni + - simplilearn + - emeritus + - podcast + - youtube + - canvas + - climate + - ovs + type: string + description: |- + * `edx` - edX + * `ocw` - MIT OpenCourseWare + * `oll` - Open Learning Library + * `mitxonline` - MITx Online + * `bootcamps` - Bootcamps + * `xpro` - MIT xPRO + * `csail` - CSAIL + * `mitpe` - MIT Professional Education + * `see` - MIT Sloan Executive Education + * `scc` - Schwarzman College of Computing + * `ctl` - Center for Transportation & Logistics + * `whu` - WHU + * `susskind` - Susskind + * `globalalumni` - Global Alumni + * `simplilearn` - Simplilearn + * `emeritus` - Emeritus + * `podcast` - Podcast + * `youtube` - YouTube + * `canvas` - Canvas + * `climate` - MIT Climate + * `ovs` - ODL Video Service + x-enum-descriptions: + - edX + - MIT OpenCourseWare + - Open Learning Library + - MITx Online + - Bootcamps + - MIT xPRO + - CSAIL + - MIT Professional Education + - MIT Sloan Executive Education + - Schwarzman College of Computing + - Center for Transportation & Logistics + - WHU + - Susskind + - Global Alumni + - Simplilearn + - Emeritus + - Podcast + - YouTube + - Canvas + - MIT Climate + - ODL Video Service + Podcast: + type: object + description: Serializer for Podcasts + properties: + id: + type: integer + readOnly: true + episode_count: + type: integer + apple_podcasts_url: + type: string + format: uri + nullable: true + maxLength: 2048 + google_podcasts_url: + type: string + format: uri + nullable: true + maxLength: 2048 + rss_url: + type: string + format: uri + nullable: true + maxLength: 2048 + required: + - episode_count + - id + PodcastEpisode: + type: object + description: Serializer for PodcastEpisode + properties: + id: + type: integer + readOnly: true + podcasts: + type: array + items: + type: string + description: Get the podcast id(s) the episode belongs to + readOnly: true + transcript: + type: string + audio_url: + type: string + format: uri + maxLength: 2048 + episode_link: + type: string + format: uri + nullable: true + maxLength: 2048 + duration: + type: string + nullable: true + maxLength: 10 + rss: + type: string + nullable: true + required: + - audio_url + - id + - podcasts + PodcastEpisodeRequest: + type: object + description: Serializer for PodcastEpisode + properties: + transcript: + type: string + audio_url: + type: string + format: uri + minLength: 1 + maxLength: 2048 + episode_link: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + duration: + type: string + nullable: true + maxLength: 10 + rss: + type: string + nullable: true + required: + - audio_url + PodcastEpisodeResource: + type: object + description: Serializer for podcast episode resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/PodcastEpisodeResourceResourceTypeEnum' + default: podcast_episode + readOnly: true + podcast_episode: + allOf: + - $ref: '#/components/schemas/PodcastEpisode' + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + resource_category: + type: string + readOnly: true + description: The display category for this resource. + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - course_feature + - delivery + - departments + - format + - free + - id + - image + - offered_by + - pace + - platform + - podcast_episode + - position + - prices + - professional + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - views + PodcastEpisodeResourceRequest: + type: object + description: Serializer for podcast episode resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + PodcastEpisodeResourceResourceTypeEnum: + type: string + enum: + - podcast_episode + PodcastRequest: + type: object + description: Serializer for Podcasts + properties: + episode_count: + type: integer + apple_podcasts_url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + google_podcasts_url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + rss_url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + required: + - episode_count + PodcastResource: + type: object + description: Serializer for podcast resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/PodcastResourceResourceTypeEnum' + default: podcast + readOnly: true + podcast: + allOf: + - $ref: '#/components/schemas/Podcast' + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + resource_category: + type: string + readOnly: true + description: The display category for this resource. + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - course_feature + - delivery + - departments + - format + - free + - id + - image + - offered_by + - pace + - platform + - podcast + - position + - prices + - professional + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - views + PodcastResourceRequest: + type: object + description: Serializer for podcast resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + PodcastResourceResourceTypeEnum: + type: string + enum: + - podcast + PrivacyLevelEnum: + enum: + - private + - unlisted + type: string + description: |- + * `private` - private + * `unlisted` - unlisted + x-enum-descriptions: + - private + - unlisted + Program: + type: object + description: Serializer for the Program model + properties: + course_count: + type: integer + readOnly: true + program_count: + type: integer + readOnly: true + required: + - course_count + - program_count + ProgramResource: + type: object + description: Serializer for program resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/ProgramResourceResourceTypeEnum' + default: program + readOnly: true + program: + allOf: + - $ref: '#/components/schemas/Program' + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + resource_category: + type: string + readOnly: true + description: The display category for this resource. + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - course_feature + - delivery + - departments + - format + - free + - id + - image + - offered_by + - pace + - platform + - position + - prices + - professional + - program + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - views + ProgramResourceRequest: + type: object + description: Serializer for program resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + ProgramResourceResourceTypeEnum: + type: string + enum: + - program + RelationTypeEnum: + enum: + - PROGRAM_COURSES + - PROGRAM_PROGRAMS + - LEARNING_PATH_ITEMS + - PODCAST_EPISODES + - PLAYLIST_VIDEOS + - COURSE_LEARNING_MATERIALS + type: string + description: |- + * `PROGRAM_COURSES` - Program Courses + * `PROGRAM_PROGRAMS` - Program Programs + * `LEARNING_PATH_ITEMS` - Learning Path Items + * `PODCAST_EPISODES` - Podcast Episodes + * `PLAYLIST_VIDEOS` - Playlist Videos + * `COURSE_LEARNING_MATERIALS` - Course Learning Materials + x-enum-descriptions: + - Program Courses + - Program Programs + - Learning Path Items + - Podcast Episodes + - Playlist Videos + - Course Learning Materials + ResourceChildSummary: + type: object + description: Serializer for child course/program entries within a program. + properties: + title: + type: string + readable_id: + type: string + description: + type: string + resource_type: + type: string + topics: + type: array + items: + type: string + parent_program: + type: string + required: + - description + - readable_id + - resource_type + - title + - topics + ResourceTypeEnum: + enum: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + type: string + description: |- + * `course` - course + * `program` - program + * `learning_path` - learning_path + * `podcast` - podcast + * `podcast_episode` - podcast_episode + * `video` - video + * `video_playlist` - video_playlist + * `document` - document + x-enum-descriptions: + - course + - program + - learning_path + - podcast + - podcast_episode + - video + - video_playlist + - document + ResourceTypeGroupEnum: + enum: + - course + - program + - learning_material + type: string + description: |- + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + x-enum-descriptions: + - Course + - Program + - Learning Material + SearchModeEnum: + enum: + - phrase + - best_fields + - most_fields + - hybrid + type: string + description: |- + * `phrase` - phrase + * `best_fields` - best_fields + * `most_fields` - most_fields + * `hybrid` - hybrid + + * `phrase` - phrase + * `best_fields` - best_fields + * `most_fields` - most_fields + * `hybrid` - hybrid + x-enum-descriptions: + - phrase + - best_fields + - most_fields + - hybrid + SortbyEnum: + enum: + - featured + - id + - -id + - readable_id + - -readable_id + - last_modified + - -last_modified + - new + - start_date + - -start_date + - mitcoursenumber + - -mitcoursenumber + - views + - -views + - upcoming + type: string + description: |- + * `featured` - Featured + * `id` - Object ID ascending + * `-id` - Object ID descending + * `readable_id` - Readable ID ascending + * `-readable_id` - Readable ID descending + * `last_modified` - Last Modified Date ascending + * `-last_modified` - Last Modified Date descending + * `new` - Newest resources first + * `start_date` - Start Date ascending + * `-start_date` - Start Date descending + * `mitcoursenumber` - MIT course number ascending + * `-mitcoursenumber` - MIT course number descending + * `views` - Popularity ascending + * `-views` - Popularity descending + * `upcoming` - Next start date ascending + x-enum-descriptions: + - Featured + - Object ID ascending + - Object ID descending + - Readable ID ascending + - Readable ID descending + - Last Modified Date ascending + - Last Modified Date descending + - Newest resources first + - Start Date ascending + - Start Date descending + - MIT course number ascending + - MIT course number descending + - Popularity ascending + - Popularity descending + - Next start date ascending + SourceTypeEnum: + enum: + - search_subscription_type + - channel_subscription_type + type: string + description: |- + * `search_subscription_type` - search_subscription_type + * `channel_subscription_type` - channel_subscription_type + x-enum-descriptions: + - search_subscription_type + - channel_subscription_type + UserList: + type: object + description: Simplified serializer for UserList model. + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + item_count: + type: integer + description: Return the number of items in the list + readOnly: true + image: + type: object + additionalProperties: {} + description: Return the image of the first item + readOnly: true + title: + type: string + maxLength: 256 + description: + type: string + privacy_level: + $ref: '#/components/schemas/PrivacyLevelEnum' + author: + type: integer + readOnly: true + required: + - author + - id + - image + - item_count + - title + UserListRelationship: + type: object + description: Serializer for UserListRelationship model + properties: + id: + type: integer + readOnly: true + resource: + allOf: + - $ref: '#/components/schemas/LearningResource' + readOnly: true + position: + type: integer + maximum: 2147483647 + minimum: 0 + parent: + type: integer + child: + type: integer + required: + - child + - id + - parent + - resource + UserListRelationshipRequest: + type: object + description: Serializer for UserListRelationship model + properties: + position: + type: integer + maximum: 2147483647 + minimum: 0 + parent: + type: integer + child: + type: integer + required: + - child + - parent + UserListRequest: + type: object + description: Simplified serializer for UserList model. + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + privacy_level: + $ref: '#/components/schemas/PrivacyLevelEnum' + required: + - title + Video: + type: object + description: Serializer for the Video model + properties: + id: + type: integer + readOnly: true + caption_urls: + type: array + items: + $ref: '#/components/schemas/CaptionUrl' + readOnly: true + streaming_url: + type: string + format: uri + readOnly: true + nullable: true + thumbnail_url: + type: string + format: uri + readOnly: true + nullable: true + duration: + type: string + maxLength: 11 + required: + - caption_urls + - duration + - id + - streaming_url + - thumbnail_url + VideoChannel: + type: object + description: Serializer for the VideoChannel model + properties: + channel_id: + type: string + maxLength: 80 + title: + type: string + maxLength: 256 + required: + - channel_id + - title + VideoChannelRequest: + type: object + description: Serializer for the VideoChannel model + properties: + channel_id: + type: string + minLength: 1 + maxLength: 80 + title: + type: string + minLength: 1 + maxLength: 256 + required: + - channel_id + - title + VideoPlaylist: + type: object + description: Serializer for the VideoPlaylist model + properties: + id: + type: integer + readOnly: true + channel: + allOf: + - $ref: '#/components/schemas/VideoChannel' + readOnly: true + nullable: true + video_count: + type: integer + required: + - channel + - id + - video_count + VideoPlaylistRequest: + type: object + description: Serializer for the VideoPlaylist model + properties: + video_count: + type: integer + required: + - video_count + VideoPlaylistResource: + type: object + description: Serializer for video playlist resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/VideoPlaylistResourceResourceTypeEnum' + default: video_playlist + readOnly: true + video_playlist: + allOf: + - $ref: '#/components/schemas/VideoPlaylist' + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + resource_category: + type: string + readOnly: true + description: The display category for this resource. + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - course_feature + - delivery + - departments + - format + - free + - id + - image + - offered_by + - pace + - platform + - position + - prices + - professional + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - video_playlist + - views + VideoPlaylistResourceRequest: + type: object + description: Serializer for video playlist resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + nullable: true + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + VideoPlaylistResourceResourceTypeEnum: + type: string + enum: + - video_playlist + VideoRequest: + type: object + description: Serializer for the Video model + properties: + duration: + type: string + minLength: 1 + maxLength: 11 + required: + - duration + VideoResource: + type: object + description: Serializer for video resources + properties: + id: + type: integer + readOnly: true + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + position: + type: integer + readOnly: true + nullable: true + offered_by: + allOf: + - $ref: '#/components/schemas/LearningResourceOfferor' + readOnly: true + nullable: true + platform: + allOf: + - $ref: '#/components/schemas/LearningResourcePlatform' + readOnly: true + nullable: true + course_feature: + type: array + items: + type: string + readOnly: true + nullable: true + departments: + type: array + items: + $ref: '#/components/schemas/LearningResourceDepartment' + readOnly: true + nullable: true + certification: + type: boolean + readOnly: true + certification_type: + type: object + title: CourseResourceCertificationType + properties: + code: + enum: + - micromasters + - professional + - completion + - none + name: + type: string + required: + - code + - name + readOnly: true + prices: + type: array + items: + type: string + format: decimal + pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ + readOnly: true + resource_prices: + type: array + items: + $ref: '#/components/schemas/LearningResourcePrice' + readOnly: true + runs: + type: array + items: + $ref: '#/components/schemas/LearningResourceRun' + readOnly: true + nullable: true + image: + allOf: + - $ref: '#/components/schemas/LearningResourceImage' + nullable: true + readOnly: true + views: + type: integer + readOnly: true + delivery: + type: array + items: + type: object + title: CourseResourceDeliveryInner + properties: + code: + enum: + - online + - hybrid + - in_person + - offline + name: + type: string + required: + - code + - name + readOnly: true + free: + type: boolean + description: Return true if the resource is free/has a free option + readOnly: true + resource_type_group: + allOf: + - $ref: '#/components/schemas/ResourceTypeGroupEnum' + readOnly: true + description: |- + The resource type group for UI grouping. + + For courses/programs, this is derived from resource_category + (which may differ from resource_type). + For all other types, returns "learning_material". + + * `course` - Course + * `program` - Program + * `learning_material` - Learning Material + format: + type: array + items: + type: object + title: CourseResourceFormatInner + properties: + code: + enum: + - synchronous + - asynchronous + name: + type: string + required: + - code + - name + readOnly: true + pace: + type: array + items: + type: object + title: CourseResourcePaceInner + properties: + code: + enum: + - self_paced + - instructor_paced + name: + type: string + required: + - code + - name + readOnly: true + children: + allOf: + - $ref: '#/components/schemas/LearningResourceRelationshipChildField' + nullable: true + readOnly: true + best_run_id: + type: integer + nullable: true + description: Return the best run id for the resource, if it has runs + readOnly: true + resource_type: + allOf: + - $ref: '#/components/schemas/VideoResourceResourceTypeEnum' + default: video + readOnly: true + video: + allOf: + - $ref: '#/components/schemas/Video' + readOnly: true + nullable: true + playlists: + type: array + items: + type: string + description: Get the playlist id(s) the video belongs to + readOnly: true + content_files: + type: array + items: + $ref: '#/components/schemas/ContentFile' + nullable: true + readOnly: true + description: + type: string + nullable: true + readOnly: true + readable_id: + type: string + readOnly: true + title: + type: string + maxLength: 256 + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + maxLength: 2048 + resource_category: + type: string + readOnly: true + description: The display category for this resource. + ocw_topics: + type: array + items: + type: string + maxLength: 128 + professional: + type: boolean + readOnly: true + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + require_summaries: + type: boolean + readOnly: true + required: + - best_run_id + - certification + - certification_type + - children + - content_files + - course_feature + - delivery + - departments + - description + - format + - free + - id + - image + - offered_by + - pace + - platform + - playlists + - position + - prices + - professional + - readable_id + - require_summaries + - resource_category + - resource_prices + - resource_type + - resource_type_group + - runs + - title + - video + - views + VideoResourceRequest: + type: object + description: Serializer for video resources + properties: + topics: + type: array + items: + $ref: '#/components/schemas/LearningResourceTopic' + title: + type: string + minLength: 1 + maxLength: 256 + full_description: + type: string + nullable: true + last_modified: + type: string + format: date-time + nullable: true + published: + type: boolean + languages: + type: array + items: + type: string + minLength: 1 + maxLength: 24 + nullable: true + url: + type: string + format: uri + nullable: true + minLength: 1 + maxLength: 2048 + ocw_topics: + type: array + items: + type: string + minLength: 1 + maxLength: 128 + next_start_date: + type: string + format: date-time + nullable: true + availability: + nullable: true + oneOf: + - $ref: '#/components/schemas/AvailabilityEnum' + - $ref: '#/components/schemas/NullEnum' + completeness: + type: number + format: double + license_cc: + type: boolean + test_mode: + type: boolean + continuing_ed_credits: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + location: + type: string + maxLength: 256 + duration: + type: string + maxLength: 256 + min_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weeks: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + time_commitment: + type: string + maxLength: 256 + min_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + max_weekly_hours: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + required: + - title + VideoResourceResourceTypeEnum: + type: string + enum: + - video diff --git a/openapi/urls.py b/openapi/urls.py index 9543b7d5fa..c00d505936 100644 --- a/openapi/urls.py +++ b/openapi/urls.py @@ -36,4 +36,17 @@ SpectacularRedocView.as_view(url_name="v1_schema"), name="v1_redoc", ), + path( + "api/v2/schema/", SpectacularAPIView.as_view(api_version="v2"), name="v2_schema" + ), + path( + "api/v2/schema/swagger-ui/", + SpectacularSwaggerView.as_view(url_name="v2_schema"), + name="v2_swagger_ui", + ), + path( + "api/v2/schema/redoc/", + SpectacularRedocView.as_view(url_name="v2_schema"), + name="v2_redoc", + ), ] diff --git a/profiles/serializers.py b/profiles/serializers.py index d3941899d5..2897dfc271 100644 --- a/profiles/serializers.py +++ b/profiles/serializers.py @@ -9,6 +9,7 @@ from django.db import transaction from django.urls import reverse from drf_spectacular.utils import extend_schema_field +from mitol.api_versioning.mixins import VersionedSerializerMixin from rest_framework import serializers from rest_framework.exceptions import ValidationError @@ -80,7 +81,7 @@ class PreferencesSearchSerializer(serializers.Serializer): delivery = serializers.ListField(child=serializers.CharField(), required=False) -class ProfileSerializer(serializers.ModelSerializer): +class ProfileSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for Profile""" name = serializers.SerializerMethodField(read_only=True) @@ -209,7 +210,7 @@ class Meta: extra_kwargs = {"location": {"write_only": True}} -class UserWebsiteSerializer(serializers.ModelSerializer): +class UserWebsiteSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for UserWebsite""" def validate_url(self, value): @@ -298,7 +299,7 @@ class Meta: read_only_fields = ("id", "site_type") -class UserSerializer(serializers.ModelSerializer): +class UserSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for User""" # username cannot be set but a default is generated on create using ulid.new @@ -367,7 +368,9 @@ class Meta: read_only_fields = ("id", "username", "is_authenticated") -class ProgramCertificateSerializer(serializers.ModelSerializer): +class ProgramCertificateSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer for Program Certificates """ @@ -420,7 +423,7 @@ class ProgramLetterTemplateFieldSerializer(serializers.Serializer): program_letter_signatories = serializers.ListField(child=serializers.JSONField()) -class ProgramLetterSerializer(serializers.ModelSerializer): +class ProgramLetterSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ Serializer for Program Letters """ diff --git a/pyproject.toml b/pyproject.toml index 2bafe84139..7e6387eefb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ dependencies = [ "mitol-django-common>=2026.4.2,<2027", "mitol-django-scim>=2026.4.2,<2027", "mitol-django-observability>=2026.1.0,<2027", + "mitol-django-api-versioning>=2026.3.24,<2027", "named-enum>=1.4.0,<2", "nested-lookup>=0.2.25,<0.3", "nh3>=0.3.0,<0.4", @@ -156,6 +157,7 @@ override-dependencies = ["setuptools<80"] [tool.uv.sources] django-health-check = { git = "https://github.com/revsys/django-health-check", rev = "53f9bdc3a7acc8a577319987fef0bd3040eef4b4" } # pragma: allowlist secret +mitol-django-api-versioning = { git = "https://github.com/mitodl/ol-django", subdirectory = "src/api_versioning", rev = "7b87887e248c33d4cb222f1a7a74a1e93290376c" } # pragma: allowlist secret [tool.uv.build-backend] module-root = "" diff --git a/scripts/generate_openapi.sh b/scripts/generate_openapi.sh index c63ead3b73..7d5905f302 100755 --- a/scripts/generate_openapi.sh +++ b/scripts/generate_openapi.sh @@ -22,6 +22,8 @@ docker run --rm -v "${PWD}:/local" -w /local openapitools/openapi-generator-cli: generate -c scripts/openapi-configs/typescript-axios-v0.yaml docker run --rm -v "${PWD}:/local" -w /local openapitools/openapi-generator-cli:${GENERATOR_VERSION} \ generate -c scripts/openapi-configs/typescript-axios-v1.yaml +docker run --rm -v "${PWD}:/local" -w /local openapitools/openapi-generator-cli:${GENERATOR_VERSION} \ + generate -c scripts/openapi-configs/typescript-axios-v2.yaml # We expect pre-commit to exit with a non-zero status since it is reformatting # the generated code. diff --git a/scripts/openapi-configs/typescript-axios-v2.yaml b/scripts/openapi-configs/typescript-axios-v2.yaml new file mode 100644 index 0000000000..327feb0983 --- /dev/null +++ b/scripts/openapi-configs/typescript-axios-v2.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-axios +outputDir: frontends/api/src/generated/v2 +inputSpec: openapi/specs/v2.yaml +ignoreFileOverride: frontends/api/.openapi-generator-ignore +templateDir: scripts/openapi-configs/templates +additionalProperties: + paramNaming: original + useSingleRequestParameter: true + supportsES6: false diff --git a/testimonials/serializers.py b/testimonials/serializers.py index 60c98e3e7b..7b955b627f 100644 --- a/testimonials/serializers.py +++ b/testimonials/serializers.py @@ -1,11 +1,12 @@ """Serializers for testimonials.""" +from mitol.api_versioning.mixins import VersionedSerializerMixin from rest_framework import serializers from testimonials.models import Attestation -class AttestationSerializer(serializers.ModelSerializer): +class AttestationSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """Serializer for attestations.""" avatar = serializers.SerializerMethodField() diff --git a/uv.lock b/uv.lock index 001d7183cf..1470aeafa8 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 2 requires-python = "==3.12.*" [manifest] @@ -2543,6 +2543,7 @@ dependencies = [ { name = "lxml" }, { name = "markdown" }, { name = "markdown2" }, + { name = "mitol-django-api-versioning" }, { name = "mitol-django-common" }, { name = "mitol-django-observability" }, { name = "mitol-django-scim" }, @@ -2683,6 +2684,7 @@ requires-dist = [ { name = "lxml", specifier = ">=6.0.0,<7" }, { name = "markdown", specifier = ">=3.7,<4" }, { name = "markdown2", specifier = ">=2.4.8,<3" }, + { name = "mitol-django-api-versioning", git = "https://github.com/mitodl/ol-django?subdirectory=src%2Fapi_versioning&rev=7b87887e248c33d4cb222f1a7a74a1e93290376c" }, { name = "mitol-django-common", specifier = ">=2026.4.2,<2027" }, { name = "mitol-django-observability", specifier = ">=2026.1.0,<2027" }, { name = "mitol-django-scim", specifier = ">=2026.4.2,<2027" }, @@ -2765,6 +2767,15 @@ dev = [ { name = "traceback-with-variables", specifier = ">=2.1.1,<3" }, ] +[[package]] +name = "mitol-django-api-versioning" +version = "2026.3.24" +source = { git = "https://github.com/mitodl/ol-django?subdirectory=src%2Fapi_versioning&rev=7b87887e248c33d4cb222f1a7a74a1e93290376c#7b87887e248c33d4cb222f1a7a74a1e93290376c" } +dependencies = [ + { name = "django" }, + { name = "djangorestframework" }, +] + [[package]] name = "mitol-django-common" version = "2026.4.2" diff --git a/video_shorts/serializers.py b/video_shorts/serializers.py index 48dbb8a29f..33f74bf45f 100644 --- a/video_shorts/serializers.py +++ b/video_shorts/serializers.py @@ -1,11 +1,12 @@ """Serializers for video shorts""" +from mitol.api_versioning.mixins import VersionedSerializerMixin from rest_framework import serializers from video_shorts.models import VideoShort -class VideoShortSerializer(serializers.ModelSerializer): +class VideoShortSerializer(VersionedSerializerMixin, serializers.ModelSerializer): """ModelSerializer for VideoShort model""" class Meta: @@ -23,7 +24,9 @@ class Meta: read_only_fields = ["created_on", "updated_on"] -class VideoShortWebhookSerializer(serializers.ModelSerializer): +class VideoShortWebhookSerializer( + VersionedSerializerMixin, serializers.ModelSerializer +): """ Serializer to transform webhook metadata to VideoShort objects. """