diff --git a/README.md b/README.md index 1ce5f1f..f60c0f5 100644 --- a/README.md +++ b/README.md @@ -35,15 +35,15 @@ git push --tags # and it tags it too ### Hooks -`@mitodl/course-search-utils` exports two hooks to assist in making search requests to MIT Open's APIs. They are: +`@mitodl/course-search-utils` exports a few hooks to assist in making search requests to MIT Open's APIs. They are: -1. `useSearchQueryParams({ searchParams, setSearchParams, ...opts? })`: Derive search API parameters (facets, search text, ...) from a `URLSearchParams` object. Often, the `URLSearchParams` object will be derived from the browser URL, though it could be state internal to react. +1. `useResourceSearchParams({ searchParams, setSearchParams, ...opts? })` and `useContentFileSearchParams`: Derive search API parameters from a `URLSearchParams` object. Often, the `URLSearchParams` object will be derived from the browser URL, though it could be state internal to react. The hook extracts validated API parameters from the `URLSearchParams` object and returns setters that can be used to manipulate the `URLSearchParams` (e.g., toggling a search facet on or off). - The `URLSearchParams` keys are mapped to API parameters internally, e.g., `?d=physics&d=chemistry` maps to `departments: ["physics", "chemistry"]`. This mapping is not configurable. + The `URLSearchParams` keys are mapped directly to API parameters. -2. `useInfiniteSearch({ params, baseUrl, ...opts? })`: Assists in making search API calls used in an infinite scrolling UI. The initial page is loaded by the hook, susbsequent pages via returm value `{ fetchNextPage }`. The hook's result is based on [useInfiniteQuery](https://tanstack.com/query/v4/docs/framework/react/reference/useInfiniteQuery). +2. `useInfiniteSearch({ params, endpoint, baseUrl, ...opts? })`: Assists in making search API calls used in an infinite scrolling UI. The initial page is loaded by the hook, susbsequent pages via returm value `{ fetchNextPage }`. The hook's result is based on [useInfiniteQuery](https://tanstack.com/query/v4/docs/framework/react/reference/useInfiniteQuery). See Typescript annotations and docstrings for more information on hook props and results. Typical usage might look like: @@ -51,26 +51,24 @@ See Typescript annotations and docstrings for more information on hook props and import { useSearchQueryParams, useInfiniteSearch, } from "@mitodl/course-search-utils" import type { UseInfiniteSearchProps } from "@mitodl/course-search-utils" -// set aggregations to be returned for resources and content_files endpoints -const AGGREGATIONS: UseInfiniteSearchProps["aggregations"] = { - resources: ["department", "level", "topic", "course_feature"], - content_files: ["topic", "offered_by", "content_feature_type"] +const CONSTANT_PARAMETERS = { + platform: ["ocw"], + aggregations: ["topic", "offered_by"] } -const CONSTANT_FACETS = { platform: ["ocw"] } - const SearchPage: React.FC = () => { const [searchParams, setSearchParams] = useSearchParams() const { params, - setFacetActive, - clearFacets, + toggleParamValue, + clearAllFacets, currentText, setCurrentText, setCurrentTextAndQuery, } = useSearchQueryParams({ searchParams, setSearchParams, + facets: FACETS }) // If necessary @@ -79,9 +77,8 @@ const SearchPage: React.FC = () => { }, [params]) const { pages, hasNextPage, fetchNextPage } = useInfiniteSearch({ - params: allParams + params: allParams, baseUrl: "http://mitopen.odl.mit.edu/", - aggregations: AGGREGATIONS, keepPreviousData: true, }) diff --git a/jest.config.ts b/jest.config.ts index 854a6d0..4e4eb0f 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,31 +1,31 @@ -import { Config } from "@jest/types"; +import { Config } from "@jest/types" const common = { testEnvironment: "jsdom", - transform: { + transform: { "^.+\\.(t)sx?$": "@swc/jest", }, setupFilesAfterEnv: ["src/test_setup.ts"], - testMatch: ["/src/**/*.(spec|test).ts?(x)"], -}; + testMatch: ["/src/**/*.(spec|test).ts?(x)"], +} const config: Config.InitialOptions = { projects: [ { - displayName: "history-v4", + displayName: "history-v4", moduleNameMapper: { history$: "history-v4", }, ...common, }, { - displayName: "history-v5", + displayName: "history-v5", moduleNameMapper: { history$: "history", }, ...common, }, ], -}; +} -export default config; +export default config diff --git a/package.json b/package.json index 16614b3..ed713af 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ }, "homepage": "https://github.com/mitodl/course-search-utils#readme", "dependencies": { + "@mitodl/open-api-axios": "^2024.3.22", "axios": "^1.6.7", "fuse.js": "^7.0.0", "query-string": "^6.13.1", diff --git a/src/facet_display/Facet.tsx b/src/facet_display/Facet.tsx index 921ccb7..63fa56d 100644 --- a/src/facet_display/Facet.tsx +++ b/src/facet_display/Facet.tsx @@ -45,7 +45,7 @@ function SearchFacet(props: Props) { i < MAX_DISPLAY_COUNT || results.length < FACET_COLLAPSE_THRESHOLD ? ( { test("renders a FacetDisplay with expected FilterableFacets", async () => { const { render } = setup() const wrapper = render() - const facets = wrapper.children() - expect(facets).toHaveLength(5) - facets.slice(1, 5).map((facet, key) => { + const facets = wrapper.find(AvailableFacets).dive().children() + expect(facets).toHaveLength(4) + facets.map((facet, key) => { expect(facet.prop("name")).toBe(facetMap[key].name) expect(facet.prop("title")).toBe(facetMap[key].title) expect(facet.prop("expandedOnLoad")).toBe(facetMap[key].expandedOnLoad) diff --git a/src/facet_display/FacetDisplay.tsx b/src/facet_display/FacetDisplay.tsx index 02312e5..37d62a1 100644 --- a/src/facet_display/FacetDisplay.tsx +++ b/src/facet_display/FacetDisplay.tsx @@ -7,7 +7,7 @@ import { LEVELS, DEPARTMENTS } from "../constants" export type BucketWithLabel = Bucket & { label: string } -interface Props { +interface FacetDisplayProps { facetMap: FacetManifest facetOptions: (group: string) => Aggregation | null activeFacets: Facets @@ -47,8 +47,53 @@ const resultsWithLabels = ( return newResults } +const AvailableFacets: React.FC> = ({ + facetMap, + facetOptions, + activeFacets, + onFacetChange +}) => { + return ( + <> + {facetMap.map(facetSetting => + facetSetting.useFilterableFacet ? ( + + onFacetChange(e.target.name, e.target.value, e.target.checked) + } + expandedOnLoad={facetSetting.expandedOnLoad} + /> + ) : ( + + onFacetChange(e.target.name, e.target.value, e.target.checked) + } + selected={activeFacets[facetSetting.name] || []} + expandedOnLoad={facetSetting.expandedOnLoad} + /> + ) + )} + + ) +} + const FacetDisplay = React.memo( - function FacetDisplay(props: Props) { + function FacetDisplay(props: FacetDisplayProps) { const { facetMap, facetOptions, @@ -83,39 +128,12 @@ const FacetDisplay = React.memo( )) )} - {facetMap.map((facetSetting, key) => - facetSetting.useFilterableFacet ? ( - - onFacetChange(e.target.name, e.target.value, e.target.checked) - } - expandedOnLoad={facetSetting.expandedOnLoad} - /> - ) : ( - - onFacetChange(e.target.name, e.target.value, e.target.checked) - } - selected={activeFacets[facetSetting.name] || []} - expandedOnLoad={facetSetting.expandedOnLoad} - /> - ) - )} + ) }, @@ -130,3 +148,4 @@ const FacetDisplay = React.memo( ) export default FacetDisplay +export { AvailableFacets } diff --git a/src/facet_display/FilterableFacet.tsx b/src/facet_display/FilterableFacet.tsx index b045007..8125c9e 100644 --- a/src/facet_display/FilterableFacet.tsx +++ b/src/facet_display/FilterableFacet.tsx @@ -88,9 +88,9 @@ function FilterableFacet(props: Props) { )}
- {facets.map((facet, i) => ( + {facets.map(facet => ( (allowed: T[]) => - (value: string) => - (allowed as string[]).includes(value) - -type EndpointParamConfig = { - sort: { - alias: string - isValid: (value: string) => boolean - } - facets: { - [K in keyof SearchParams["activeFacets"]]?: { - alias: string - isValid: (value: string) => boolean - isBoolean?: boolean - } - } -} - -const searchParamConfig: Record = { - resources: { - sort: { - alias: "s", - isValid: withinEnum(Object.values(SortByEnum)) - }, - facets: { - resource_type: { - alias: "r", - isValid: withinEnum(Object.values(ResourceTypeEnum)) - }, - department: { - alias: "d", - isValid: withinEnum(Object.values(DepartmentEnum)) - }, - level: { - alias: "l", - isValid: withinEnum(Object.values(LevelEnum)) - }, - platform: { - alias: "p", - isValid: withinEnum(Object.values(PlatformEnum)) - }, - offered_by: { - alias: "o", - isValid: withinEnum(Object.values(OfferedByEnum)) - }, - topic: { - alias: "t", - isValid: (value: string) => value.length > 0 - }, - certification: { - alias: "c", - isValid: (value: string) => value === "true", - isBoolean: true - }, - professional: { - alias: "pr", - isValid: (value: string) => value === "true", - isBoolean: true - }, - course_feature: { - alias: "cf", - isValid: (value: string) => value.length > 0 - } - } - }, - content_files: { - sort: { - alias: "s", - isValid: withinEnum(Object.values(ContentFileSortEnum)) - }, - facets: { - offered_by: { - alias: "o", - isValid: withinEnum(Object.values(OfferedByEnum)) - }, - platform: { - alias: "p", - isValid: withinEnum(Object.values(PlatformEnum)) - }, - content_feature_type: { - alias: "cf", - isValid: (value: string) => value.length > 0 - }, - topic: { - alias: "t", - isValid: (value: string) => value.length > 0 - } - } - } -} - -const QUERY_TEXT_ALIAS = "q" -const ENDPOINT_ALIAS = "e" - -export type { SearchParams, Endpoint, FacetName } -export { searchParamConfig, QUERY_TEXT_ALIAS, ENDPOINT_ALIAS } diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 28bda1a..ed52611 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,13 +1,16 @@ -export { default as useSearchQueryParams } from "./useSearchQueryParams" +export { + useResourceSearchParams, + useContentFileSearchParams +} from "./useValidatedSearchParams" export type { - UseSearchQueryParamsProps, - UseSearchQueryParamsResult -} from "./useSearchQueryParams" - -export type { SearchParams, Endpoint, FacetName } from "./configs" + UseResourceSearchParamsProps, + UseContentFileSearchParamsProps, + UseResourceSearchParamsResult, + UseContentFileSearchParamsResult +} from "./useValidatedSearchParams" export { default as useInfiniteSearch } from "./useInfiniteSearch" export type { - UseInfiniteSearchProps, - UseInfiniteSearchResult + UseInfiniteSearchResult, + UseInfiniteSearchProps } from "./useInfiniteSearch" diff --git a/src/hooks/useInfiniteSearch.test.ts b/src/hooks/useInfiniteSearch.test.ts index 9c66562..cb8dc6a 100644 --- a/src/hooks/useInfiniteSearch.test.ts +++ b/src/hooks/useInfiniteSearch.test.ts @@ -45,10 +45,10 @@ describe("useInfiniteSearchApi", () => { const { result } = renderHook(useInfiniteSearch, { initialProps: { params: { - queryText: "test", - activeFacets: { department: ["6", "8"] }, - endpoint: "resources" + q: "test", + department: ["6", "8"] }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch } @@ -59,7 +59,7 @@ describe("useInfiniteSearchApi", () => { */ expect(fetcher.fetch).toHaveBeenCalledTimes(1) expect(fetcher.lastUrlQueryString()).toEqual( - "department=6,8&limit=10&q=test" + "department=6&department=8&limit=10&offset=0&q=test" ) expect(result.current).toEqual( expect.objectContaining({ @@ -88,7 +88,7 @@ describe("useInfiniteSearchApi", () => { }) expect(fetcher.fetch).toHaveBeenCalledTimes(2) expect(fetcher.lastUrlQueryString()).toEqual( - "department=6,8&limit=10&offset=10&q=test" + "department=6&department=8&limit=10&offset=10&q=test" ) await fetcher.waitForFetch() expect(result.current).toEqual( @@ -109,7 +109,7 @@ describe("useInfiniteSearchApi", () => { }) expect(fetcher.fetch).toHaveBeenCalledTimes(3) expect(fetcher.lastUrlQueryString()).toEqual( - "department=6,8&limit=10&offset=20&q=test" + "department=6&department=8&limit=10&offset=20&q=test" ) await fetcher.waitForFetch() expect(result.current).toEqual( @@ -133,10 +133,10 @@ describe("useInfiniteSearchApi", () => { const { result } = renderHook(useInfiniteSearch, { initialProps: { params: { - queryText: "test", - activeFacets: { department: ["6", "8"] }, - endpoint: "resources" + q: "test", + department: ["6", "8"] }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch } @@ -157,10 +157,10 @@ describe("useInfiniteSearchApi", () => { const { result, rerender } = renderHook(useInfiniteSearch, { initialProps: { params: { - queryText: "test", - activeFacets: { department: ["6", "8"] }, - endpoint: "resources" + q: "test", + department: ["6", "8"] }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch } @@ -177,10 +177,10 @@ describe("useInfiniteSearchApi", () => { rerender({ params: { - queryText: "test", - activeFacets: { department: ["6"] }, - endpoint: "resources" + q: "test", + department: ["6"] }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch }) @@ -192,7 +192,9 @@ describe("useInfiniteSearchApi", () => { pages: [] }) ) - expect(fetcher.lastUrlQueryString()).toEqual("department=6&limit=10&q=test") + expect(fetcher.lastUrlQueryString()).toEqual( + "department=6&limit=10&offset=0&q=test" + ) }) test("when parameters change and keepPreviousData=true, previous data is kept during refetch", async () => { @@ -200,10 +202,10 @@ describe("useInfiniteSearchApi", () => { const { result, rerender } = renderHook(useInfiniteSearch, { initialProps: { params: { - queryText: "test", - activeFacets: { department: ["6", "8"] }, - endpoint: "resources" + q: "test", + department: ["6", "8"] }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch, keepPreviousData: true @@ -221,10 +223,10 @@ describe("useInfiniteSearchApi", () => { rerender({ params: { - queryText: "test", - activeFacets: { department: ["6"] }, - endpoint: "resources" + q: "test", + department: ["6"] }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch, keepPreviousData: true @@ -237,7 +239,9 @@ describe("useInfiniteSearchApi", () => { pages: [{ count: 23, id: "1" }] }) ) - expect(fetcher.lastUrlQueryString()).toEqual("department=6&limit=10&q=test") + expect(fetcher.lastUrlQueryString()).toEqual( + "department=6&limit=10&offset=0&q=test" + ) await fetcher.waitForFetch("2") expect(result.current).toEqual( expect.objectContaining({ @@ -254,10 +258,10 @@ describe("useInfiniteSearchApi", () => { const { result } = renderHook(useInfiniteSearch, { initialProps: { params: { - queryText: "test", - activeFacets: { department: ["6", "8"] }, - endpoint: "resources" + q: "test", + department: ["6", "8"] }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch } @@ -279,10 +283,9 @@ describe("useInfiniteSearchApi", () => { const { result, rerender } = renderHook(useInfiniteSearch, { initialProps: { params: { - queryText: "one", - activeFacets: {}, - endpoint: "resources" + q: "one" }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch } @@ -290,10 +293,9 @@ describe("useInfiniteSearchApi", () => { const resolveFirst = fetcher.resolve rerender({ params: { - queryText: "two", - activeFacets: {}, - endpoint: "resources" + q: "two" }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch }) @@ -335,10 +337,9 @@ describe("useInfiniteSearchApi", () => { const { rerender } = renderHook(useInfiniteSearch, { initialProps: { params: { - queryText: "one", - activeFacets: {}, - endpoint: "resources" + q: "one" }, + endpoint: "resources", baseUrl: "https://example.com", makeRequest: fetcher.fetch } @@ -348,44 +349,12 @@ describe("useInfiniteSearchApi", () => { ) rerender({ params: { - queryText: "one", - activeFacets: {}, - endpoint: "content_files" + q: "one" }, + endpoint: "content_files", baseUrl: "https://example.com", makeRequest: fetcher.fetch }) expect(fetcher.lastUrl().pathname).toBe("/api/v1/content_file_search/") }) - - test.each([ - { endpoint: "resources", expected: ["department", "course_feature"] }, - { - endpoint: "content_files", - expected: ["offered_by", "content_feature_type"] - } - ] as const)( - "Makes requests with aggregations based on endpoint", - async ({ expected, endpoint }) => { - const fetcher = getDefferedFetcher({ count: 23 }) - renderHook(useInfiniteSearch, { - initialProps: { - params: { - queryText: "one", - activeFacets: {}, - endpoint - }, - baseUrl: "https://example.com", - makeRequest: fetcher.fetch, - aggregations: { - resources: ["department", "course_feature"], - content_files: ["offered_by", "content_feature_type"] - } - } - }) - expect(fetcher.lastUrl().searchParams.get("aggregations")).toEqual( - expected.join(",") - ) - } - ) }) diff --git a/src/hooks/useInfiniteSearch.ts b/src/hooks/useInfiniteSearch.ts index 179ec57..beb0f00 100644 --- a/src/hooks/useInfiniteSearch.ts +++ b/src/hooks/useInfiniteSearch.ts @@ -1,11 +1,13 @@ import { useCallback, useEffect, useRef, useState } from "react" -import type { SearchParams } from "./configs" import { getSearchUrl } from "./util" -import type { - SearchResponse, - ContentFileSearchRetrieveAggregationsEnum as ContentFileAggregationsEnum, - LearningResourcesSearchRetrieveAggregationsEnum as ResourceAggregationsEnum -} from "../open_api_generated" +import type { Endpoint } from "./util" +import type { v1 } from "@mitodl/open-api-axios" + +type ResourceSearchRequest = + v1.LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest +type ContentFileSearchRequest = + v1.ContentFileSearchApiContentFileSearchRetrieveRequest +type SearchResponse = v1.LearningResourceSearchResponse type Status = "pending" | "error" | "success" @@ -18,16 +20,12 @@ type UseInfiniteSearchResult = { fetchNextPage: () => Promise } -type AggregationsConfig = { - resources: ResourceAggregationsEnum[] - content_files: ContentFileAggregationsEnum[] -} - type UseInfiniteSearchProps = { /** * Search parameters to use for API request. */ - params: SearchParams + params: ResourceSearchRequest | ContentFileSearchRequest + endpoint: Endpoint /** * The base URL for the API. */ @@ -36,10 +34,6 @@ type UseInfiniteSearchProps = { * The number of items to fetch per page. */ limit?: number - /** - * Object including the aggregations to be used for each endpoint. - */ - aggregations?: AggregationsConfig /** * A function which makes a request to API and returns a promise that resolves * to `{ data: }`. Optional. Defaults to an implementation that @@ -76,10 +70,10 @@ interface TracksCalled { */ const useInfiniteSearch = ({ params, + endpoint, limit = DEFAULT_LIMIT, makeRequest = defaultMakeRequest, baseUrl, - aggregations, keepPreviousData }: UseInfiniteSearchProps): UseInfiniteSearchResult => { const [nextPage, setNextPage] = useState(0) @@ -96,14 +90,13 @@ const useInfiniteSearch = ({ const getPageUrl = useCallback( (page: number) => { const offset = page * limit - return getSearchUrl(baseUrl, { - limit, - offset, + return getSearchUrl(baseUrl, endpoint, { ...params, - aggregations: aggregations?.[params.endpoint] ?? [] + limit, + offset }) }, - [aggregations, baseUrl, limit, params] + [baseUrl, limit, params, endpoint] ) const fetchNextPage: TracksCalled = useCallback(async () => { diff --git a/src/hooks/useSearchQueryParams.test.tsx b/src/hooks/useSearchQueryParams.test.tsx deleted file mode 100644 index 274201e..0000000 --- a/src/hooks/useSearchQueryParams.test.tsx +++ /dev/null @@ -1,448 +0,0 @@ -/* eslint-disable prefer-template */ -import React from "react" -import { renderHook, act } from "@testing-library/react-hooks/dom" -import useSearchQueryParams from "./useSearchQueryParams" -import type { - UseSearchQueryParamsProps, - UseSearchQueryParamsResult -} from "./useSearchQueryParams" -import type { Endpoint, SearchParams } from "./configs" - -const setup = ({ - initial = "", - props -}: { - props?: Omit - initial: string | URLSearchParams -}) => { - const searchParamsRef: React.MutableRefObject = { - current: new URLSearchParams(initial) - } - const useTestHook = () => { - /** - * Usually these would be passed to `useSearchQueryParams` via a routing - * library, e.g., React Router's `useSearchParams` hook. - */ - const [searchParams, setSearchParams] = React.useState( - searchParamsRef.current - ) - searchParamsRef.current = searchParams - return useSearchQueryParams({ searchParams, setSearchParams, ...props }) - } - const result = renderHook(useTestHook) - return { - ...result, - searchParams: searchParamsRef - } -} - -const assertParamsExtracted = ( - initial: string | URLSearchParams, - expected: UseSearchQueryParamsResult["params"], - props?: Omit -) => { - const { result, searchParams } = setup({ initial, props }) - expect(result.current.params).toEqual(expected) - // Search params not modified - expect(searchParams.current).toEqual(new URLSearchParams(initial)) -} - -test("Extracts expected facets from the given URLSearchParams for endpoint=resources", () => { - // resource type - assertParamsExtracted("?r=course&r=podcast", { - queryText: "", - activeFacets: { resource_type: ["course", "podcast"] }, - endpoint: "resources" - }) - // department - assertParamsExtracted("?r=course&d=6&d=8", { - queryText: "", - activeFacets: { - resource_type: ["course"], - department: ["6", "8"] - }, - endpoint: "resources" - }) - // level - assertParamsExtracted("?l=noncredit&r=program&l=high_school", { - queryText: "", - activeFacets: { - resource_type: ["program"], - level: ["noncredit", "high_school"] - }, - endpoint: "resources" - }) - - // platform - assertParamsExtracted("?l=noncredit&p=ocw&p=mitxonline", { - queryText: "", - activeFacets: { - platform: ["ocw", "mitxonline"], - level: ["noncredit"] - }, - endpoint: "resources" - }) - // offered by - assertParamsExtracted("?l=graduate&o=bootcamps&o=xpro", { - queryText: "", - activeFacets: { - offered_by: ["bootcamps", "xpro"], - level: ["graduate"] - }, - endpoint: "resources" - }) - // topics - assertParamsExtracted("?l=graduate&t=python&t=javascript", { - queryText: "", - activeFacets: { - topic: ["python", "javascript"], - level: ["graduate"] - }, - endpoint: "resources" - }) -}) - -test("Extracts boolean facet values correctly", () => { - assertParamsExtracted("?l=graduate&c=true", { - queryText: "", - activeFacets: { - level: ["graduate"], - certification: true - }, - endpoint: "resources" - }) - - assertParamsExtracted("?l=graduate&pr=true", { - queryText: "", - activeFacets: { - level: ["graduate"], - professional: true - }, - endpoint: "resources" - }) -}) - -test("Ignores invalid facet values", () => { - const initial = new URLSearchParams([ - ...Object.entries({ - r: "course", - d: "6", - l: "noncredit", - p: "ocw", - o: "ocw", - t: "python", - c: "true", - pr: "true" - }), - ...Object.entries({ - r: "bogus", - d: "bogus", - l: "bogus", - p: "bogus", - o: "bogus", - t: "all-topics-allowed", - c: "bogus", - pr: "bogus", - cats: "bogus-key-and-value", - dogs: "bogus-key-and-value" - }) - ]) - assertParamsExtracted(initial, { - queryText: "", - activeFacets: { - resource_type: ["course"], - department: ["6"], - level: ["noncredit"], - platform: ["ocw"], - offered_by: ["ocw"], - topic: ["python", "all-topics-allowed"], - certification: true, - professional: true - }, - endpoint: "resources" - }) -}) - -test.each([ - { - initial: "?d=6&cf=whatever&e=resources", - expectedFacets: { course_feature: ["whatever"], department: ["6"] }, - expectedEndpoint: "resources" - }, - { - initial: "?r=course&d=6&cf=whatever&e=content_files", - expectedFacets: { content_feature_type: ["whatever"] }, - expectedEndpoint: "content_files" - } -])( - "Ignores / keeps facets based on endpoint", - ({ initial, expectedFacets, expectedEndpoint }) => { - assertParamsExtracted(initial, { - queryText: "", - activeFacets: expectedFacets as SearchParams["activeFacets"], - endpoint: expectedEndpoint as Endpoint - }) - } -) - -test("Ignores / keeps sort values based on endpoint", () => { - assertParamsExtracted("?d=6&s=mitcoursenumber", { - endpoint: "resources", - activeFacets: { department: ["6"] }, - sort: "mitcoursenumber", - queryText: "" - }) - - assertParamsExtracted("?r=course&e=resources&s=-resource_readable_id", { - endpoint: "resources", - activeFacets: { resource_type: ["course"] }, - // sort: "-resource_readable_id", // not valid for resources - queryText: "" - }) - - assertParamsExtracted( - "?s=-resource_readable_id&d=6&cf=whatever&e=content_files", - { - endpoint: "content_files", - activeFacets: { content_feature_type: ["whatever"] }, - sort: "-resource_readable_id", - queryText: "" - } - ) - - assertParamsExtracted("?p=ocw&s=mitcoursenumber&e=content_files", { - activeFacets: { platform: ["ocw"] }, - endpoint: "content_files", - // sort: "mitcoursenumber", // invalid for content_files - queryText: "" - }) -}) - -test("Query text is extracted correctly", () => { - assertParamsExtracted("?q=python", { - queryText: "python", - activeFacets: {}, - endpoint: "resources" - }) - - assertParamsExtracted("?q=python&q=javascript", { - queryText: "python", - activeFacets: {}, - endpoint: "resources" - }) - - assertParamsExtracted("?q=python&q=javascript&e=content_files", { - queryText: "python", - activeFacets: {}, - endpoint: "content_files" - }) -}) - -test("Setting current text does not affect query parameters at all", () => { - const initial = "?r=course&d=6&q=python" - const { result, searchParams } = setup({ initial }) - expect(result.current.params).toEqual({ - queryText: "python", - activeFacets: { - resource_type: ["course"], - department: ["6"] - }, - endpoint: "resources" - }) - - const params0 = result.current.params - - act(() => { - result.current.setCurrentText("javascript") - }) - - // current text has been updated - expect(result.current.currentText).toBe("javascript") - // params still equal - expect(result.current.params).toEqual({ - queryText: "python", - activeFacets: { - resource_type: ["course"], - department: ["6"] - }, - endpoint: "resources" - }) - // and equal by reerence - expect(result.current.params).toBe(params0) - // URLSearchParams not modified - expect(searchParams.current).toEqual(new URLSearchParams(initial)) -}) - -test("Setting queryText updates current text and search params", async () => { - const initial = "?r=course&d=6&q=python" - const { result, searchParams } = setup({ initial }) - - act(() => { - result.current.setCurrentTextAndQuery("javascript") - }) - - expect(result.current.currentText).toBe("javascript") - expect(searchParams.current).toEqual( - new URLSearchParams("?d=6&q=javascript&r=course") - ) -}) - -test("Setting sort updates search params", () => { - const initial = "?r=course&d=6&q=python" - const { result, searchParams } = setup({ initial }) - - act(() => { - result.current.setSort("mitcoursenumber") - }) - expect(searchParams.current).toEqual( - new URLSearchParams("?d=6&q=python&r=course&s=mitcoursenumber") - ) -}) - -test.each([ - { - initial: "?r=course&d=6", - expected: new URLSearchParams("?d=6&r=course&r=program") - }, - { - initial: "?d=6", - expected: new URLSearchParams("?d=6&r=program") - }, - { - initial: "?d=6&r=program", - expected: new URLSearchParams("?d=6&r=program") - } -])("Turning a facet on with setFacetActive", ({ initial, expected }) => { - const { result, searchParams } = setup({ initial }) - act(() => { - result.current.setFacetActive("resource_type", "program", true) - }) - expect(searchParams.current).toEqual(expected) -}) - -test.each([ - { - initial: "?r=course&r=program&d=6", - expected: new URLSearchParams("?d=6&r=course") - }, - { - initial: "?d=6", - expected: new URLSearchParams("?d=6") - }, - { - initial: "?d=6&r=program", - expected: new URLSearchParams("?d=6") - } -])("Turning a facet off with setFacetActive", ({ initial, expected }) => { - const { result, searchParams } = setup({ initial }) - act(() => { - result.current.setFacetActive("resource_type", "program", false) - }) - expect(searchParams.current).toEqual(expected) -}) - -test.each([ - { - initial: "?r=course", - expected: new URLSearchParams("?c=true&r=course") - }, - { - initial: "?r=course&c=true", - expected: new URLSearchParams("?c=true&r=course") - } -])( - "Turning a boolean facet on with setFacetActive", - ({ initial, expected }) => { - const { result, searchParams } = setup({ initial }) - act(() => { - result.current.setFacetActive("certification", "irrelevant", true) - }) - expect(searchParams.current).toEqual(expected) - } -) - -test.each([ - { - initial: "?r=course", - expected: new URLSearchParams("?r=course") - }, - { - initial: "?r=course&c=true", - expected: new URLSearchParams("?r=course") - } -])( - "Turning a boolean facet off with setFacetActive", - ({ initial, expected }) => { - const { result, searchParams } = setup({ initial }) - act(() => { - result.current.setFacetActive("certification", "irrelevant", false) - }) - expect(searchParams.current).toEqual(expected) - } -) - -test.each([ - { - initial: "?d=6", - expected: "?d=6&e=content_files", - endpoint: "content_files", - props: undefined - }, - { - initial: "?d=6", - expected: "?d=6", - endpoint: "invalid", - props: undefined - }, - { - initial: "?d=6&e=content_files", - expected: "?d=6", - endpoint: "resources", - props: undefined - }, - { - initial: "?d=6&e=resources", - expected: "?d=6", - endpoint: "content_files", - props: { defaultEndpoint: "content_files" } - }, - { - initial: "?d=6&e=content_Files", - expected: "?d=6", - endpoint: "resources", - props: { defaultEndpoint: "resources" } - } -] as const)( - "Changing endpoint updates search params", - ({ initial, expected, endpoint, props }) => { - const { result, searchParams } = setup({ initial, props }) - act(() => { - result.current.setEndpoint(endpoint) - }) - expect(searchParams.current).toEqual(new URLSearchParams(expected)) - } -) - -test("clearFacets clears all facets", () => { - const { result, searchParams } = setup({ - initial: "?r=course&d=6&q=python&x=irrelevant" - }) - act(() => { - result.current.clearFacets() - }) - expect(searchParams.current).toEqual( - new URLSearchParams("?q=python&x=irrelevant") - ) -}) - -test("clearFacet clears specified facet", () => { - const { result, searchParams } = setup({ - initial: "?r=course&d=6&q=python&x=irrelevant" - }) - act(() => { - result.current.clearFacet("resource_type") - }) - expect(searchParams.current).toEqual( - new URLSearchParams("?d=6&q=python&x=irrelevant") - ) -}) diff --git a/src/hooks/useSearchQueryParams.ts b/src/hooks/useSearchQueryParams.ts deleted file mode 100644 index 87a60aa..0000000 --- a/src/hooks/useSearchQueryParams.ts +++ /dev/null @@ -1,284 +0,0 @@ -import { useCallback, useMemo, useRef, useState } from "react" -import { isEqual } from "lodash" -import { ENDPOINT_ALIAS, QUERY_TEXT_ALIAS, searchParamConfig } from "./configs" -import type { Endpoint, SearchParams, FacetName } from "./configs" - -interface UseSearchQueryParamsResult { - /** - * Object containing parameters to be used in a search request. Calculated - * based solely on UrlSearchParams. - * - * Note: The `params.endpoint` value determines what facets are available. - */ - params: SearchParams - /** - * The current text to display in search input. This may be different from - * `params.queryText` if the user has typed in the search input but not yet - * submitted the search. - */ - currentText: string - /** - * Modifies the UrlSearchParams, updating the portion of UrlSearchParams that - * corresponds to specified facet. - */ - setFacetActive: ( - /** - * Facet name. E.g., "department", "level", etc. - */ - name: string, - /** - * Facet value. E.g., "6", "8", etc. - * - * For boolean facets, this value is ignored and the facet state (true or - * false) is determined solely by the `checked` parameter. - */ - value: string, - /** - * Whether the facet should be active or inactive. - */ - checked: boolean - ) => void - /** - * Modifies the current UrlSearchParams to clear all facets according to the - * current endpoint. - */ - clearFacets: () => void - /** - * Modifies the current UrlSearchParams to clear the specified facet. - */ - clearFacet: (name: string) => void - /** - * Sets the current text to display in the search input. Does NOT affect the - * params object. - */ - setCurrentText: (value: string) => void - /** - * Modifies the current UrlSearchParams; sets the current text to display in - * the search input AND updates portion of UrlSearchParams corresponding to - * `params.queryText`. - */ - setCurrentTextAndQuery: (value: string) => void - /** - * Modifies the current UrlSearchParams, updating the portion of UrlSearchParams - * that corresponds to sort value. Valid values are determined by the current - * endpoint. - */ - setSort: (value: string | null) => void - /** - * Modifies the current UrlSearchParams, updating the portion of UrlSearchParams - * that corresponds to the endpoint. - */ - setEndpoint: (value: string) => void -} - -interface UseSearchQueryParamsProps { - /** - * Source of truth for search parameters. - * - * Note: React should be aware of the state of this object. For example, - * do NOT pass `new UrlSearchParams(window.location.search)` directly. - * Instead, use `useSearchParams` hook from `react-router-dom` or equivalent. - */ - searchParams: URLSearchParams - /** - * A setter for `searchParams`. - */ - setSearchParams: ( - value: URLSearchParams | ((prev: URLSearchParams) => URLSearchParams) - ) => void - /** - * Default search endpoint. - */ - defaultEndpoint?: Endpoint -} - -const getEndpoint = ( - searchParams: URLSearchParams, - defaultEndpoint: Endpoint -): Endpoint => { - const endpoint = searchParams.get(ENDPOINT_ALIAS) ?? defaultEndpoint - if (Object.keys(searchParamConfig).includes(endpoint)) { - return endpoint as Endpoint - } - return defaultEndpoint -} - -/** - * Returns search API parameters derived from UrlSearchParameters, along with - * functions to modify the UrlSearchParams. - */ -const useSearchQueryParams = ({ - searchParams, - setSearchParams, - defaultEndpoint = "resources" -}: UseSearchQueryParamsProps): UseSearchQueryParamsResult => { - const endpoint = getEndpoint(searchParams, defaultEndpoint) - const queryText = searchParams.get(QUERY_TEXT_ALIAS) ?? "" - const [currentText, setCurrentText] = useState(queryText) - - const activeFacetsRef = useRef< - UseSearchQueryParamsResult["params"]["activeFacets"] - >({}) - const activeFacets = useMemo(() => { - const active = Object.entries(searchParamConfig[endpoint].facets).reduce( - (acc, [facet, { isValid, alias, isBoolean }]) => { - const values = searchParams.getAll(alias) - const valid = values.filter(v => isValid(v)) - if (valid.length === 0) return acc - if (isBoolean) { - acc[facet] = true - } else { - acc[facet] = valid - } - return acc - }, - {} as Record - ) as UseSearchQueryParamsResult["params"]["activeFacets"] - if (isEqual(activeFacetsRef.current, active)) { - return activeFacetsRef.current - } - return active - }, [endpoint, searchParams]) - - const sort = searchParams.get(searchParamConfig[endpoint].sort.alias) ?? "" - const params = useMemo(() => { - const value: UseSearchQueryParamsResult["params"] = { - endpoint, - activeFacets, - queryText - } - if (sort && searchParamConfig[endpoint].sort.isValid(sort)) { - value.sort = sort as UseSearchQueryParamsResult["params"]["sort"] - } - return value - }, [activeFacets, endpoint, queryText, sort]) - - const setSort = useCallback( - (value: string | null) => { - setSearchParams(prev => { - const next = new URLSearchParams(prev) - const { alias, isValid } = searchParamConfig[endpoint].sort - if (value === null) { - next.delete(alias) - } else if (isValid(value)) { - next.set(alias, value) - } else { - return prev - } - next.sort() - return next - }) - }, - [endpoint, setSearchParams] - ) - const setCurrentTextAndQuery = useCallback( - (value: string) => { - setSearchParams(prev => { - const next = new URLSearchParams(prev) - if (value) { - next.set(QUERY_TEXT_ALIAS, value) - } else { - next.delete(QUERY_TEXT_ALIAS) - } - next.sort() - return next - }) - setCurrentText(value) - }, - [setSearchParams] - ) - const setFacetActive = useCallback( - (facet: string, value: string, checked: boolean) => { - const config = searchParamConfig[endpoint]["facets"][facet as FacetName] - if (!config) return - const { isValid, alias, isBoolean } = config - setSearchParams(prev => { - const next = new URLSearchParams(prev) - const facetValues = next.getAll(alias) - if (isBoolean) { - if (checked) { - next.set(alias, "true") - } else { - next.delete(alias) - } - next.sort() - return next - } - if (!isValid(value)) return prev - const exists = facetValues.includes(value) - if ((exists && checked) || (!exists && !checked)) return prev - if (checked) { - next.append(alias, value) - } else { - next.delete(alias) - facetValues.forEach(v => { - if (v !== value) { - next.append(alias, v) - } - }) - } - next.sort() - return next - }) - }, - [endpoint, setSearchParams] - ) - - const clearFacet: UseSearchQueryParamsResult["clearFacet"] = useCallback( - name => { - const config = searchParamConfig[endpoint]["facets"][name as FacetName] - if (!config) return - setSearchParams(prev => { - const next = new URLSearchParams(prev) - next.delete(config.alias) - next.sort() - return next - }) - }, - [endpoint, setSearchParams] - ) - - const setEndpoint = useCallback( - (value: string) => { - if (!Object.keys(searchParamConfig).includes(value)) return - setSearchParams(prev => { - const next = new URLSearchParams(prev) - if (value === defaultEndpoint) { - next.delete(ENDPOINT_ALIAS) - } else { - next.set(ENDPOINT_ALIAS, value) - } - next.sort() - return next - }) - }, - [defaultEndpoint, setSearchParams] - ) - - const clearFacets = useCallback(() => { - setSearchParams(prev => { - const next = new URLSearchParams(prev) - Object.values(searchParamConfig[endpoint].facets).forEach(({ alias }) => { - next.delete(alias) - }) - next.sort() - return next - }) - }, [endpoint, setSearchParams]) - - const result: UseSearchQueryParamsResult = { - params, - currentText, - setCurrentText, - setFacetActive, - setCurrentTextAndQuery, - setSort, - setEndpoint, - clearFacets, - clearFacet - } - return result -} - -export default useSearchQueryParams -export type { UseSearchQueryParamsResult, UseSearchQueryParamsProps } diff --git a/src/hooks/useValidatedSearchParams.test.tsx b/src/hooks/useValidatedSearchParams.test.tsx new file mode 100644 index 0000000..7c5e134 --- /dev/null +++ b/src/hooks/useValidatedSearchParams.test.tsx @@ -0,0 +1,390 @@ +/* eslint-disable prefer-template */ +import React from "react" +import { renderHook, act } from "@testing-library/react-hooks/dom" +import { useResourceSearchParams } from "./useValidatedSearchParams" +import type { + UseResourceSearchParamsProps, + UseResourceSearchParamsResult +} from "./useValidatedSearchParams" + +describe("useResourceSearchParams", () => { + const setup = ({ + initial = "", + props + }: { + props?: Omit< + UseResourceSearchParamsProps, + "searchParams" | "setSearchParams" + > + initial: string | URLSearchParams + }) => { + const searchParamsRef: React.MutableRefObject = { + current: new URLSearchParams(initial) + } + const useTestHook = () => { + /** + * Usually these would be passed to `useSearchQueryParams` via a routing + * library, e.g., React Router's `useSearchParams` hook. + */ + const [searchParams, setSearchParams] = React.useState( + searchParamsRef.current + ) + searchParamsRef.current = searchParams + return useResourceSearchParams({ + searchParams, + setSearchParams, + ...props + }) + } + const result = renderHook(useTestHook) + return { + ...result, + searchParams: searchParamsRef + } + } + + const assertParamsExtracted = ( + initial: string | URLSearchParams, + expected: UseResourceSearchParamsResult["params"], + props?: Omit< + UseResourceSearchParamsProps, + "searchParams" | "setSearchParams" + > + ) => { + const { result, searchParams } = setup({ initial, props }) + expect(result.current.params).toEqual(expected) + // Search params not modified + expect(searchParams.current).toEqual(new URLSearchParams(initial)) + } + + test("Extracts expected params from the given URLSearchParams", () => { + // resource type + assertParamsExtracted("?resource_type=course&resource_type=podcast", { + resource_type: ["course", "podcast"] + }) + // department + assertParamsExtracted("?resource_type=course&department=6&department=8", { + resource_type: ["course"], + department: ["6", "8"] + }) + // level + assertParamsExtracted( + "?level=noncredit&resource_type=program&level=high_school", + { + resource_type: ["program"], + level: ["noncredit", "high_school"] + } + ) + // platform + assertParamsExtracted("?level=noncredit&platform=ocw&platform=mitxonline", { + platform: ["ocw", "mitxonline"], + level: ["noncredit"] + }) + // offered by and q + assertParamsExtracted( + "?level=graduate&offered_by=bootcamps&offered_by=xpro&q=meow", + { + q: "meow", + offered_by: ["bootcamps", "xpro"], + level: ["graduate"] + } + ) + // topics and sortby + assertParamsExtracted( + "?level=graduate&topic=python&topic=javascript&sortby=mitcoursenumber", + { + topic: ["python", "javascript"], + sortby: "mitcoursenumber", + level: ["graduate"] + } + ) + }) + + test("Extracts boolean facet values correctly", () => { + assertParamsExtracted("?level=graduate&certification=true", { + level: ["graduate"], + certification: true + }) + + assertParamsExtracted("?level=graduate&professional=true", { + level: ["graduate"], + professional: true + }) + }) + + test("Ignores invalid facet values", () => { + const initial = new URLSearchParams([ + ...Object.entries({ + resource_type: "course", + department: "6", + level: "noncredit", + platform: "ocw", + offered_by: "ocw", + topic: "python", + certification: "true", + professional: "true" + }), + ...Object.entries({ + resource_type: "bogus", + department: "bogus", + level: "bogus", + platform: "bogus", + offered_by: "bogus", + topic: "all-topics-allowed", + certification: "bogus", + proessional: "bogus", + sortby: "bogus", + cats: "bogus-key-and-value", + dogs: "bogus-key-and-value" + }) + ]) + assertParamsExtracted(initial, { + resource_type: ["course"], + department: ["6"], + level: ["noncredit"], + platform: ["ocw"], + offered_by: ["ocw"], + topic: ["python", "all-topics-allowed"], + certification: true, + professional: true + }) + }) + + test("Setting current text does not affect query parameters at all", () => { + const initial = "?resource_type=course&department=6&q=python" + const { result, searchParams } = setup({ initial }) + expect(result.current.params).toEqual({ + q: "python", + resource_type: ["course"], + department: ["6"] + }) + + const params0 = result.current.params + + act(() => { + result.current.setCurrentText("javascript") + }) + + // current text has been updated + expect(result.current.currentText).toBe("javascript") + // params still equal + expect(result.current.params).toEqual({ + q: "python", + resource_type: ["course"], + department: ["6"] + }) + // and equal by reerence + expect(result.current.params).toBe(params0) + // URLSearchParams not modified + expect(searchParams.current).toEqual(new URLSearchParams(initial)) + }) + + test("Setting queryText updates current text and search params", async () => { + const initial = "?resource_type=course&department=6&q=python" + const { result, searchParams } = setup({ initial }) + + act(() => { + result.current.setCurrentTextAndQuery("javascript") + }) + + expect(result.current.currentText).toBe("javascript") + expect(searchParams.current).toEqual( + new URLSearchParams("?department=6&q=javascript&resource_type=course") + ) + }) + + test.each([ + { + initial: "?resource_type=course&department=6", + expected: new URLSearchParams( + "?department=6&resource_type=course&resource_type=program" + ) + }, + { + initial: "?department=6", + expected: new URLSearchParams("?department=6&resource_type=program") + }, + { + initial: "?department=6&resource_type=program", + expected: new URLSearchParams("?department=6&resource_type=program") + } + ])( + "Turning a param value on with toggleParamValue", + ({ initial, expected }) => { + const { result, searchParams } = setup({ initial }) + act(() => { + result.current.toggleParamValue("resource_type", "program", true) + }) + expect(searchParams.current).toEqual(expected) + } + ) + + test.each([ + { + initial: "?resource_type=course&resource_type=program&department=6", + expected: new URLSearchParams("?department=6&resource_type=course") + }, + { + initial: "?department=6", + expected: new URLSearchParams("?department=6") + }, + { + initial: "?department=6&resource_type=program", + expected: new URLSearchParams("?department=6") + } + ])("Turning a param off with toggleParamValue", ({ initial, expected }) => { + const { result, searchParams } = setup({ initial }) + act(() => { + result.current.toggleParamValue("resource_type", "program", false) + }) + expect(searchParams.current).toEqual(expected) + }) + + test.each([ + { + initial: "?resource_type=course", + value: "true", + expected: new URLSearchParams("?certification=true&resource_type=course") + }, + { + initial: "?resource_type=course", + value: "false", + expected: new URLSearchParams("?certification=false&resource_type=course") + }, + { + initial: "?resource_type=course&certification=true", + value: "true", + expected: new URLSearchParams("?certification=true&resource_type=course") + } + ])( + "Turning a boolean param on with toggleParamValue", + ({ initial, expected, value }) => { + const { result, searchParams } = setup({ initial }) + act(() => { + result.current.toggleParamValue("certification", value, true) + }) + searchParams.current.sort() + expect(searchParams.current).toEqual(expected) + } + ) + + test.each([ + { + initial: "?resource_type=course", + value: "true", + expected: new URLSearchParams("?resource_type=course") + }, + { + initial: "?resource_type=course&certification=true", + value: "true", + expected: new URLSearchParams("?resource_type=course") + } + ])( + "Turning a boolean param off with toggleParamValue", + ({ initial, expected, value }) => { + const { result, searchParams } = setup({ initial }) + act(() => { + result.current.toggleParamValue("certification", value, false) + }) + searchParams.current.sort() + expect(searchParams.current).toEqual(expected) + } + ) + + test.each([ + { + initial: + "?resource_type=course&department=6&department=8&q=python&x=irrelevant", + facets: ["department"], + expected: new URLSearchParams( + "?q=python&resource_type=course&x=irrelevant" + ) + }, + { + initial: + "?resource_type=course&department=6&department=8&q=python&x=irrelevant", + facets: ["department", "resource_type"], + expected: new URLSearchParams("?q=python&x=irrelevant") + } + ])("clearFacets clears all facets", ({ initial, facets, expected }) => { + const props = { facets } as Omit< + UseResourceSearchParamsProps, + "searchParams" | "setSearchParams" + > + const { result, searchParams } = setup({ initial, props }) + act(() => { + result.current.clearAllFacets() + }) + searchParams.current.sort() + expect(searchParams.current).toEqual(expected) + }) + + test("clearParam clears specified parameter", () => { + const { result, searchParams } = setup({ + initial: "?resource_type=course&department=6&q=python&x=irrelevant" + }) + act(() => { + result.current.clearParam("resource_type") + }) + expect(searchParams.current).toEqual( + new URLSearchParams("?department=6&q=python&x=irrelevant") + ) + }) + + test("patchParams updates search params", () => { + const { result, searchParams } = setup({ + initial: + "?resource_type=course&department=6&q=python&x=irrelevant&topic=javascript" + }) + act(() => { + result.current.patchParams({ + resource_type: ["program"], + department: ["8", "18"], + topic: [] + }) + }) + searchParams.current.sort() + expect(searchParams.current).toEqual( + new URLSearchParams([ + ["department", "8"], + ["department", "18"], + ["q", "python"], + ["resource_type", "program"], + ["x", "irrelevant"] + ]) + ) + }) + + test("onFacetChange is called when a facet value is changed", () => { + const onFacetsChange = jest.fn() + const { result } = setup({ + initial: "?resource_type=course&department=6&topic=quantum", + props: { onFacetsChange, facets: ["department", "topic"] } + }) + expect(onFacetsChange).toHaveBeenCalledTimes(0) + act(() => { + result.current.toggleParamValue("department", "6", false) + }) + expect(onFacetsChange).toHaveBeenCalledTimes(1) + act(() => { + result.current.patchParams({ department: ["8"] }) + }) + expect(onFacetsChange).toHaveBeenCalledTimes(2) + act(() => { + result.current.clearParam("topic") + }) + expect(onFacetsChange).toHaveBeenCalledTimes(3) + + // resource_type is not a facet in this case, so: + act(() => { + result.current.toggleParamValue("resource_type", "program", true) + }) + act(() => { + result.current.clearParam("resource_type") + }) + act(() => { + result.current.patchParams({ resource_type: ["podcast"] }) + }) + expect(onFacetsChange).toHaveBeenCalledTimes(3) + }) +}) diff --git a/src/hooks/useValidatedSearchParams.ts b/src/hooks/useValidatedSearchParams.ts new file mode 100644 index 0000000..3def582 --- /dev/null +++ b/src/hooks/useValidatedSearchParams.ts @@ -0,0 +1,252 @@ +import { contentSearchValidators, resourceSearchValidators } from "./validation" +import type { QueryParamValidators } from "./validation" +import type { v1 } from "@mitodl/open-api-axios" +import { useCallback, useMemo, useState } from "react" + +type ResourceSearchRequest = + v1.LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest +type ContentFileSearchRequest = + v1.ContentFileSearchApiContentFileSearchRetrieveRequest + +interface UseValidatedSearchParamsProps { + /** + * Source of truth for search parameters. + * + * Note: React should be aware of the state of this object. For example, + * do NOT pass `new UrlSearchParams(window.location.search)` directly. + * Instead, use `useSearchParams` hook from `react-router-dom` or equivalent. + */ + searchParams: URLSearchParams + /** + * A setter for `searchParams`. + */ + setSearchParams: ( + value: URLSearchParams | ((prev: URLSearchParams) => URLSearchParams) + ) => void + /** + * Array of request parameter keys that are considered facets. + * Determs when to call `onFacetsChange` callback and which params are reset + * via clearAllFacets. + */ + facets?: (keyof ReqParams & string)[] + onFacetsChange?: () => void +} + +interface UseValidatedSearchParamsResult { + /** + * Valdiated search request parameters. + */ + params: ReqParams + /** + * Clear all parameters marked as facets. + */ + clearAllFacets: () => void + /** + * Clear a particle parameter by key. + */ + clearParam: (key: keyof ReqParams & string) => void + /** + * Patch the request parameters. + * - missing keys are ignored + * - null or empty values are removed + * - all other values are set (NOT appended). + */ + patchParams: (patch: Partial) => void + /** + * Toggle a parameter value on or off. + * - if `checked=true`, value is APPENDED to parameter list. + * - if `checked=false`, value is REMOVED from parameter list. + */ + toggleParamValue: (name: string, rawValue: string, checked: boolean) => void + /** + * Current search text. May be different from the `q` parameter. + */ + currentText: string + /** + * Set current text. + */ + setCurrentText: (value: string) => void + /** + * Set current text and update the `q` parameter. + */ + setCurrentTextAndQuery: (value: string) => void +} + +const useValidatedSearchParams = ({ + searchParams, + setSearchParams, + facets = [], + validators, + onFacetsChange +}: UseValidatedSearchParamsProps & { + validators: QueryParamValidators +}): UseValidatedSearchParamsResult => { + const params = useMemo(() => { + return Object.keys(validators).reduce((acc, key) => { + const validator = validators[key as keyof ReqParams] + const values = searchParams.getAll(key) + const validated = validator(values) + if (!validated || (Array.isArray(validated) && validated.length === 0)) { + return acc + } + return { ...acc, [key]: validated } + }, {} as ReqParams) + }, [searchParams, validators]) + const clearAllFacets = useCallback(() => { + setSearchParams(current => { + const copy = new URLSearchParams(current) + facets.forEach(f => copy.delete(f)) + copy.sort() + return copy + }) + onFacetsChange?.() + }, [facets, setSearchParams, onFacetsChange]) + const clearParam = useCallback( + (key: keyof ReqParams & string) => { + setSearchParams(current => { + const copy = new URLSearchParams(current) + copy.delete(key) + copy.sort() + return copy + }) + if ((facets as string[]).includes(key)) { + onFacetsChange?.() + } + }, + [setSearchParams, onFacetsChange, facets] + ) + const patchParams = useCallback( + (patch: Partial) => { + setSearchParams(current => { + const copy = new URLSearchParams(current) + Object.entries(patch).forEach(([key, value]) => { + if (value === undefined) return + if ( + value === null || + (Array.isArray(value) && value.length === 0) || + value === "" + ) { + copy.delete(key) + return + } + if (Array.isArray(value)) { + copy.delete(key) + value.forEach(v => copy.append(key, v.toString())) + } else { + copy.set(key, value.toString()) + } + }) + copy.sort() + return copy + }) + if (Object.keys(patch).some(k => (facets as string[]).includes(k))) { + onFacetsChange?.() + } + }, + [setSearchParams, facets, onFacetsChange] + ) + + const toggleParamValue = useCallback( + (name: string, rawValue: string, checked: boolean) => { + const validator = validators[name as keyof ReqParams] + if (!validator) { + console.warn(`Unrecognized search param: ${name}`) + } + const validated = validator([rawValue]) + const value = Array.isArray(validated) ? validated[0] : validated + if (value === undefined || value === null) return + setSearchParams(current => { + const copy = new URLSearchParams(current) + const currentValues = copy.getAll(name) + if (currentValues.includes(rawValue) === checked) return copy + const newValues = checked ? + [...currentValues, rawValue] : + currentValues.filter(v => v !== rawValue) + copy.delete(name) + newValues.forEach(v => copy.append(name, v)) + copy.sort() + return copy + }) + if ((facets as string[]).includes(name)) { + onFacetsChange?.() + } + }, + [setSearchParams, facets, onFacetsChange, validators] + ) + + const [currentText, setCurrentText] = useState(searchParams.get("q") ?? "") + const setCurrentTextAndQuery = useCallback( + (value: string) => { + setSearchParams(prev => { + const next = new URLSearchParams(prev) + if (value) { + next.set("q", value) + } else { + next.delete("q") + } + next.sort() + return next + }) + setCurrentText(value) + }, + [setSearchParams] + ) + + return { + params, + clearAllFacets, + clearParam, + patchParams, + toggleParamValue, + currentText, + setCurrentText, + setCurrentTextAndQuery + } +} + +const useResourceSearchParams = ({ + searchParams, + setSearchParams, + facets = [], + onFacetsChange +}: UseValidatedSearchParamsProps) => { + return useValidatedSearchParams({ + searchParams, + setSearchParams, + facets, + validators: resourceSearchValidators, + onFacetsChange + }) +} + +const useContentFileSearchParams = ({ + searchParams, + setSearchParams, + facets = [], + onFacetsChange +}: UseValidatedSearchParamsProps) => { + return useValidatedSearchParams({ + searchParams, + setSearchParams, + facets, + validators: contentSearchValidators, + onFacetsChange + }) +} + +type UseResourceSearchParamsProps = + UseValidatedSearchParamsProps +type UseContentFileSearchParamsProps = + UseValidatedSearchParamsProps +type UseResourceSearchParamsResult = + UseValidatedSearchParamsResult +type UseContentFileSearchParamsResult = + UseValidatedSearchParamsResult + +export { useResourceSearchParams, useContentFileSearchParams } +export type { + UseResourceSearchParamsProps, + UseContentFileSearchParamsProps, + UseResourceSearchParamsResult, + UseContentFileSearchParamsResult +} diff --git a/src/hooks/util.ts b/src/hooks/util.ts index 4529853..0bf4706 100644 --- a/src/hooks/util.ts +++ b/src/hooks/util.ts @@ -1,4 +1,10 @@ -import type { SearchParams, Endpoint } from "./configs" +import type { v1 } from "@mitodl/open-api-axios" +type ResourceSearchRequest = + v1.LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest +type ContentFileSearchRequest = + v1.ContentFileSearchApiContentFileSearchRetrieveRequest + +type Endpoint = "resources" | "content_files" const endpointUrls: Record = { resources: "api/v1/learning_resources_search/", @@ -7,50 +13,22 @@ const endpointUrls: Record = { export const getSearchUrl = ( baseUrl: string, - { - endpoint, - queryText, - sort, - activeFacets, - aggregations, - limit, - offset - }: SearchParams & { - aggregations: string[] - limit?: number - offset?: number - } + endpoint: Endpoint, + params: ResourceSearchRequest | ContentFileSearchRequest ): string => { const url = new URL(endpointUrls[endpoint], baseUrl) - if (queryText) { - url.searchParams.append("q", queryText) - } - if (offset) { - url.searchParams.append("offset", offset.toString()) - } - - if (limit) { - url.searchParams.append("limit", limit.toString()) - } - - if (sort) { - url.searchParams.append("sortby", sort) - } - - if (aggregations && aggregations.length > 0) { - url.searchParams.append("aggregations", aggregations.join(",")) - } - - if (activeFacets) { - for (const [key, value] of Object.entries(activeFacets)) { - const asArray = Array.isArray(value) ? value : [value] - if (asArray.length > 0) { - url.searchParams.append(key, asArray.join(",")) + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined) { + if (Array.isArray(value)) { + value.forEach(v => url.searchParams.append(key, v)) + } else { + url.searchParams.set(key, value) } } - } - + }) url.searchParams.sort() return url.toString() } + +export type { Endpoint } diff --git a/src/hooks/validation.ts b/src/hooks/validation.ts new file mode 100644 index 0000000..34e1d72 --- /dev/null +++ b/src/hooks/validation.ts @@ -0,0 +1,78 @@ +import { v1 } from "@mitodl/open-api-axios" + +const { + ResourceTypeEnum, + LearningResourcesSearchRetrieveDepartmentEnum: DepartmentEnum, + LearningResourcesSearchRetrieveLevelEnum: LevelEnum, + LearningResourcesSearchRetrievePlatformEnum: PlatformEnum, + LearningResourcesSearchRetrieveOfferedByEnum: OfferedByEnum, + LearningResourcesSearchRetrieveSortbyEnum: SortByEnum, + LearningResourcesSearchRetrieveAggregationsEnum: AggregationsEnum, + ContentFileSearchRetrieveSortbyEnum, + ContentFileSearchRetrieveAggregationsEnum +} = v1 + +type ResourceSearchRequest = + v1.LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest +type ContentFileSearchRequest = + v1.ContentFileSearchApiContentFileSearchRetrieveRequest + +const withinEnum = + (allowed: T[]) => + (values: string[]) => + values.filter(v => (allowed as string[]).includes(v)) as T[] + +const first = (values: string[]) => values[0] +const identity = (v: T) => v +const firstBoolean = (values: string[]): boolean | undefined => { + if (values.includes("true")) return true + if (values.includes("false")) return false + return undefined +} +const numbers = (values: string[]) => + values.map(v => parseInt(v)).filter(Number.isNaN) +const firstNumber = (values: string[]) => numbers(values)[0] + +type QueryParamValidators = { + [k in keyof Required]: (v: string[]) => ReqParams[k] +} + +const resourceSearchValidators: QueryParamValidators = { + resource_type: withinEnum(Object.values(ResourceTypeEnum)), + department: withinEnum(Object.values(DepartmentEnum)), + level: withinEnum(Object.values(LevelEnum)), + platform: withinEnum(Object.values(PlatformEnum)), + offered_by: withinEnum(Object.values(OfferedByEnum)), + sortby: values => withinEnum(Object.values(SortByEnum))(values)[0], + q: first, + topic: identity, + certification: firstBoolean, + professional: firstBoolean, + aggregations: withinEnum(Object.values(AggregationsEnum)), + course_feature: identity, + limit: firstNumber, + offset: firstNumber, + id: numbers +} + +const contentSearchValidators: QueryParamValidators = + { + limit: firstNumber, + offset: firstNumber, + id: numbers, + offered_by: withinEnum(Object.values(OfferedByEnum)), + platform: withinEnum(Object.values(PlatformEnum)), + content_feature_type: identity, + topic: identity, + q: first, + aggregations: withinEnum( + Object.values(ContentFileSearchRetrieveAggregationsEnum) + ), + sortby: values => + withinEnum(Object.values(ContentFileSearchRetrieveSortbyEnum))(values)[0], + resource_id: numbers, + run_id: numbers + } + +export { resourceSearchValidators, contentSearchValidators } +export type { QueryParamValidators } diff --git a/src/index.ts b/src/index.ts index 9112738..e6cbf1b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,31 +23,22 @@ import { Aggregations, GetSearchPageSize } from "./facet_display/types" -import { useEffectAfterMount } from "./hooks" +import { useEffectAfterMount } from "./useEffectAfterMount" export * from "./constants" export * from "./url_utils" -export * from "./open_api_generated/api" export * from "./facet_display/types" export { default as FacetDisplay, + AvailableFacets, getDepartmentName, getLevelName } from "./facet_display/FacetDisplay" export { default as FilterableFacet } from "./facet_display/FilterableFacet" export { sanitizeFacets } from "./facet_display/SanitizeFacets" -export type { - UseInfiniteSearchProps, - UseInfiniteSearchResult -} from "./hooks/useInfiniteSearch" -export type { - UseSearchQueryParamsProps, - UseSearchQueryParamsResult -} from "./hooks/useSearchQueryParams" -export { default as useInfiniteSearch } from "./hooks/useInfiniteSearch" -export { default as useSearchQueryParams } from "./hooks/useSearchQueryParams" +export * from "./hooks" export { buildSearchUrl, SearchQueryParams } from "./search" diff --git a/src/open_api_generated/api.ts b/src/open_api_generated/api.ts deleted file mode 100644 index 855060d..0000000 --- a/src/open_api_generated/api.ts +++ /dev/null @@ -1,17636 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * MIT Open API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v1) - * - * - * 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, - // @ts-ignore - setApiKeyToObject, - // @ts-ignore - setBasicAuthToObject, - // @ts-ignore - setBearerAuthToObject, - // @ts-ignore - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction -} from "./common" -import type { RequestArgs } from "./base" -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - BaseAPI, - // @ts-ignore - RequiredError, - operationServerMap -} from "./base" - -/** - * Serializer for LearningResourceInstructor model - * @export - * @interface Article - */ -export interface Article { - /** - * - * @type {string} - * @memberof Article - */ - html: string - /** - * - * @type {number} - * @memberof Article - */ - id: number - /** - * - * @type {string} - * @memberof Article - */ - title: string -} -/** - * Serializer for LearningResourceInstructor model - * @export - * @interface ArticleRequest - */ -export interface ArticleRequest { - /** - * - * @type {string} - * @memberof ArticleRequest - */ - html: string - /** - * - * @type {string} - * @memberof ArticleRequest - */ - title: string -} -/** - * 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 {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 {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 - */ - image_src?: string | null - /** - * - * @type {string} - * @memberof ContentFile - */ - resource_id: string - /** - * - * @type {string} - * @memberof ContentFile - */ - resource_readable_id: string - /** - * - * @type {string} - * @memberof ContentFile - */ - course_number: string - /** - * - * @type {string} - * @memberof ContentFile - */ - file_type?: string | null - /** - * - * @type {LearningResourceOfferor} - * @memberof ContentFile - */ - offered_by: LearningResourceOfferor - /** - * - * @type {LearningResourcePlatform} - * @memberof ContentFile - */ - platform: LearningResourcePlatform - /** - * - * @type {string} - * @memberof ContentFile - */ - run_readable_id: string -} - -/** - * * `page` - page * `file` - file * `vertical` - vertical - * @export - * @enum {string} - */ - -export const ContentTypeEnum = { - Page: "page", - File: "file", - Vertical: "vertical" -} 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 -} -/** - * 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 -} -/** - * Serializer for course resources - * @export - * @interface CourseResource - */ -export interface CourseResource { - /** - * - * @type {number} - * @memberof CourseResource - */ - id: number - /** - * - * @type {Array} - * @memberof CourseResource - */ - topics?: Array - /** - * - * @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 - /** - * Returns the certification for the learning resource - * @type {boolean} - * @memberof CourseResource - */ - certification: boolean - /** - * Returns the prices for the learning resource - * @type {string} - * @memberof CourseResource - */ - prices: string | null - /** - * - * @type {Array} - * @memberof CourseResource - */ - runs: Array | null - /** - * - * @type {LearningResourceImage} - * @memberof CourseResource - */ - image: LearningResourceImage | null - /** - * - * @type {Array} - * @memberof CourseResource - */ - learning_path_parents: Array | null - /** - * - * @type {Array} - * @memberof CourseResource - */ - user_list_parents: Array | 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 - /** - * - * @type {boolean} - * @memberof CourseResource - */ - professional: boolean -} - -/** - * Serializer for course resources - * @export - * @interface CourseResourceRequest - */ -export interface CourseResourceRequest { - /** - * - * @type {Array} - * @memberof CourseResourceRequest - */ - topics?: Array - /** - * - * @type {string} - * @memberof CourseResourceRequest - */ - readable_id: string - /** - * - * @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 -} -/** - * - * @export - * @enum {string} - */ - -export const CourseResourceResourceTypeEnum = { - Course: "course" -} as const - -export type CourseResourceResourceTypeEnum = - (typeof CourseResourceResourceTypeEnum)[keyof typeof CourseResourceResourceTypeEnum] - -/** - * 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 -} -/** - * Specialized serializer for a LearningPath relationship - * @export - * @interface LearningPathRelationshipRequest - */ -export interface LearningPathRelationshipRequest { - /** - * - * @type {number} - * @memberof LearningPathRelationshipRequest - */ - position?: number - /** - * - * @type {number} - * @memberof LearningPathRelationshipRequest - */ - parent: number - /** - * - * @type {number} - * @memberof LearningPathRelationshipRequest - */ - 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 {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 - /** - * Returns the certification for the learning resource - * @type {boolean} - * @memberof LearningPathResource - */ - certification: boolean - /** - * Returns the prices for the learning resource - * @type {string} - * @memberof LearningPathResource - */ - prices: string | null - /** - * - * @type {Array} - * @memberof LearningPathResource - */ - runs: Array | null - /** - * - * @type {LearningResourceImage} - * @memberof LearningPathResource - */ - image: LearningResourceImage | null - /** - * - * @type {Array} - * @memberof LearningPathResource - */ - learning_path_parents: Array | null - /** - * - * @type {Array} - * @memberof LearningPathResource - */ - user_list_parents: Array | null - /** - * - * @type {LearningPathResourceResourceTypeEnum} - * @memberof LearningPathResource - */ - resource_type: LearningPathResourceResourceTypeEnum - /** - * - * @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 {boolean} - * @memberof LearningPathResource - */ - professional?: 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 {boolean} - * @memberof LearningPathResourceRequest - */ - professional?: boolean -} -/** - * - * @export - * @enum {string} - */ - -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: "learning_path" } & LearningPathResource) - | ({ resource_type: "podcast" } & PodcastResource) - | ({ resource_type: "podcast_episode" } & PodcastEpisodeResource) - | ({ resource_type: "program" } & ProgramResource) - -/** - * Serializer for LearningResourceContentTag - * @export - * @interface LearningResourceContentTag - */ -export interface LearningResourceContentTag { - /** - * - * @type {number} - * @memberof LearningResourceContentTag - */ - id: number - /** - * - * @type {string} - * @memberof LearningResourceContentTag - */ - name: string -} -/** - * Serializer for LearningResourceDepartment - * @export - * @interface LearningResourceDepartment - */ -export interface LearningResourceDepartment { - /** - * - * @type {string} - * @memberof LearningResourceDepartment - */ - department_id: string - /** - * - * @type {string} - * @memberof LearningResourceDepartment - */ - name: string -} -/** - * Serializer for LearningResourceDepartment - * @export - * @interface LearningResourceDepartmentRequest - */ -export interface LearningResourceDepartmentRequest { - /** - * - * @type {string} - * @memberof LearningResourceDepartmentRequest - */ - department_id: string - /** - * - * @type {string} - * @memberof LearningResourceDepartmentRequest - */ - name: string -} -/** - * 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 - * @export - * @interface LearningResourceOfferor - */ -export interface LearningResourceOfferor { - /** - * - * @type {string} - * @memberof LearningResourceOfferor - */ - code: string - /** - * - * @type {string} - * @memberof LearningResourceOfferor - */ - name: string -} -/** - * Serializer for LearningResourceOfferor - * @export - * @interface LearningResourceOfferorRequest - */ -export interface LearningResourceOfferorRequest { - /** - * - * @type {string} - * @memberof LearningResourceOfferorRequest - */ - code: string - /** - * - * @type {string} - * @memberof LearningResourceOfferorRequest - */ - name: string -} -/** - * 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 -} -/** - * 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 -} - -/** - * @type LearningResourceRequest - * @export - */ -export type LearningResourceRequest = - | ({ resource_type: "course" } & CourseResourceRequest) - | ({ resource_type: "learning_path" } & LearningPathResourceRequest) - | ({ resource_type: "podcast" } & PodcastResourceRequest) - | ({ resource_type: "podcast_episode" } & PodcastEpisodeResourceRequest) - | ({ resource_type: "program" } & ProgramResourceRequest) - -/** - * 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 {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 - */ - availability?: 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 -} -/** - * - * @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 - */ - availability?: 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 -} -/** - * Serializer for LearningResourceTopic model - * @export - * @interface LearningResourceTopic - */ -export interface LearningResourceTopic { - /** - * - * @type {number} - * @memberof LearningResourceTopic - */ - id: number - /** - * - * @type {string} - * @memberof LearningResourceTopic - */ - name: string -} -/** - * 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 - * @interface PaginatedArticleList - */ -export interface PaginatedArticleList { - /** - * - * @type {number} - * @memberof PaginatedArticleList - */ - count?: number - /** - * - * @type {string} - * @memberof PaginatedArticleList - */ - next?: string | null - /** - * - * @type {string} - * @memberof PaginatedArticleList - */ - previous?: string | null - /** - * - * @type {Array
} - * @memberof PaginatedArticleList - */ - results?: Array
-} -/** - * - * @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 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 PaginatedLearningResourceOfferorList - */ -export interface PaginatedLearningResourceOfferorList { - /** - * - * @type {number} - * @memberof PaginatedLearningResourceOfferorList - */ - count?: number - /** - * - * @type {string} - * @memberof PaginatedLearningResourceOfferorList - */ - next?: string | null - /** - * - * @type {string} - * @memberof PaginatedLearningResourceOfferorList - */ - previous?: string | null - /** - * - * @type {Array} - * @memberof PaginatedLearningResourceOfferorList - */ - 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 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 -} -/** - * Serializer for LearningResourceInstructor model - * @export - * @interface PatchedArticleRequest - */ -export interface PatchedArticleRequest { - /** - * - * @type {string} - * @memberof PatchedArticleRequest - */ - html?: string - /** - * - * @type {string} - * @memberof PatchedArticleRequest - */ - title?: string -} -/** - * Specialized serializer for a LearningPath relationship - * @export - * @interface PatchedLearningPathRelationshipRequest - */ -export interface PatchedLearningPathRelationshipRequest { - /** - * - * @type {number} - * @memberof PatchedLearningPathRelationshipRequest - */ - position?: number - /** - * - * @type {number} - * @memberof PatchedLearningPathRelationshipRequest - */ - parent?: number - /** - * - * @type {number} - * @memberof PatchedLearningPathRelationshipRequest - */ - 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 {boolean} - * @memberof PatchedLearningPathResourceRequest - */ - professional?: boolean -} -/** - * 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 Podcasts - * @export - * @interface Podcast - */ -export interface Podcast { - /** - * - * @type {number} - * @memberof Podcast - */ - id: number - /** - * Return the number of episodes in the podcast - * @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 - /** - * - * @type {string} - * @memberof PodcastEpisode - */ - transcript?: 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 - */ - 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 {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 - /** - * Returns the certification for the learning resource - * @type {boolean} - * @memberof PodcastEpisodeResource - */ - certification: boolean - /** - * Returns the prices for the learning resource - * @type {string} - * @memberof PodcastEpisodeResource - */ - prices: string | null - /** - * - * @type {Array} - * @memberof PodcastEpisodeResource - */ - runs: Array | null - /** - * - * @type {LearningResourceImage} - * @memberof PodcastEpisodeResource - */ - image: LearningResourceImage | null - /** - * - * @type {Array} - * @memberof PodcastEpisodeResource - */ - learning_path_parents: Array | null - /** - * - * @type {Array} - * @memberof PodcastEpisodeResource - */ - user_list_parents: Array | 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 - /** - * - * @type {boolean} - * @memberof PodcastEpisodeResource - */ - professional: boolean -} - -/** - * Serializer for podcast episode resources - * @export - * @interface PodcastEpisodeResourceRequest - */ -export interface PodcastEpisodeResourceRequest { - /** - * - * @type {Array} - * @memberof PodcastEpisodeResourceRequest - */ - topics?: Array - /** - * - * @type {string} - * @memberof PodcastEpisodeResourceRequest - */ - readable_id: string - /** - * - * @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 -} -/** - * - * @export - * @enum {string} - */ - -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 {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 {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 - /** - * Returns the certification for the learning resource - * @type {boolean} - * @memberof PodcastResource - */ - certification: boolean - /** - * Returns the prices for the learning resource - * @type {string} - * @memberof PodcastResource - */ - prices: string | null - /** - * - * @type {Array} - * @memberof PodcastResource - */ - runs: Array | null - /** - * - * @type {LearningResourceImage} - * @memberof PodcastResource - */ - image: LearningResourceImage | null - /** - * - * @type {Array} - * @memberof PodcastResource - */ - learning_path_parents: Array | null - /** - * - * @type {Array} - * @memberof PodcastResource - */ - user_list_parents: Array | 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 - /** - * - * @type {boolean} - * @memberof PodcastResource - */ - professional: boolean -} - -/** - * Serializer for podcast resources - * @export - * @interface PodcastResourceRequest - */ -export interface PodcastResourceRequest { - /** - * - * @type {Array} - * @memberof PodcastResourceRequest - */ - topics?: Array - /** - * - * @type {string} - * @memberof PodcastResourceRequest - */ - readable_id: string - /** - * - * @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 -} -/** - * - * @export - * @enum {string} - */ - -export const PodcastResourceResourceTypeEnum = { - Podcast: "podcast" -} as const - -export type PodcastResourceResourceTypeEnum = - (typeof PodcastResourceResourceTypeEnum)[keyof typeof PodcastResourceResourceTypeEnum] - -/** - * * `private` - private * `unlisted` - unlisted - * @export - * @enum {string} - */ - -export const PrivacyLevelEnum = { - Private: "private", - Unlisted: "unlisted" -} as const - -export type PrivacyLevelEnum = - (typeof PrivacyLevelEnum)[keyof typeof PrivacyLevelEnum] - -/** - * Serializer for the Program model - * @export - * @interface Program - */ -export interface Program { - /** - * - * @type {Array} - * @memberof Program - */ - courses: Array | null -} -/** - * Serializer for program resources - * @export - * @interface ProgramResource - */ -export interface ProgramResource { - /** - * - * @type {number} - * @memberof ProgramResource - */ - id: number - /** - * - * @type {Array} - * @memberof ProgramResource - */ - topics?: Array - /** - * - * @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 - /** - * Returns the certification for the learning resource - * @type {boolean} - * @memberof ProgramResource - */ - certification: boolean - /** - * Returns the prices for the learning resource - * @type {string} - * @memberof ProgramResource - */ - prices: string | null - /** - * - * @type {Array} - * @memberof ProgramResource - */ - runs: Array | null - /** - * - * @type {LearningResourceImage} - * @memberof ProgramResource - */ - image: LearningResourceImage | null - /** - * - * @type {Array} - * @memberof ProgramResource - */ - learning_path_parents: Array | null - /** - * - * @type {Array} - * @memberof ProgramResource - */ - user_list_parents: Array | 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 - /** - * - * @type {boolean} - * @memberof ProgramResource - */ - professional: boolean -} - -/** - * Serializer for program resources - * @export - * @interface ProgramResourceRequest - */ -export interface ProgramResourceRequest { - /** - * - * @type {Array} - * @memberof ProgramResourceRequest - */ - topics?: Array - /** - * - * @type {string} - * @memberof ProgramResourceRequest - */ - readable_id: string - /** - * - * @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 -} -/** - * - * @export - * @enum {string} - */ - -export const ProgramResourceResourceTypeEnum = { - Program: "program" -} as const - -export type ProgramResourceResourceTypeEnum = - (typeof ProgramResourceResourceTypeEnum)[keyof typeof ProgramResourceResourceTypeEnum] - -/** - * * `PROGRAM_COURSES` - Program Courses * `LEARNING_PATH_ITEMS` - Learning Path Items * `PODCAST_EPISODES` - Podcast Episodes - * @export - * @enum {string} - */ - -export const RelationTypeEnum = { - ProgramCourses: "PROGRAM_COURSES", - LearningPathItems: "LEARNING_PATH_ITEMS", - PodcastEpisodes: "PODCAST_EPISODES" -} as const - -export type RelationTypeEnum = - (typeof RelationTypeEnum)[keyof typeof RelationTypeEnum] - -/** - * * `course` - course * `program` - program * `learning_path` - learning_path * `podcast` - podcast * `podcast_episode` - podcast_episode - * @export - * @enum {string} - */ - -export const ResourceTypeEnum = { - Course: "course", - Program: "program", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode" -} as const - -export type ResourceTypeEnum = - (typeof ResourceTypeEnum)[keyof typeof ResourceTypeEnum] - -/** - * - * @export - * @interface SearchResponse - */ -export interface SearchResponse { - /** - * - * @type {number} - * @memberof SearchResponse - */ - count: number - /** - * - * @type {Array} - * @memberof SearchResponse - */ - results: Array - /** - * - * @type {SearchResponseMetadata} - * @memberof SearchResponse - */ - metadata: SearchResponseMetadata -} -/** - * - * @export - * @interface SearchResponseMetadata - */ -export interface SearchResponseMetadata { - /** - * - * @type {{ [key: string]: Array; }} - * @memberof SearchResponseMetadata - */ - aggregations: { - [key: string]: Array - } - /** - * - * @type {Array} - * @memberof SearchResponseMetadata - */ - suggestions: Array -} -/** - * - * @export - * @interface SearchResponseMetadataAggregationsValueInner - */ -export interface SearchResponseMetadataAggregationsValueInner { - /** - * - * @type {string} - * @memberof SearchResponseMetadataAggregationsValueInner - */ - key: string - /** - * - * @type {number} - * @memberof SearchResponseMetadataAggregationsValueInner - */ - doc_count: number -} -/** - * 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 -} - -/** - * ArticlesApi - axios parameter creator - * @export - */ -export const ArticlesApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Create a new article - * @summary Create - * @param {ArticleRequest} ArticleRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesCreate: async ( - ArticleRequest: ArticleRequest, - options: RawAxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'ArticleRequest' is not null or undefined - assertParamExists("articlesCreate", "ArticleRequest", ArticleRequest) - const localVarPath = `/api/v1/articles/` - // 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( - ArticleRequest, - localVarRequestOptions, - configuration - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions - } - }, - /** - * Delete an article - * @summary Destroy - * @param {number} id A unique integer value identifying this article. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesDestroy: async ( - id: number, - options: RawAxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("articlesDestroy", "id", id) - const localVarPath = `/api/v1/articles/{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 - } - }, - /** - * Get a paginated list of articles - * @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} - */ - articlesList: async ( - limit?: number, - offset?: number, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/articles/` - // 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 - } - }, - /** - * Update an article - * @summary Update - * @param {number} id A unique integer value identifying this article. - * @param {PatchedArticleRequest} [PatchedArticleRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesPartialUpdate: async ( - id: number, - PatchedArticleRequest?: PatchedArticleRequest, - options: RawAxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("articlesPartialUpdate", "id", id) - const localVarPath = `/api/v1/articles/{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( - PatchedArticleRequest, - localVarRequestOptions, - configuration - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions - } - }, - /** - * Retrieve a single article - * @summary Retrieve - * @param {number} id A unique integer value identifying this article. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesRetrieve: async ( - id: number, - options: RawAxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("articlesRetrieve", "id", id) - const localVarPath = `/api/v1/articles/{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 - } - } - } -} - -/** - * ArticlesApi - functional programming interface - * @export - */ -export const ArticlesApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = ArticlesApiAxiosParamCreator(configuration) - return { - /** - * Create a new article - * @summary Create - * @param {ArticleRequest} ArticleRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async articlesCreate( - ArticleRequest: ArticleRequest, - options?: RawAxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise
- > { - const localVarAxiosArgs = await localVarAxiosParamCreator.articlesCreate( - ArticleRequest, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ArticlesApi.articlesCreate"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - )(axios, operationBasePath || basePath) - }, - /** - * Delete an article - * @summary Destroy - * @param {number} id A unique integer value identifying this article. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async articlesDestroy( - id: number, - options?: RawAxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.articlesDestroy( - id, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ArticlesApi.articlesDestroy"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - )(axios, operationBasePath || basePath) - }, - /** - * Get a paginated list of articles - * @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 articlesList( - limit?: number, - offset?: number, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.articlesList( - limit, - offset, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ArticlesApi.articlesList"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - )(axios, operationBasePath || basePath) - }, - /** - * Update an article - * @summary Update - * @param {number} id A unique integer value identifying this article. - * @param {PatchedArticleRequest} [PatchedArticleRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async articlesPartialUpdate( - id: number, - PatchedArticleRequest?: PatchedArticleRequest, - options?: RawAxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise
- > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.articlesPartialUpdate( - id, - PatchedArticleRequest, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ArticlesApi.articlesPartialUpdate"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - )(axios, operationBasePath || basePath) - }, - /** - * Retrieve a single article - * @summary Retrieve - * @param {number} id A unique integer value identifying this article. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async articlesRetrieve( - id: number, - options?: RawAxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise
- > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.articlesRetrieve(id, options) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ArticlesApi.articlesRetrieve"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - )(axios, operationBasePath || basePath) - } - } -} - -/** - * ArticlesApi - factory interface - * @export - */ -export const ArticlesApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = ArticlesApiFp(configuration) - return { - /** - * Create a new article - * @summary Create - * @param {ArticlesApiArticlesCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesCreate( - requestParameters: ArticlesApiArticlesCreateRequest, - options?: RawAxiosRequestConfig - ): AxiosPromise
{ - return localVarFp - .articlesCreate(requestParameters.ArticleRequest, options) - .then(request => request(axios, basePath)) - }, - /** - * Delete an article - * @summary Destroy - * @param {ArticlesApiArticlesDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesDestroy( - requestParameters: ArticlesApiArticlesDestroyRequest, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .articlesDestroy(requestParameters.id, options) - .then(request => request(axios, basePath)) - }, - /** - * Get a paginated list of articles - * @summary List - * @param {ArticlesApiArticlesListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesList( - requestParameters: ArticlesApiArticlesListRequest = {}, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .articlesList( - requestParameters.limit, - requestParameters.offset, - options - ) - .then(request => request(axios, basePath)) - }, - /** - * Update an article - * @summary Update - * @param {ArticlesApiArticlesPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesPartialUpdate( - requestParameters: ArticlesApiArticlesPartialUpdateRequest, - options?: RawAxiosRequestConfig - ): AxiosPromise
{ - return localVarFp - .articlesPartialUpdate( - requestParameters.id, - requestParameters.PatchedArticleRequest, - options - ) - .then(request => request(axios, basePath)) - }, - /** - * Retrieve a single article - * @summary Retrieve - * @param {ArticlesApiArticlesRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - articlesRetrieve( - requestParameters: ArticlesApiArticlesRetrieveRequest, - options?: RawAxiosRequestConfig - ): AxiosPromise
{ - return localVarFp - .articlesRetrieve(requestParameters.id, options) - .then(request => request(axios, basePath)) - } - } -} - -/** - * Request parameters for articlesCreate operation in ArticlesApi. - * @export - * @interface ArticlesApiArticlesCreateRequest - */ -export interface ArticlesApiArticlesCreateRequest { - /** - * - * @type {ArticleRequest} - * @memberof ArticlesApiArticlesCreate - */ - readonly ArticleRequest: ArticleRequest -} - -/** - * Request parameters for articlesDestroy operation in ArticlesApi. - * @export - * @interface ArticlesApiArticlesDestroyRequest - */ -export interface ArticlesApiArticlesDestroyRequest { - /** - * A unique integer value identifying this article. - * @type {number} - * @memberof ArticlesApiArticlesDestroy - */ - readonly id: number -} - -/** - * Request parameters for articlesList operation in ArticlesApi. - * @export - * @interface ArticlesApiArticlesListRequest - */ -export interface ArticlesApiArticlesListRequest { - /** - * Number of results to return per page. - * @type {number} - * @memberof ArticlesApiArticlesList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof ArticlesApiArticlesList - */ - readonly offset?: number -} - -/** - * Request parameters for articlesPartialUpdate operation in ArticlesApi. - * @export - * @interface ArticlesApiArticlesPartialUpdateRequest - */ -export interface ArticlesApiArticlesPartialUpdateRequest { - /** - * A unique integer value identifying this article. - * @type {number} - * @memberof ArticlesApiArticlesPartialUpdate - */ - readonly id: number - - /** - * - * @type {PatchedArticleRequest} - * @memberof ArticlesApiArticlesPartialUpdate - */ - readonly PatchedArticleRequest?: PatchedArticleRequest -} - -/** - * Request parameters for articlesRetrieve operation in ArticlesApi. - * @export - * @interface ArticlesApiArticlesRetrieveRequest - */ -export interface ArticlesApiArticlesRetrieveRequest { - /** - * A unique integer value identifying this article. - * @type {number} - * @memberof ArticlesApiArticlesRetrieve - */ - readonly id: number -} - -/** - * ArticlesApi - object-oriented interface - * @export - * @class ArticlesApi - * @extends {BaseAPI} - */ -export class ArticlesApi extends BaseAPI { - /** - * Create a new article - * @summary Create - * @param {ArticlesApiArticlesCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ArticlesApi - */ - public articlesCreate( - requestParameters: ArticlesApiArticlesCreateRequest, - options?: RawAxiosRequestConfig - ) { - return ArticlesApiFp(this.configuration) - .articlesCreate(requestParameters.ArticleRequest, options) - .then(request => request(this.axios, this.basePath)) - } - - /** - * Delete an article - * @summary Destroy - * @param {ArticlesApiArticlesDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ArticlesApi - */ - public articlesDestroy( - requestParameters: ArticlesApiArticlesDestroyRequest, - options?: RawAxiosRequestConfig - ) { - return ArticlesApiFp(this.configuration) - .articlesDestroy(requestParameters.id, options) - .then(request => request(this.axios, this.basePath)) - } - - /** - * Get a paginated list of articles - * @summary List - * @param {ArticlesApiArticlesListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ArticlesApi - */ - public articlesList( - requestParameters: ArticlesApiArticlesListRequest = {}, - options?: RawAxiosRequestConfig - ) { - return ArticlesApiFp(this.configuration) - .articlesList(requestParameters.limit, requestParameters.offset, options) - .then(request => request(this.axios, this.basePath)) - } - - /** - * Update an article - * @summary Update - * @param {ArticlesApiArticlesPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ArticlesApi - */ - public articlesPartialUpdate( - requestParameters: ArticlesApiArticlesPartialUpdateRequest, - options?: RawAxiosRequestConfig - ) { - return ArticlesApiFp(this.configuration) - .articlesPartialUpdate( - requestParameters.id, - requestParameters.PatchedArticleRequest, - options - ) - .then(request => request(this.axios, this.basePath)) - } - - /** - * Retrieve a single article - * @summary Retrieve - * @param {ArticlesApiArticlesRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ArticlesApi - */ - public articlesRetrieve( - requestParameters: ArticlesApiArticlesRetrieveRequest, - options?: RawAxiosRequestConfig - ) { - return ArticlesApiFp(this.configuration) - .articlesRetrieve(requestParameters.id, options) - .then(request => request(this.axios, this.basePath)) - } -} - -/** - * 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 {Array} [id] The id value for the content file - * @param {number} [limit] Number of results to return per page - * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @param {number} [offset] The initial index from which to return the results - * @param {Array} [platform] The platform on which the learning resource id offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @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, - id?: Array, - limit?: number, - 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/v1/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 (id) { - localVarQueryParameter["id"] = 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 (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 {Array} [id] The id value for the content file - * @param {number} [limit] Number of results to return per page - * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @param {number} [offset] The initial index from which to return the results - * @param {Array} [platform] The platform on which the learning resource id offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @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, - id?: Array, - limit?: number, - 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, - id, - limit, - 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.id, - requestParameters.limit, - 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 - - /** - * 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 organization that offers the learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl'>} - * @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 id offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast'>} - * @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.id, - requestParameters.limit, - 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", - Csail: "csail", - Mitpe: "mitpe", - See: "see", - Scc: "scc", - Ctl: "ctl" -} 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" -} 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] Multiple values may be separated by commas. - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {Array} [resource_id] Multiple values may be separated by commas. - * @param {Array} [run_id] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - contentfilesList: async ( - learning_resource_id: number, - content_feature_type?: 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/v1/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.join(COLLECTION_FORMATS.csv) - } - - 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.join( - COLLECTION_FORMATS.csv - ) - } - - if (run_id) { - localVarQueryParameter["run_id"] = run_id.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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] Multiple values may be separated by commas. - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {Array} [resource_id] Multiple values may be separated by commas. - * @param {Array} [run_id] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async contentfilesList( - learning_resource_id: number, - content_feature_type?: 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, - 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.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 - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ContentfilesApiContentfilesList - */ - readonly content_feature_type?: 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof ContentfilesApiContentfilesList - */ - readonly platform?: Array - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ContentfilesApiContentfilesList - */ - readonly resource_id?: Array - - /** - * Multiple values may be separated by commas. - * @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.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", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type ContentfilesListOfferedByEnum = - (typeof ContentfilesListOfferedByEnum)[keyof typeof ContentfilesListOfferedByEnum] -/** - * @export - */ -export const ContentfilesListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} 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/v1/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 {string} id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - courseFeaturesRetrieve: async ( - id: string, - options: RawAxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("courseFeaturesRetrieve", "id", id) - const localVarPath = `/api/v1/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 {string} id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async courseFeaturesRetrieve( - id: string, - 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 { - /** - * - * @type {string} - * @memberof CourseFeaturesApiCourseFeaturesRetrieve - */ - readonly id: string -} - -/** - * 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] Multiple values may be separated by commas. - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {Array} [resource_id] Multiple values may be separated by commas. - * @param {Array} [run_id] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - coursesContentfilesList: async ( - learning_resource_id: number, - content_feature_type?: 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/v1/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.join(COLLECTION_FORMATS.csv) - } - - 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.join( - COLLECTION_FORMATS.csv - ) - } - - if (run_id) { - localVarQueryParameter["run_id"] = run_id.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - coursesList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: CoursesListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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 newly released Courses. - * @summary List New - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {CoursesNewListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - coursesNewList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: CoursesNewListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/courses/new/` - // 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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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 - } - }, - /** - * Get a paginated list of upcoming Courses. - * @summary List Upcoming - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {CoursesUpcomingListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - coursesUpcomingList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: CoursesUpcomingListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/courses/upcoming/` - // 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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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] Multiple values may be separated by commas. - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {Array} [resource_id] Multiple values may be separated by commas. - * @param {Array} [run_id] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async coursesContentfilesList( - learning_resource_id: number, - content_feature_type?: 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, - 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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async coursesList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: CoursesListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.coursesList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - 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) - }, - /** - * Get a paginated list of newly released Courses. - * @summary List New - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {CoursesNewListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async coursesNewList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: CoursesNewListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.coursesNewList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - sortby, - topic, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["CoursesApi.coursesNewList"]?.[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) - }, - /** - * Get a paginated list of upcoming Courses. - * @summary List Upcoming - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {CoursesUpcomingListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async coursesUpcomingList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: CoursesUpcomingListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.coursesUpcomingList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - sortby, - topic, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["CoursesApi.coursesUpcomingList"]?.[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.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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(axios, basePath)) - }, - /** - * Get a paginated list of newly released Courses. - * @summary List New - * @param {CoursesApiCoursesNewListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - coursesNewList( - requestParameters: CoursesApiCoursesNewListRequest = {}, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .coursesNewList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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)) - }, - /** - * Get a paginated list of upcoming Courses. - * @summary List Upcoming - * @param {CoursesApiCoursesUpcomingListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - coursesUpcomingList( - requestParameters: CoursesApiCoursesUpcomingListRequest = {}, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .coursesUpcomingList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - 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 - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesContentfilesList - */ - readonly content_feature_type?: 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof CoursesApiCoursesContentfilesList - */ - readonly platform?: Array - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesContentfilesList - */ - readonly resource_id?: Array - - /** - * Multiple values may be separated by commas. - * @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 { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof CoursesApiCoursesList - */ - readonly department?: Array - - /** - * 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof CoursesApiCoursesList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof CoursesApiCoursesList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof CoursesApiCoursesList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof CoursesApiCoursesList - */ - readonly sortby?: CoursesListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesList - */ - readonly topic?: Array -} - -/** - * Request parameters for coursesNewList operation in CoursesApi. - * @export - * @interface CoursesApiCoursesNewListRequest - */ -export interface CoursesApiCoursesNewListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesNewList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof CoursesApiCoursesNewList - */ - readonly department?: Array - - /** - * 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 CoursesApiCoursesNewList - */ - readonly level?: Array - - /** - * Number of results to return per page. - * @type {number} - * @memberof CoursesApiCoursesNewList - */ - readonly limit?: number - - /** - * The organization that offers a learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | 'see' | 'xpro'>} - * @memberof CoursesApiCoursesNewList - */ - readonly offered_by?: Array - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof CoursesApiCoursesNewList - */ - readonly offset?: number - - /** - * The platform on which learning resources are offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof CoursesApiCoursesNewList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof CoursesApiCoursesNewList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof CoursesApiCoursesNewList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof CoursesApiCoursesNewList - */ - readonly sortby?: CoursesNewListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesNewList - */ - 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 -} - -/** - * Request parameters for coursesUpcomingList operation in CoursesApi. - * @export - * @interface CoursesApiCoursesUpcomingListRequest - */ -export interface CoursesApiCoursesUpcomingListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly department?: Array - - /** - * 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 CoursesApiCoursesUpcomingList - */ - readonly level?: Array - - /** - * Number of results to return per page. - * @type {number} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly limit?: number - - /** - * The organization that offers a learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | 'see' | 'xpro'>} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly offered_by?: Array - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly offset?: number - - /** - * The platform on which learning resources are offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly sortby?: CoursesUpcomingListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof CoursesApiCoursesUpcomingList - */ - readonly topic?: Array -} - -/** - * 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.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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(this.axios, this.basePath)) - } - - /** - * Get a paginated list of newly released Courses. - * @summary List New - * @param {CoursesApiCoursesNewListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CoursesApi - */ - public coursesNewList( - requestParameters: CoursesApiCoursesNewListRequest = {}, - options?: RawAxiosRequestConfig - ) { - return CoursesApiFp(this.configuration) - .coursesNewList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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)) - } - - /** - * Get a paginated list of upcoming Courses. - * @summary List Upcoming - * @param {CoursesApiCoursesUpcomingListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CoursesApi - */ - public coursesUpcomingList( - requestParameters: CoursesApiCoursesUpcomingListRequest = {}, - options?: RawAxiosRequestConfig - ) { - return CoursesApiFp(this.configuration) - .coursesUpcomingList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(this.axios, this.basePath)) - } -} - -/** - * @export - */ -export const CoursesContentfilesListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type CoursesContentfilesListOfferedByEnum = - (typeof CoursesContentfilesListOfferedByEnum)[keyof typeof CoursesContentfilesListOfferedByEnum] -/** - * @export - */ -export const CoursesContentfilesListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type CoursesContentfilesListPlatformEnum = - (typeof CoursesContentfilesListPlatformEnum)[keyof typeof CoursesContentfilesListPlatformEnum] -/** - * @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", - Res: "RES", - 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", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type CoursesListOfferedByEnum = - (typeof CoursesListOfferedByEnum)[keyof typeof CoursesListOfferedByEnum] -/** - * @export - */ -export const CoursesListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type CoursesListPlatformEnum = - (typeof CoursesListPlatformEnum)[keyof typeof CoursesListPlatformEnum] -/** - * @export - */ -export const CoursesListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type CoursesListResourceTypeEnum = - (typeof CoursesListResourceTypeEnum)[keyof typeof CoursesListResourceTypeEnum] -/** - * @export - */ -export const CoursesListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type CoursesListSortbyEnum = - (typeof CoursesListSortbyEnum)[keyof typeof CoursesListSortbyEnum] -/** - * @export - */ -export const CoursesNewListDepartmentEnum = { - _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", - Res: "RES", - Sts: "STS", - Wgs: "WGS" -} as const -export type CoursesNewListDepartmentEnum = - (typeof CoursesNewListDepartmentEnum)[keyof typeof CoursesNewListDepartmentEnum] -/** - * @export - */ -export const CoursesNewListLevelEnum = { - Advanced: "advanced", - Graduate: "graduate", - HighSchool: "high_school", - Intermediate: "intermediate", - Introductory: "introductory", - Noncredit: "noncredit", - Undergraduate: "undergraduate" -} as const -export type CoursesNewListLevelEnum = - (typeof CoursesNewListLevelEnum)[keyof typeof CoursesNewListLevelEnum] -/** - * @export - */ -export const CoursesNewListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type CoursesNewListOfferedByEnum = - (typeof CoursesNewListOfferedByEnum)[keyof typeof CoursesNewListOfferedByEnum] -/** - * @export - */ -export const CoursesNewListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type CoursesNewListPlatformEnum = - (typeof CoursesNewListPlatformEnum)[keyof typeof CoursesNewListPlatformEnum] -/** - * @export - */ -export const CoursesNewListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type CoursesNewListResourceTypeEnum = - (typeof CoursesNewListResourceTypeEnum)[keyof typeof CoursesNewListResourceTypeEnum] -/** - * @export - */ -export const CoursesNewListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type CoursesNewListSortbyEnum = - (typeof CoursesNewListSortbyEnum)[keyof typeof CoursesNewListSortbyEnum] -/** - * @export - */ -export const CoursesUpcomingListDepartmentEnum = { - _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", - Res: "RES", - Sts: "STS", - Wgs: "WGS" -} as const -export type CoursesUpcomingListDepartmentEnum = - (typeof CoursesUpcomingListDepartmentEnum)[keyof typeof CoursesUpcomingListDepartmentEnum] -/** - * @export - */ -export const CoursesUpcomingListLevelEnum = { - Advanced: "advanced", - Graduate: "graduate", - HighSchool: "high_school", - Intermediate: "intermediate", - Introductory: "introductory", - Noncredit: "noncredit", - Undergraduate: "undergraduate" -} as const -export type CoursesUpcomingListLevelEnum = - (typeof CoursesUpcomingListLevelEnum)[keyof typeof CoursesUpcomingListLevelEnum] -/** - * @export - */ -export const CoursesUpcomingListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type CoursesUpcomingListOfferedByEnum = - (typeof CoursesUpcomingListOfferedByEnum)[keyof typeof CoursesUpcomingListOfferedByEnum] -/** - * @export - */ -export const CoursesUpcomingListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type CoursesUpcomingListPlatformEnum = - (typeof CoursesUpcomingListPlatformEnum)[keyof typeof CoursesUpcomingListPlatformEnum] -/** - * @export - */ -export const CoursesUpcomingListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type CoursesUpcomingListResourceTypeEnum = - (typeof CoursesUpcomingListResourceTypeEnum)[keyof typeof CoursesUpcomingListResourceTypeEnum] -/** - * @export - */ -export const CoursesUpcomingListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type CoursesUpcomingListSortbyEnum = - (typeof CoursesUpcomingListSortbyEnum)[keyof typeof CoursesUpcomingListSortbyEnum] - -/** - * 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/v1/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/v1/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)) - } -} - -/** - * 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] Multiple values may be separated by commas. - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {Array} [resource_id] Multiple values may be separated by commas. - * @param {Array} [run_id] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningResourcesContentfilesList: async ( - learning_resource_id: number, - content_feature_type?: 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/v1/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.join(COLLECTION_FORMATS.csv) - } - - 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.join( - COLLECTION_FORMATS.csv - ) - } - - if (run_id) { - localVarQueryParameter["run_id"] = run_id.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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/v1/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/v1/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 - } - }, - /** - * Get a paginated list of learning resources. - * @summary List - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningResourcesList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningResourcesListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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 newly released Learning Resources. - * @summary List New - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {LearningResourcesNewListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningResourcesNewList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningResourcesNewListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/learning_resources/new/` - // 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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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 - } - }, - /** - * Get a paginated list of upcoming Learning Resources. - * @summary List Upcoming - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {LearningResourcesUpcomingListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningResourcesUpcomingList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningResourcesUpcomingListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/learning_resources/upcoming/` - // 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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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] Multiple values may be separated by commas. - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {Array} [resource_id] Multiple values may be separated by commas. - * @param {Array} [run_id] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async learningResourcesContentfilesList( - learning_resource_id: number, - content_feature_type?: 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, - 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) - }, - /** - * Get a paginated list of learning resources. - * @summary List - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async learningResourcesList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningResourcesListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.learningResourcesList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - 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) - }, - /** - * Get a paginated list of newly released Learning Resources. - * @summary List New - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {LearningResourcesNewListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async learningResourcesNewList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningResourcesNewListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.learningResourcesNewList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - sortby, - topic, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["LearningResourcesApi.learningResourcesNewList"]?.[ - 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) - }, - /** - * Get a paginated list of upcoming Learning Resources. - * @summary List Upcoming - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {LearningResourcesUpcomingListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async learningResourcesUpcomingList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningResourcesUpcomingListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.learningResourcesUpcomingList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - sortby, - topic, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap[ - "LearningResourcesApi.learningResourcesUpcomingList" - ]?.[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.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)) - }, - /** - * 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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(axios, basePath)) - }, - /** - * Get a paginated list of newly released Learning Resources. - * @summary List New - * @param {LearningResourcesApiLearningResourcesNewListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningResourcesNewList( - requestParameters: LearningResourcesApiLearningResourcesNewListRequest = {}, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .learningResourcesNewList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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)) - }, - /** - * Get a paginated list of upcoming Learning Resources. - * @summary List Upcoming - * @param {LearningResourcesApiLearningResourcesUpcomingListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningResourcesUpcomingList( - requestParameters: LearningResourcesApiLearningResourcesUpcomingListRequest = {}, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .learningResourcesUpcomingList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - 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 - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesContentfilesList - */ - readonly content_feature_type?: 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof LearningResourcesApiLearningResourcesContentfilesList - */ - readonly platform?: Array - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesContentfilesList - */ - readonly resource_id?: Array - - /** - * Multiple values may be separated by commas. - * @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 learningResourcesList operation in LearningResourcesApi. - * @export - * @interface LearningResourcesApiLearningResourcesListRequest - */ -export interface LearningResourcesApiLearningResourcesListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly department?: Array - - /** - * 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly sortby?: LearningResourcesListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesList - */ - readonly topic?: Array -} - -/** - * Request parameters for learningResourcesNewList operation in LearningResourcesApi. - * @export - * @interface LearningResourcesApiLearningResourcesNewListRequest - */ -export interface LearningResourcesApiLearningResourcesNewListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly department?: Array - - /** - * 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 LearningResourcesApiLearningResourcesNewList - */ - readonly level?: Array - - /** - * Number of results to return per page. - * @type {number} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly limit?: number - - /** - * The organization that offers a learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | 'see' | 'xpro'>} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly offered_by?: Array - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly offset?: number - - /** - * The platform on which learning resources are offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - readonly sortby?: LearningResourcesNewListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesNewList - */ - 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 learningResourcesUpcomingList operation in LearningResourcesApi. - * @export - * @interface LearningResourcesApiLearningResourcesUpcomingListRequest - */ -export interface LearningResourcesApiLearningResourcesUpcomingListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly department?: Array - - /** - * 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 LearningResourcesApiLearningResourcesUpcomingList - */ - readonly level?: Array - - /** - * Number of results to return per page. - * @type {number} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly limit?: number - - /** - * The organization that offers a learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | 'see' | 'xpro'>} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly offered_by?: Array - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly offset?: number - - /** - * The platform on which learning resources are offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - readonly sortby?: LearningResourcesUpcomingListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningResourcesApiLearningResourcesUpcomingList - */ - 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.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)) - } - - /** - * 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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(this.axios, this.basePath)) - } - - /** - * Get a paginated list of newly released Learning Resources. - * @summary List New - * @param {LearningResourcesApiLearningResourcesNewListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof LearningResourcesApi - */ - public learningResourcesNewList( - requestParameters: LearningResourcesApiLearningResourcesNewListRequest = {}, - options?: RawAxiosRequestConfig - ) { - return LearningResourcesApiFp(this.configuration) - .learningResourcesNewList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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)) - } - - /** - * Get a paginated list of upcoming Learning Resources. - * @summary List Upcoming - * @param {LearningResourcesApiLearningResourcesUpcomingListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof LearningResourcesApi - */ - public learningResourcesUpcomingList( - requestParameters: LearningResourcesApiLearningResourcesUpcomingListRequest = {}, - options?: RawAxiosRequestConfig - ) { - return LearningResourcesApiFp(this.configuration) - .learningResourcesUpcomingList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(this.axios, this.basePath)) - } -} - -/** - * @export - */ -export const LearningResourcesContentfilesListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type LearningResourcesContentfilesListOfferedByEnum = - (typeof LearningResourcesContentfilesListOfferedByEnum)[keyof typeof LearningResourcesContentfilesListOfferedByEnum] -/** - * @export - */ -export const LearningResourcesContentfilesListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type LearningResourcesContentfilesListPlatformEnum = - (typeof LearningResourcesContentfilesListPlatformEnum)[keyof typeof LearningResourcesContentfilesListPlatformEnum] -/** - * @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", - Res: "RES", - 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", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type LearningResourcesListOfferedByEnum = - (typeof LearningResourcesListOfferedByEnum)[keyof typeof LearningResourcesListOfferedByEnum] -/** - * @export - */ -export const LearningResourcesListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type LearningResourcesListPlatformEnum = - (typeof LearningResourcesListPlatformEnum)[keyof typeof LearningResourcesListPlatformEnum] -/** - * @export - */ -export const LearningResourcesListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type LearningResourcesListResourceTypeEnum = - (typeof LearningResourcesListResourceTypeEnum)[keyof typeof LearningResourcesListResourceTypeEnum] -/** - * @export - */ -export const LearningResourcesListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type LearningResourcesListSortbyEnum = - (typeof LearningResourcesListSortbyEnum)[keyof typeof LearningResourcesListSortbyEnum] -/** - * @export - */ -export const LearningResourcesNewListDepartmentEnum = { - _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", - Res: "RES", - Sts: "STS", - Wgs: "WGS" -} as const -export type LearningResourcesNewListDepartmentEnum = - (typeof LearningResourcesNewListDepartmentEnum)[keyof typeof LearningResourcesNewListDepartmentEnum] -/** - * @export - */ -export const LearningResourcesNewListLevelEnum = { - Advanced: "advanced", - Graduate: "graduate", - HighSchool: "high_school", - Intermediate: "intermediate", - Introductory: "introductory", - Noncredit: "noncredit", - Undergraduate: "undergraduate" -} as const -export type LearningResourcesNewListLevelEnum = - (typeof LearningResourcesNewListLevelEnum)[keyof typeof LearningResourcesNewListLevelEnum] -/** - * @export - */ -export const LearningResourcesNewListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type LearningResourcesNewListOfferedByEnum = - (typeof LearningResourcesNewListOfferedByEnum)[keyof typeof LearningResourcesNewListOfferedByEnum] -/** - * @export - */ -export const LearningResourcesNewListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type LearningResourcesNewListPlatformEnum = - (typeof LearningResourcesNewListPlatformEnum)[keyof typeof LearningResourcesNewListPlatformEnum] -/** - * @export - */ -export const LearningResourcesNewListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type LearningResourcesNewListResourceTypeEnum = - (typeof LearningResourcesNewListResourceTypeEnum)[keyof typeof LearningResourcesNewListResourceTypeEnum] -/** - * @export - */ -export const LearningResourcesNewListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type LearningResourcesNewListSortbyEnum = - (typeof LearningResourcesNewListSortbyEnum)[keyof typeof LearningResourcesNewListSortbyEnum] -/** - * @export - */ -export const LearningResourcesUpcomingListDepartmentEnum = { - _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", - Res: "RES", - Sts: "STS", - Wgs: "WGS" -} as const -export type LearningResourcesUpcomingListDepartmentEnum = - (typeof LearningResourcesUpcomingListDepartmentEnum)[keyof typeof LearningResourcesUpcomingListDepartmentEnum] -/** - * @export - */ -export const LearningResourcesUpcomingListLevelEnum = { - Advanced: "advanced", - Graduate: "graduate", - HighSchool: "high_school", - Intermediate: "intermediate", - Introductory: "introductory", - Noncredit: "noncredit", - Undergraduate: "undergraduate" -} as const -export type LearningResourcesUpcomingListLevelEnum = - (typeof LearningResourcesUpcomingListLevelEnum)[keyof typeof LearningResourcesUpcomingListLevelEnum] -/** - * @export - */ -export const LearningResourcesUpcomingListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type LearningResourcesUpcomingListOfferedByEnum = - (typeof LearningResourcesUpcomingListOfferedByEnum)[keyof typeof LearningResourcesUpcomingListOfferedByEnum] -/** - * @export - */ -export const LearningResourcesUpcomingListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type LearningResourcesUpcomingListPlatformEnum = - (typeof LearningResourcesUpcomingListPlatformEnum)[keyof typeof LearningResourcesUpcomingListPlatformEnum] -/** - * @export - */ -export const LearningResourcesUpcomingListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type LearningResourcesUpcomingListResourceTypeEnum = - (typeof LearningResourcesUpcomingListResourceTypeEnum)[keyof typeof LearningResourcesUpcomingListResourceTypeEnum] -/** - * @export - */ -export const LearningResourcesUpcomingListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type LearningResourcesUpcomingListSortbyEnum = - (typeof LearningResourcesUpcomingListSortbyEnum)[keyof typeof LearningResourcesUpcomingListSortbyEnum] - -/** - * 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} [course_feature] The course feature. Possible options are at api/v1/course_features/ - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @param {Array} [id] The id value for the learning resource - * @param {Array} [level] - * @param {number} [limit] Number of results to return per page - * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @param {number} [offset] The initial index from which to return the results - * @param {Array} [platform] The platform on which the learning resource id offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean | null} [professional] - * @param {string} [q] The search text - * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode - * @param {LearningResourcesSearchRetrieveSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @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} - */ - learningResourcesSearchRetrieve: async ( - aggregations?: Array, - certification?: boolean | null, - course_feature?: Array, - department?: Array, - id?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean | null, - q?: string, - resource_type?: Array, - sortby?: LearningResourcesSearchRetrieveSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature - } - - if (department) { - localVarQueryParameter["department"] = department - } - - if (id) { - localVarQueryParameter["id"] = id - } - - 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 (q !== undefined) { - localVarQueryParameter["q"] = q - } - - if (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - 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 - } - } - } -} - -/** - * 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} [course_feature] The course feature. Possible options are at api/v1/course_features/ - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @param {Array} [id] The id value for the learning resource - * @param {Array} [level] - * @param {number} [limit] Number of results to return per page - * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @param {number} [offset] The initial index from which to return the results - * @param {Array} [platform] The platform on which the learning resource id offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean | null} [professional] - * @param {string} [q] The search text - * @param {Array} [resource_type] The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode - * @param {LearningResourcesSearchRetrieveSortbyEnum} [sortby] If the parameter starts with \'-\' the sort is in descending order * `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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @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 learningResourcesSearchRetrieve( - aggregations?: Array, - certification?: boolean | null, - course_feature?: Array, - department?: Array, - id?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean | null, - q?: string, - resource_type?: Array, - sortby?: LearningResourcesSearchRetrieveSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.learningResourcesSearchRetrieve( - aggregations, - certification, - course_feature, - department, - id, - level, - limit, - offered_by, - offset, - platform, - professional, - q, - resource_type, - sortby, - topic, - 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.course_feature, - requestParameters.department, - requestParameters.id, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.q, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - 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' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional'>} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly aggregations?: Array - - /** - * True if the learning resource offers a certificate - * @type {boolean} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly certification?: boolean | null - - /** - * The course feature. Possible options are at api/v1/course_features/ - * @type {Array} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly department?: Array - - /** - * 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 - - /** - * The organization that offers the learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'mitx' | 'ocw' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl'>} - * @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 id offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'edx' | 'ocw' | 'oll' | 'mitxonline' | 'bootcamps' | 'xpro' | 'csail' | 'mitpe' | 'see' | 'scc' | 'ctl' | 'whu' | 'susskind' | 'globalalumni' | 'simplilearn' | 'emeritus' | 'podcast'>} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly professional?: boolean | null - - /** - * The search text - * @type {string} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly q?: string - - /** - * The type of learning resource * `course` - course * `program` - program * `learning_path` - learning path * `podcast` - podcast * `podcast_episode` - podcast episode - * @type {Array<'course' | 'program' | 'learning_path' | 'podcast' | 'podcast_episode'>} - * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve - */ - readonly resource_type?: Array - - /** - * If the parameter starts with \'-\' the sort is in descending order * `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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'id' | '-id' | 'readable_id' | '-readable_id' | 'last_modified' | '-last_modified' | 'created_on' | '-created_on' | 'start_date' | '-start_date' | 'mitcoursenumber' | '-mitcoursenumber'} - * @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 -} - -/** - * 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.course_feature, - requestParameters.department, - requestParameters.id, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.q, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(this.axios, this.basePath)) - } -} - -/** - * @export - */ -export const LearningResourcesSearchRetrieveAggregationsEnum = { - ResourceType: "resource_type", - Certification: "certification", - OfferedBy: "offered_by", - Platform: "platform", - Topic: "topic", - Department: "department", - Level: "level", - CourseFeature: "course_feature", - Professional: "professional" -} as const -export type LearningResourcesSearchRetrieveAggregationsEnum = - (typeof LearningResourcesSearchRetrieveAggregationsEnum)[keyof typeof LearningResourcesSearchRetrieveAggregationsEnum] -/** - * @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", - Res: "RES", - 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", - Csail: "csail", - Mitpe: "mitpe", - See: "see", - Scc: "scc", - Ctl: "ctl" -} 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" -} 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" -} as const -export type LearningResourcesSearchRetrieveResourceTypeEnum = - (typeof LearningResourcesSearchRetrieveResourceTypeEnum)[keyof typeof LearningResourcesSearchRetrieveResourceTypeEnum] -/** - * @export - */ -export const LearningResourcesSearchRetrieveSortbyEnum = { - Id: "id", - Id2: "-id", - ReadableId: "readable_id", - ReadableId2: "-readable_id", - LastModified: "last_modified", - LastModified2: "-last_modified", - CreatedOn: "created_on", - CreatedOn2: "-created_on", - StartDate: "start_date", - StartDate2: "-start_date", - Mitcoursenumber: "mitcoursenumber", - Mitcoursenumber2: "-mitcoursenumber" -} as const -export type LearningResourcesSearchRetrieveSortbyEnum = - (typeof LearningResourcesSearchRetrieveSortbyEnum)[keyof typeof LearningResourcesSearchRetrieveSortbyEnum] - -/** - * 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/v1/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/v1/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 {LearningPathRelationshipRequest} LearningPathRelationshipRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningpathsItemsCreate: async ( - learning_resource_id: number, - LearningPathRelationshipRequest: LearningPathRelationshipRequest, - 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 'LearningPathRelationshipRequest' is not null or undefined - assertParamExists( - "learningpathsItemsCreate", - "LearningPathRelationshipRequest", - LearningPathRelationshipRequest - ) - const localVarPath = - `/api/v1/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( - LearningPathRelationshipRequest, - 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/v1/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 - } - }, - /** - * Get a list of related learning resources for a learning resource. - * @summary Nested Learning Resource List - * @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/v1/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 {PatchedLearningPathRelationshipRequest} [PatchedLearningPathRelationshipRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningpathsItemsPartialUpdate: async ( - id: number, - learning_resource_id: number, - PatchedLearningPathRelationshipRequest?: PatchedLearningPathRelationshipRequest, - 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/v1/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( - PatchedLearningPathRelationshipRequest, - 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/v1/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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - learningpathsList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningpathsListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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/v1/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 {LearningPathRelationshipRequest} LearningPathRelationshipRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async learningpathsItemsCreate( - learning_resource_id: number, - LearningPathRelationshipRequest: LearningPathRelationshipRequest, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.learningpathsItemsCreate( - learning_resource_id, - LearningPathRelationshipRequest, - 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) - }, - /** - * Get a list of related learning resources for a learning resource. - * @summary Nested Learning Resource List - * @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 {PatchedLearningPathRelationshipRequest} [PatchedLearningPathRelationshipRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async learningpathsItemsPartialUpdate( - id: number, - learning_resource_id: number, - PatchedLearningPathRelationshipRequest?: PatchedLearningPathRelationshipRequest, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.learningpathsItemsPartialUpdate( - id, - learning_resource_id, - PatchedLearningPathRelationshipRequest, - 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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async learningpathsList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: LearningpathsListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.learningpathsList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - 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) - }, - /** - * 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.LearningPathRelationshipRequest, - 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)) - }, - /** - * Get a list of related learning resources for a learning resource. - * @summary Nested Learning Resource List - * @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.PatchedLearningPathRelationshipRequest, - 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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - 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 {LearningPathRelationshipRequest} - * @memberof LearningpathsApiLearningpathsItemsCreate - */ - readonly LearningPathRelationshipRequest: LearningPathRelationshipRequest -} - -/** - * 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 {PatchedLearningPathRelationshipRequest} - * @memberof LearningpathsApiLearningpathsItemsPartialUpdate - */ - readonly PatchedLearningPathRelationshipRequest?: PatchedLearningPathRelationshipRequest -} - -/** - * 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 { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof LearningpathsApiLearningpathsList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof LearningpathsApiLearningpathsList - */ - readonly department?: Array - - /** - * 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof LearningpathsApiLearningpathsList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof LearningpathsApiLearningpathsList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof LearningpathsApiLearningpathsList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof LearningpathsApiLearningpathsList - */ - readonly sortby?: LearningpathsListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @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.LearningPathRelationshipRequest, - 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)) - } - - /** - * Get a list of related learning resources for a learning resource. - * @summary Nested Learning Resource List - * @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.PatchedLearningPathRelationshipRequest, - 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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - 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 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", - Res: "RES", - 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", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type LearningpathsListOfferedByEnum = - (typeof LearningpathsListOfferedByEnum)[keyof typeof LearningpathsListOfferedByEnum] -/** - * @export - */ -export const LearningpathsListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type LearningpathsListPlatformEnum = - (typeof LearningpathsListPlatformEnum)[keyof typeof LearningpathsListPlatformEnum] -/** - * @export - */ -export const LearningpathsListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type LearningpathsListResourceTypeEnum = - (typeof LearningpathsListResourceTypeEnum)[keyof typeof LearningpathsListResourceTypeEnum] -/** - * @export - */ -export const LearningpathsListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} 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/v1/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/v1/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/v1/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/v1/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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - podcastEpisodesList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: PodcastEpisodesListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async podcastEpisodesList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: PodcastEpisodesListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.podcastEpisodesList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - 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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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 { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof PodcastEpisodesApiPodcastEpisodesList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof PodcastEpisodesApiPodcastEpisodesList - */ - readonly department?: Array - - /** - * 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof PodcastEpisodesApiPodcastEpisodesList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof PodcastEpisodesApiPodcastEpisodesList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof PodcastEpisodesApiPodcastEpisodesList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof PodcastEpisodesApiPodcastEpisodesList - */ - readonly sortby?: PodcastEpisodesListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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 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", - Res: "RES", - 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", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type PodcastEpisodesListOfferedByEnum = - (typeof PodcastEpisodesListOfferedByEnum)[keyof typeof PodcastEpisodesListOfferedByEnum] -/** - * @export - */ -export const PodcastEpisodesListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type PodcastEpisodesListPlatformEnum = - (typeof PodcastEpisodesListPlatformEnum)[keyof typeof PodcastEpisodesListPlatformEnum] -/** - * @export - */ -export const PodcastEpisodesListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type PodcastEpisodesListResourceTypeEnum = - (typeof PodcastEpisodesListResourceTypeEnum)[keyof typeof PodcastEpisodesListResourceTypeEnum] -/** - * @export - */ -export const PodcastEpisodesListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} 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/v1/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/v1/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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - podcastsList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: PodcastsListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async podcastsList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: PodcastsListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - 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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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 { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof PodcastsApiPodcastsList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof PodcastsApiPodcastsList - */ - readonly department?: Array - - /** - * 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof PodcastsApiPodcastsList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof PodcastsApiPodcastsList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof PodcastsApiPodcastsList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof PodcastsApiPodcastsList - */ - readonly sortby?: PodcastsListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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 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", - Res: "RES", - 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", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type PodcastsListOfferedByEnum = - (typeof PodcastsListOfferedByEnum)[keyof typeof PodcastsListOfferedByEnum] -/** - * @export - */ -export const PodcastsListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type PodcastsListPlatformEnum = - (typeof PodcastsListPlatformEnum)[keyof typeof PodcastsListPlatformEnum] -/** - * @export - */ -export const PodcastsListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type PodcastsListResourceTypeEnum = - (typeof PodcastsListResourceTypeEnum)[keyof typeof PodcastsListResourceTypeEnum] -/** - * @export - */ -export const PodcastsListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} 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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - programsList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: ProgramsListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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 newly released Programs. - * @summary List New - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {ProgramsNewListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - programsNewList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: ProgramsNewListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/programs/new/` - // 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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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/v1/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 - } - }, - /** - * Get a paginated list of upcoming Programs. - * @summary List Upcoming - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {ProgramsUpcomingListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - programsUpcomingList: async ( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: ProgramsUpcomingListSortbyEnum, - topic?: Array, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/programs/upcoming/` - // 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 (course_feature) { - localVarQueryParameter["course_feature"] = course_feature.join( - COLLECTION_FORMATS.csv - ) - } - - if (department) { - localVarQueryParameter["department"] = department - } - - 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 (resource_type) { - localVarQueryParameter["resource_type"] = resource_type - } - - if (sortby !== undefined) { - localVarQueryParameter["sortby"] = sortby - } - - if (topic) { - localVarQueryParameter["topic"] = topic.join(COLLECTION_FORMATS.csv) - } - - 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 {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async programsList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: ProgramsListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.programsList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - 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) - }, - /** - * Get a paginated list of newly released Programs. - * @summary List New - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {ProgramsNewListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async programsNewList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: ProgramsNewListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.programsNewList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - sortby, - topic, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ProgramsApi.programsNewList"]?.[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) - }, - /** - * Get a paginated list of upcoming Programs. - * @summary List Upcoming - * @param {Array} [course_feature] Multiple values may be separated by commas. - * @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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies - * @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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @param {boolean} [professional] - * @param {Array} [resource_type] The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @param {ProgramsUpcomingListSortbyEnum} [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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @param {Array} [topic] Multiple values may be separated by commas. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async programsUpcomingList( - course_feature?: Array, - department?: Array, - level?: Array, - limit?: number, - offered_by?: Array, - offset?: number, - platform?: Array, - professional?: boolean, - resource_type?: Array, - sortby?: ProgramsUpcomingListSortbyEnum, - topic?: Array, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.programsUpcomingList( - course_feature, - department, - level, - limit, - offered_by, - offset, - platform, - professional, - resource_type, - sortby, - topic, - options - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ProgramsApi.programsUpcomingList"]?.[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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(axios, basePath)) - }, - /** - * Get a paginated list of newly released Programs. - * @summary List New - * @param {ProgramsApiProgramsNewListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - programsNewList( - requestParameters: ProgramsApiProgramsNewListRequest = {}, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .programsNewList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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)) - }, - /** - * Get a paginated list of upcoming Programs. - * @summary List Upcoming - * @param {ProgramsApiProgramsUpcomingListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - programsUpcomingList( - requestParameters: ProgramsApiProgramsUpcomingListRequest = {}, - options?: RawAxiosRequestConfig - ): AxiosPromise { - return localVarFp - .programsUpcomingList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(axios, basePath)) - } - } -} - -/** - * Request parameters for programsList operation in ProgramsApi. - * @export - * @interface ProgramsApiProgramsListRequest - */ -export interface ProgramsApiProgramsListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ProgramsApiProgramsList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof ProgramsApiProgramsList - */ - readonly department?: Array - - /** - * 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` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | '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` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof ProgramsApiProgramsList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof ProgramsApiProgramsList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof ProgramsApiProgramsList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof ProgramsApiProgramsList - */ - readonly sortby?: ProgramsListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ProgramsApiProgramsList - */ - readonly topic?: Array -} - -/** - * Request parameters for programsNewList operation in ProgramsApi. - * @export - * @interface ProgramsApiProgramsNewListRequest - */ -export interface ProgramsApiProgramsNewListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ProgramsApiProgramsNewList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof ProgramsApiProgramsNewList - */ - readonly department?: Array - - /** - * 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 ProgramsApiProgramsNewList - */ - readonly level?: Array - - /** - * Number of results to return per page. - * @type {number} - * @memberof ProgramsApiProgramsNewList - */ - readonly limit?: number - - /** - * The organization that offers a learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | 'see' | 'xpro'>} - * @memberof ProgramsApiProgramsNewList - */ - readonly offered_by?: Array - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof ProgramsApiProgramsNewList - */ - readonly offset?: number - - /** - * The platform on which learning resources are offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof ProgramsApiProgramsNewList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof ProgramsApiProgramsNewList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof ProgramsApiProgramsNewList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof ProgramsApiProgramsNewList - */ - readonly sortby?: ProgramsNewListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ProgramsApiProgramsNewList - */ - 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 -} - -/** - * Request parameters for programsUpcomingList operation in ProgramsApi. - * @export - * @interface ProgramsApiProgramsUpcomingListRequest - */ -export interface ProgramsApiProgramsUpcomingListRequest { - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly course_feature?: 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` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and 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` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `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' | 'RES' | 'STS' | 'WGS'>} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly department?: Array - - /** - * 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 ProgramsApiProgramsUpcomingList - */ - readonly level?: Array - - /** - * Number of results to return per page. - * @type {number} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly limit?: number - - /** - * The organization that offers a learning resource * `mitx` - MITx * `ocw` - OCW * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - Sloan Executive Education * `scc` - Schwarzman College of Computing * `ctl` - Center for Transportation & Logistics - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'mitpe' | 'mitx' | 'ocw' | 'scc' | 'see' | 'xpro'>} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly offered_by?: Array - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly offset?: number - - /** - * The platform on which learning resources are offered * `edx` - edX * `ocw` - OCW * `oll` - Open Learning Library * `mitxonline` - MITx Online * `bootcamps` - Bootcamps * `xpro` - xPRO * `csail` - CSAIL * `mitpe` - Professional Education * `see` - 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 - * @type {Array<'bootcamps' | 'csail' | 'ctl' | 'edx' | 'emeritus' | 'globalalumni' | 'mitpe' | 'mitxonline' | 'ocw' | 'oll' | 'podcast' | 'scc' | 'see' | 'simplilearn' | 'susskind' | 'whu' | 'xpro'>} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly platform?: Array - - /** - * - * @type {boolean} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly professional?: boolean - - /** - * The type of learning resource * `course` - Course * `program` - Program * `learning_path` - Learning Path * `podcast` - Podcast * `podcast_episode` - Podcast Episode - * @type {Array<'course' | 'learning_path' | 'podcast' | 'podcast_episode' | 'program'>} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly resource_type?: 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 * `created_on` - Creation Date ascending * `-created_on` - CreationDate descending * `start_date` - Start Date ascending * `-start_date` - Start Date descending * `mitcoursenumber` - MIT course number ascending * `-mitcoursenumber` - MIT course number descending - * @type {'-created_on' | '-id' | '-last_modified' | '-mitcoursenumber' | '-readable_id' | '-start_date' | 'created_on' | 'id' | 'last_modified' | 'mitcoursenumber' | 'readable_id' | 'start_date'} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly sortby?: ProgramsUpcomingListSortbyEnum - - /** - * Multiple values may be separated by commas. - * @type {Array} - * @memberof ProgramsApiProgramsUpcomingList - */ - readonly topic?: Array -} - -/** - * 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.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(this.axios, this.basePath)) - } - - /** - * Get a paginated list of newly released Programs. - * @summary List New - * @param {ProgramsApiProgramsNewListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProgramsApi - */ - public programsNewList( - requestParameters: ProgramsApiProgramsNewListRequest = {}, - options?: RawAxiosRequestConfig - ) { - return ProgramsApiFp(this.configuration) - .programsNewList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - 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)) - } - - /** - * Get a paginated list of upcoming Programs. - * @summary List Upcoming - * @param {ProgramsApiProgramsUpcomingListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProgramsApi - */ - public programsUpcomingList( - requestParameters: ProgramsApiProgramsUpcomingListRequest = {}, - options?: RawAxiosRequestConfig - ) { - return ProgramsApiFp(this.configuration) - .programsUpcomingList( - requestParameters.course_feature, - requestParameters.department, - requestParameters.level, - requestParameters.limit, - requestParameters.offered_by, - requestParameters.offset, - requestParameters.platform, - requestParameters.professional, - requestParameters.resource_type, - requestParameters.sortby, - requestParameters.topic, - options - ) - .then(request => request(this.axios, this.basePath)) - } -} - -/** - * @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", - Res: "RES", - 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", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type ProgramsListOfferedByEnum = - (typeof ProgramsListOfferedByEnum)[keyof typeof ProgramsListOfferedByEnum] -/** - * @export - */ -export const ProgramsListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type ProgramsListPlatformEnum = - (typeof ProgramsListPlatformEnum)[keyof typeof ProgramsListPlatformEnum] -/** - * @export - */ -export const ProgramsListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type ProgramsListResourceTypeEnum = - (typeof ProgramsListResourceTypeEnum)[keyof typeof ProgramsListResourceTypeEnum] -/** - * @export - */ -export const ProgramsListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type ProgramsListSortbyEnum = - (typeof ProgramsListSortbyEnum)[keyof typeof ProgramsListSortbyEnum] -/** - * @export - */ -export const ProgramsNewListDepartmentEnum = { - _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", - Res: "RES", - Sts: "STS", - Wgs: "WGS" -} as const -export type ProgramsNewListDepartmentEnum = - (typeof ProgramsNewListDepartmentEnum)[keyof typeof ProgramsNewListDepartmentEnum] -/** - * @export - */ -export const ProgramsNewListLevelEnum = { - Advanced: "advanced", - Graduate: "graduate", - HighSchool: "high_school", - Intermediate: "intermediate", - Introductory: "introductory", - Noncredit: "noncredit", - Undergraduate: "undergraduate" -} as const -export type ProgramsNewListLevelEnum = - (typeof ProgramsNewListLevelEnum)[keyof typeof ProgramsNewListLevelEnum] -/** - * @export - */ -export const ProgramsNewListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type ProgramsNewListOfferedByEnum = - (typeof ProgramsNewListOfferedByEnum)[keyof typeof ProgramsNewListOfferedByEnum] -/** - * @export - */ -export const ProgramsNewListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type ProgramsNewListPlatformEnum = - (typeof ProgramsNewListPlatformEnum)[keyof typeof ProgramsNewListPlatformEnum] -/** - * @export - */ -export const ProgramsNewListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type ProgramsNewListResourceTypeEnum = - (typeof ProgramsNewListResourceTypeEnum)[keyof typeof ProgramsNewListResourceTypeEnum] -/** - * @export - */ -export const ProgramsNewListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type ProgramsNewListSortbyEnum = - (typeof ProgramsNewListSortbyEnum)[keyof typeof ProgramsNewListSortbyEnum] -/** - * @export - */ -export const ProgramsUpcomingListDepartmentEnum = { - _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", - Res: "RES", - Sts: "STS", - Wgs: "WGS" -} as const -export type ProgramsUpcomingListDepartmentEnum = - (typeof ProgramsUpcomingListDepartmentEnum)[keyof typeof ProgramsUpcomingListDepartmentEnum] -/** - * @export - */ -export const ProgramsUpcomingListLevelEnum = { - Advanced: "advanced", - Graduate: "graduate", - HighSchool: "high_school", - Intermediate: "intermediate", - Introductory: "introductory", - Noncredit: "noncredit", - Undergraduate: "undergraduate" -} as const -export type ProgramsUpcomingListLevelEnum = - (typeof ProgramsUpcomingListLevelEnum)[keyof typeof ProgramsUpcomingListLevelEnum] -/** - * @export - */ -export const ProgramsUpcomingListOfferedByEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Mitpe: "mitpe", - Mitx: "mitx", - Ocw: "ocw", - Scc: "scc", - See: "see", - Xpro: "xpro" -} as const -export type ProgramsUpcomingListOfferedByEnum = - (typeof ProgramsUpcomingListOfferedByEnum)[keyof typeof ProgramsUpcomingListOfferedByEnum] -/** - * @export - */ -export const ProgramsUpcomingListPlatformEnum = { - Bootcamps: "bootcamps", - Csail: "csail", - Ctl: "ctl", - Edx: "edx", - Emeritus: "emeritus", - Globalalumni: "globalalumni", - Mitpe: "mitpe", - Mitxonline: "mitxonline", - Ocw: "ocw", - Oll: "oll", - Podcast: "podcast", - Scc: "scc", - See: "see", - Simplilearn: "simplilearn", - Susskind: "susskind", - Whu: "whu", - Xpro: "xpro" -} as const -export type ProgramsUpcomingListPlatformEnum = - (typeof ProgramsUpcomingListPlatformEnum)[keyof typeof ProgramsUpcomingListPlatformEnum] -/** - * @export - */ -export const ProgramsUpcomingListResourceTypeEnum = { - Course: "course", - LearningPath: "learning_path", - Podcast: "podcast", - PodcastEpisode: "podcast_episode", - Program: "program" -} as const -export type ProgramsUpcomingListResourceTypeEnum = - (typeof ProgramsUpcomingListResourceTypeEnum)[keyof typeof ProgramsUpcomingListResourceTypeEnum] -/** - * @export - */ -export const ProgramsUpcomingListSortbyEnum = { - CreatedOn: "-created_on", - Id: "-id", - LastModified: "-last_modified", - Mitcoursenumber: "-mitcoursenumber", - ReadableId: "-readable_id", - StartDate: "-start_date", - CreatedOn2: "created_on", - Id2: "id", - LastModified2: "last_modified", - Mitcoursenumber2: "mitcoursenumber", - ReadableId2: "readable_id", - StartDate2: "start_date" -} as const -export type ProgramsUpcomingListSortbyEnum = - (typeof ProgramsUpcomingListSortbyEnum)[keyof typeof ProgramsUpcomingListSortbyEnum] - -/** - * TopicsApi - axios parameter creator - * @export - */ -export const TopicsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Topics covered by 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} - */ - topicsList: async ( - limit?: number, - offset?: number, - options: RawAxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/api/v1/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 (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 - } - }, - /** - * 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/v1/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 {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 topicsList( - limit?: number, - offset?: number, - options?: RawAxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.topicsList( - limit, - offset, - 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.limit, requestParameters.offset, 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 { - /** - * Number of results to return per page. - * @type {number} - * @memberof TopicsApiTopicsList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof TopicsApiTopicsList - */ - readonly offset?: number -} - -/** - * 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.limit, requestParameters.offset, 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/v1/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/v1/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/v1/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/v1/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/v1/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/v1/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/v1/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/v1/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 - } - }, - /** - * 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/v1/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/v1/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) - }, - /** - * 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)) - }, - /** - * 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)) - } - - /** - * 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)) - } -} diff --git a/src/open_api_generated/base.ts b/src/open_api_generated/base.ts deleted file mode 100644 index 9d454ca..0000000 --- a/src/open_api_generated/base.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * MIT Open API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v1) - * - * - * 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/src/open_api_generated/common.ts b/src/open_api_generated/common.ts deleted file mode 100644 index 4e7505e..0000000 --- a/src/open_api_generated/common.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * MIT Open API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v1) - * - * - * 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/src/open_api_generated/configuration.ts b/src/open_api_generated/configuration.ts deleted file mode 100644 index b7262fe..0000000 --- a/src/open_api_generated/configuration.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * MIT Open API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v1) - * - * - * 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/src/open_api_generated/index.ts b/src/open_api_generated/index.ts deleted file mode 100644 index bffbc5e..0000000 --- a/src/open_api_generated/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * MIT Open API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v1) - * - * - * 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/src/hooks.ts b/src/useEffectAfterMount.ts similarity index 100% rename from src/hooks.ts rename to src/useEffectAfterMount.ts diff --git a/yarn.lock b/yarn.lock index 5fc895c..9842f3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -731,6 +731,14 @@ dependencies: make-plural "^7.0.0" +"@mitodl/open-api-axios@^2024.3.22": + version "2024.3.22" + resolved "https://registry.yarnpkg.com/@mitodl/open-api-axios/-/open-api-axios-2024.3.22.tgz#85aed96bd6c80389b1c36b514818a68178d2ee47" + integrity sha512-abX88MIyk697KZ4OGB5HP61CDUXCi2L0xD8xIb8G28s03OwO2KyZa5EHDmhhGq9Si5sLZzpfLSJkwd42FOJjJQ== + dependencies: + "@types/node" "^20.11.19" + axios "^1.6.5" + "@nodelib/fs.scandir@2.1.3": version "2.1.3" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz" @@ -1104,6 +1112,13 @@ resolved "https://registry.npmjs.org/@types/node/-/node-14.18.29.tgz" integrity sha512-LhF+9fbIX4iPzhsRLpK5H7iPdvW8L4IwGciXQIOEcuF62+9nw/VQVsOViAOOGxY3OlOKGLFv0sWwJXdwQeTn6A== +"@types/node@^20.11.19": + version "20.11.30" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.30.tgz#9c33467fc23167a347e73834f788f4b9f399d66f" + integrity sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw== + dependencies: + undici-types "~5.26.4" + "@types/prettier@^2.1.5": version "2.7.0" resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.0.tgz" @@ -1553,6 +1568,15 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +axios@^1.6.5: + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^1.6.7: version "1.6.7" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" @@ -2685,6 +2709,11 @@ follow-redirects@^1.15.4: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -5158,6 +5187,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + universalify@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz"