@easyedu/js-lsm-api 1.111.0 → 1.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/.openapi-generator/FILES +22 -0
  2. package/README.md +14 -2
  3. package/dist/apis/QuestionImportApi.d.ts +51 -0
  4. package/dist/apis/QuestionImportApi.js +135 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/apis/QuestionImportApi.d.ts +51 -0
  8. package/dist/esm/apis/QuestionImportApi.js +131 -0
  9. package/dist/esm/apis/index.d.ts +1 -0
  10. package/dist/esm/apis/index.js +1 -0
  11. package/dist/esm/models/GetQuestion.d.ts +7 -0
  12. package/dist/esm/models/GetQuestion.js +3 -0
  13. package/dist/esm/models/PostQuestionImportCommit.d.ts +58 -0
  14. package/dist/esm/models/PostQuestionImportCommit.js +59 -0
  15. package/dist/esm/models/PostQuestionImportCommitItem.d.ts +72 -0
  16. package/dist/esm/models/PostQuestionImportCommitItem.js +66 -0
  17. package/dist/esm/models/PostQuestionImportCommitResponse.d.ts +51 -0
  18. package/dist/esm/models/PostQuestionImportCommitResponse.js +56 -0
  19. package/dist/esm/models/PostQuestionImportParseResponse.d.ts +71 -0
  20. package/dist/esm/models/PostQuestionImportParseResponse.js +70 -0
  21. package/dist/esm/models/QuestionImportCommitResult.d.ts +53 -0
  22. package/dist/esm/models/QuestionImportCommitResult.js +57 -0
  23. package/dist/esm/models/QuestionImportDraft.d.ts +76 -0
  24. package/dist/esm/models/QuestionImportDraft.js +69 -0
  25. package/dist/esm/models/QuestionImportDuplicate.d.ts +66 -0
  26. package/dist/esm/models/QuestionImportDuplicate.js +62 -0
  27. package/dist/esm/models/QuestionImportPreviewImage.d.ts +84 -0
  28. package/dist/esm/models/QuestionImportPreviewImage.js +76 -0
  29. package/dist/esm/models/QuestionImportSource.d.ts +56 -0
  30. package/dist/esm/models/QuestionImportSource.js +57 -0
  31. package/dist/esm/models/QuestionImportSourceSummary.d.ts +50 -0
  32. package/dist/esm/models/QuestionImportSourceSummary.js +53 -0
  33. package/dist/esm/models/index.d.ts +10 -0
  34. package/dist/esm/models/index.js +10 -0
  35. package/dist/models/GetQuestion.d.ts +7 -0
  36. package/dist/models/GetQuestion.js +3 -0
  37. package/dist/models/PostQuestionImportCommit.d.ts +58 -0
  38. package/dist/models/PostQuestionImportCommit.js +66 -0
  39. package/dist/models/PostQuestionImportCommitItem.d.ts +72 -0
  40. package/dist/models/PostQuestionImportCommitItem.js +74 -0
  41. package/dist/models/PostQuestionImportCommitResponse.d.ts +51 -0
  42. package/dist/models/PostQuestionImportCommitResponse.js +63 -0
  43. package/dist/models/PostQuestionImportParseResponse.d.ts +71 -0
  44. package/dist/models/PostQuestionImportParseResponse.js +77 -0
  45. package/dist/models/QuestionImportCommitResult.d.ts +53 -0
  46. package/dist/models/QuestionImportCommitResult.js +65 -0
  47. package/dist/models/QuestionImportDraft.d.ts +76 -0
  48. package/dist/models/QuestionImportDraft.js +76 -0
  49. package/dist/models/QuestionImportDuplicate.d.ts +66 -0
  50. package/dist/models/QuestionImportDuplicate.js +70 -0
  51. package/dist/models/QuestionImportPreviewImage.d.ts +84 -0
  52. package/dist/models/QuestionImportPreviewImage.js +84 -0
  53. package/dist/models/QuestionImportSource.d.ts +56 -0
  54. package/dist/models/QuestionImportSource.js +64 -0
  55. package/dist/models/QuestionImportSourceSummary.d.ts +50 -0
  56. package/dist/models/QuestionImportSourceSummary.js +60 -0
  57. package/dist/models/index.d.ts +10 -0
  58. package/dist/models/index.js +10 -0
  59. package/docs/GetQuestion.md +2 -0
  60. package/docs/PostQuestionImportCommit.md +42 -0
  61. package/docs/PostQuestionImportCommitItem.md +44 -0
  62. package/docs/PostQuestionImportCommitResponse.md +40 -0
  63. package/docs/PostQuestionImportParseResponse.md +46 -0
  64. package/docs/QuestionImportApi.md +149 -0
  65. package/docs/QuestionImportCommitResult.md +38 -0
  66. package/docs/QuestionImportDraft.md +48 -0
  67. package/docs/QuestionImportDuplicate.md +42 -0
  68. package/docs/QuestionImportPreviewImage.md +48 -0
  69. package/docs/QuestionImportSource.md +42 -0
  70. package/docs/QuestionImportSourceSummary.md +40 -0
  71. package/package.json +1 -1
  72. package/src/apis/QuestionImportApi.ts +162 -0
  73. package/src/apis/index.ts +1 -0
  74. package/src/models/GetQuestion.ts +15 -0
  75. package/src/models/PostQuestionImportCommit.ts +116 -0
  76. package/src/models/PostQuestionImportCommitItem.ts +128 -0
  77. package/src/models/PostQuestionImportCommitResponse.ts +101 -0
  78. package/src/models/PostQuestionImportParseResponse.ts +142 -0
  79. package/src/models/QuestionImportCommitResult.ts +95 -0
  80. package/src/models/QuestionImportDraft.ts +142 -0
  81. package/src/models/QuestionImportDuplicate.ts +112 -0
  82. package/src/models/QuestionImportPreviewImage.ts +140 -0
  83. package/src/models/QuestionImportSource.ts +101 -0
  84. package/src/models/QuestionImportSourceSummary.ts +92 -0
  85. package/src/models/index.ts +10 -0
@@ -0,0 +1,162 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * LMS API
5
+ * LMS API
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import * as runtime from '../runtime';
16
+ import {
17
+ type PostQuestionImportCommit,
18
+ PostQuestionImportCommitFromJSON,
19
+ PostQuestionImportCommitToJSON,
20
+ } from '../models/PostQuestionImportCommit';
21
+ import {
22
+ type PostQuestionImportCommitResponse,
23
+ PostQuestionImportCommitResponseFromJSON,
24
+ PostQuestionImportCommitResponseToJSON,
25
+ } from '../models/PostQuestionImportCommitResponse';
26
+ import {
27
+ type PostQuestionImportParseResponse,
28
+ PostQuestionImportParseResponseFromJSON,
29
+ PostQuestionImportParseResponseToJSON,
30
+ } from '../models/PostQuestionImportParseResponse';
31
+
32
+ export interface PostQuestionImportCommitRequest {
33
+ postQuestionImportCommit: PostQuestionImportCommit;
34
+ }
35
+
36
+ export interface PostQuestionImportParseRequest {
37
+ file: Blob;
38
+ sourceLabel?: string;
39
+ }
40
+
41
+ /**
42
+ *
43
+ */
44
+ export class QuestionImportApi extends runtime.BaseAPI {
45
+
46
+ /**
47
+ * Creates request options for postQuestionImportCommit without sending the request
48
+ */
49
+ async postQuestionImportCommitRequestOpts(requestParameters: PostQuestionImportCommitRequest): Promise<runtime.RequestOpts> {
50
+ if (requestParameters['postQuestionImportCommit'] == null) {
51
+ throw new runtime.RequiredError(
52
+ 'postQuestionImportCommit',
53
+ 'Required parameter "postQuestionImportCommit" was null or undefined when calling postQuestionImportCommit().'
54
+ );
55
+ }
56
+
57
+ const queryParameters: any = {};
58
+
59
+ const headerParameters: runtime.HTTPHeaders = {};
60
+
61
+ headerParameters['Content-Type'] = 'application/json';
62
+
63
+
64
+ let urlPath = `/question-imports/commit`;
65
+
66
+ return {
67
+ path: urlPath,
68
+ method: 'POST',
69
+ headers: headerParameters,
70
+ query: queryParameters,
71
+ body: PostQuestionImportCommitToJSON(requestParameters['postQuestionImportCommit']),
72
+ };
73
+ }
74
+
75
+ /**
76
+ * Validate and atomically create, version, or skip approved question drafts
77
+ */
78
+ async postQuestionImportCommitRaw(requestParameters: PostQuestionImportCommitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostQuestionImportCommitResponse>> {
79
+ const requestOptions = await this.postQuestionImportCommitRequestOpts(requestParameters);
80
+ const response = await this.request(requestOptions, initOverrides);
81
+
82
+ return new runtime.JSONApiResponse(response, (jsonValue) => PostQuestionImportCommitResponseFromJSON(jsonValue));
83
+ }
84
+
85
+ /**
86
+ * Validate and atomically create, version, or skip approved question drafts
87
+ */
88
+ async postQuestionImportCommit(requestParameters: PostQuestionImportCommitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostQuestionImportCommitResponse> {
89
+ const response = await this.postQuestionImportCommitRaw(requestParameters, initOverrides);
90
+ return await response.value();
91
+ }
92
+
93
+ /**
94
+ * Creates request options for postQuestionImportParse without sending the request
95
+ */
96
+ async postQuestionImportParseRequestOpts(requestParameters: PostQuestionImportParseRequest): Promise<runtime.RequestOpts> {
97
+ if (requestParameters['file'] == null) {
98
+ throw new runtime.RequiredError(
99
+ 'file',
100
+ 'Required parameter "file" was null or undefined when calling postQuestionImportParse().'
101
+ );
102
+ }
103
+
104
+ const queryParameters: any = {};
105
+
106
+ const headerParameters: runtime.HTTPHeaders = {};
107
+
108
+ const consumes: runtime.Consume[] = [
109
+ { contentType: 'multipart/form-data' },
110
+ ];
111
+ // @ts-ignore: canConsumeForm may be unused
112
+ const canConsumeForm = runtime.canConsumeForm(consumes);
113
+
114
+ let formParams: { append(param: string, value: any): any };
115
+ let useForm = false;
116
+ // use FormData to transmit files using content-type "multipart/form-data"
117
+ useForm = canConsumeForm;
118
+ if (useForm) {
119
+ formParams = new FormData();
120
+ } else {
121
+ formParams = new URLSearchParams();
122
+ }
123
+
124
+ if (requestParameters['file'] != null) {
125
+ formParams.append('file', requestParameters['file'] as any);
126
+ }
127
+
128
+ if (requestParameters['sourceLabel'] != null) {
129
+ formParams.append('source_label', requestParameters['sourceLabel'] as any);
130
+ }
131
+
132
+
133
+ let urlPath = `/question-imports/parse`;
134
+
135
+ return {
136
+ path: urlPath,
137
+ method: 'POST',
138
+ headers: headerParameters,
139
+ query: queryParameters,
140
+ body: formParams,
141
+ };
142
+ }
143
+
144
+ /**
145
+ * Parse a question document into stateless review drafts
146
+ */
147
+ async postQuestionImportParseRaw(requestParameters: PostQuestionImportParseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostQuestionImportParseResponse>> {
148
+ const requestOptions = await this.postQuestionImportParseRequestOpts(requestParameters);
149
+ const response = await this.request(requestOptions, initOverrides);
150
+
151
+ return new runtime.JSONApiResponse(response, (jsonValue) => PostQuestionImportParseResponseFromJSON(jsonValue));
152
+ }
153
+
154
+ /**
155
+ * Parse a question document into stateless review drafts
156
+ */
157
+ async postQuestionImportParse(requestParameters: PostQuestionImportParseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostQuestionImportParseResponse> {
158
+ const response = await this.postQuestionImportParseRaw(requestParameters, initOverrides);
159
+ return await response.value();
160
+ }
161
+
162
+ }
package/src/apis/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from './PlayerApi';
17
17
  export * from './PortalApi';
18
18
  export * from './PortalSublicenseApi';
19
19
  export * from './QuestionApi';
20
+ export * from './QuestionImportApi';
20
21
  export * from './ReportingApi';
21
22
  export * from './RichTextApi';
22
23
  export * from './RoleApi';
@@ -34,6 +34,13 @@ import {
34
34
  GetQuestionAnswerChoicesInnerToJSON,
35
35
  GetQuestionAnswerChoicesInnerToJSONTyped,
36
36
  } from './GetQuestionAnswerChoicesInner';
37
+ import type { QuestionImportSourceSummary } from './QuestionImportSourceSummary';
38
+ import {
39
+ QuestionImportSourceSummaryFromJSON,
40
+ QuestionImportSourceSummaryFromJSONTyped,
41
+ QuestionImportSourceSummaryToJSON,
42
+ QuestionImportSourceSummaryToJSONTyped,
43
+ } from './QuestionImportSourceSummary';
37
44
  import type { GetQuestionQuizzesInner } from './GetQuestionQuizzesInner';
38
45
  import {
39
46
  GetQuestionQuizzesInnerFromJSON,
@@ -132,6 +139,12 @@ export interface GetQuestion {
132
139
  * @memberof GetQuestion
133
140
  */
134
141
  readonly quizzes?: Array<GetQuestionQuizzesInner>;
142
+ /**
143
+ *
144
+ * @type {QuestionImportSourceSummary}
145
+ * @memberof GetQuestion
146
+ */
147
+ importSource?: QuestionImportSourceSummary;
135
148
  }
136
149
 
137
150
 
@@ -186,6 +199,7 @@ export function GetQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean
186
199
  'createdBy': json['created_by'] == null ? undefined : json['created_by'],
187
200
  'quizCount': json['quiz_count'] == null ? undefined : json['quiz_count'],
188
201
  'quizzes': json['quizzes'] == null ? undefined : ((json['quizzes'] as Array<any>).map(GetQuestionQuizzesInnerFromJSON)),
202
+ 'importSource': json['import_source'] == null ? undefined : QuestionImportSourceSummaryFromJSON(json['import_source']),
189
203
  };
190
204
  }
191
205
 
@@ -207,6 +221,7 @@ export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'version_n
207
221
  'explanation': RichTextDocumentToJSON(value['explanation']),
208
222
  'tags': value['tags'] == null ? undefined : ((value['tags'] as Array<any>).map(ContentLibraryTagToJSON)),
209
223
  'version': value['version'],
224
+ 'import_source': QuestionImportSourceSummaryToJSON(value['importSource']),
210
225
  };
211
226
  }
212
227
 
@@ -0,0 +1,116 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * LMS API
5
+ * LMS API
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { PostQuestionImportCommitItem } from './PostQuestionImportCommitItem';
17
+ import {
18
+ PostQuestionImportCommitItemFromJSON,
19
+ PostQuestionImportCommitItemFromJSONTyped,
20
+ PostQuestionImportCommitItemToJSON,
21
+ PostQuestionImportCommitItemToJSONTyped,
22
+ } from './PostQuestionImportCommitItem';
23
+ import type { QuestionImportPreviewImage } from './QuestionImportPreviewImage';
24
+ import {
25
+ QuestionImportPreviewImageFromJSON,
26
+ QuestionImportPreviewImageFromJSONTyped,
27
+ QuestionImportPreviewImageToJSON,
28
+ QuestionImportPreviewImageToJSONTyped,
29
+ } from './QuestionImportPreviewImage';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface PostQuestionImportCommit
35
+ */
36
+ export interface PostQuestionImportCommit {
37
+ /**
38
+ *
39
+ * @type {string}
40
+ * @memberof PostQuestionImportCommit
41
+ */
42
+ importToken: string;
43
+ /**
44
+ *
45
+ * @type {string}
46
+ * @memberof PostQuestionImportCommit
47
+ */
48
+ sourceLabel: string;
49
+ /**
50
+ * Tags applied to every created question in addition to per-question tags
51
+ * @type {Array<string>}
52
+ * @memberof PostQuestionImportCommit
53
+ */
54
+ tags?: Array<string>;
55
+ /**
56
+ *
57
+ * @type {Array<PostQuestionImportCommitItem>}
58
+ * @memberof PostQuestionImportCommit
59
+ */
60
+ questions: Array<PostQuestionImportCommitItem>;
61
+ /**
62
+ *
63
+ * @type {Array<QuestionImportPreviewImage>}
64
+ * @memberof PostQuestionImportCommit
65
+ */
66
+ images: Array<QuestionImportPreviewImage>;
67
+ }
68
+
69
+ /**
70
+ * Check if a given object implements the PostQuestionImportCommit interface.
71
+ */
72
+ export function instanceOfPostQuestionImportCommit(value: object): value is PostQuestionImportCommit {
73
+ if (!('importToken' in value) || value['importToken'] === undefined) return false;
74
+ if (!('sourceLabel' in value) || value['sourceLabel'] === undefined) return false;
75
+ if (!('questions' in value) || value['questions'] === undefined) return false;
76
+ if (!('images' in value) || value['images'] === undefined) return false;
77
+ return true;
78
+ }
79
+
80
+ export function PostQuestionImportCommitFromJSON(json: any): PostQuestionImportCommit {
81
+ return PostQuestionImportCommitFromJSONTyped(json, false);
82
+ }
83
+
84
+ export function PostQuestionImportCommitFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostQuestionImportCommit {
85
+ if (json == null) {
86
+ return json;
87
+ }
88
+ return {
89
+
90
+ 'importToken': json['import_token'],
91
+ 'sourceLabel': json['source_label'],
92
+ 'tags': json['tags'] == null ? undefined : json['tags'],
93
+ 'questions': ((json['questions'] as Array<any>).map(PostQuestionImportCommitItemFromJSON)),
94
+ 'images': ((json['images'] as Array<any>).map(QuestionImportPreviewImageFromJSON)),
95
+ };
96
+ }
97
+
98
+ export function PostQuestionImportCommitToJSON(json: any): PostQuestionImportCommit {
99
+ return PostQuestionImportCommitToJSONTyped(json, false);
100
+ }
101
+
102
+ export function PostQuestionImportCommitToJSONTyped(value?: PostQuestionImportCommit | null, ignoreDiscriminator: boolean = false): any {
103
+ if (value == null) {
104
+ return value;
105
+ }
106
+
107
+ return {
108
+
109
+ 'import_token': value['importToken'],
110
+ 'source_label': value['sourceLabel'],
111
+ 'tags': value['tags'],
112
+ 'questions': ((value['questions'] as Array<any>).map(PostQuestionImportCommitItemToJSON)),
113
+ 'images': ((value['images'] as Array<any>).map(QuestionImportPreviewImageToJSON)),
114
+ };
115
+ }
116
+
@@ -0,0 +1,128 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * LMS API
5
+ * LMS API
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { PostQuestion } from './PostQuestion';
17
+ import {
18
+ PostQuestionFromJSON,
19
+ PostQuestionFromJSONTyped,
20
+ PostQuestionToJSON,
21
+ PostQuestionToJSONTyped,
22
+ } from './PostQuestion';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface PostQuestionImportCommitItem
28
+ */
29
+ export interface PostQuestionImportCommitItem {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof PostQuestionImportCommitItem
34
+ */
35
+ draftId: string;
36
+ /**
37
+ * Create a separate question, create a new version of the matched question, or skip the draft
38
+ * @type {PostQuestionImportCommitItemActionEnum}
39
+ * @memberof PostQuestionImportCommitItem
40
+ */
41
+ action: PostQuestionImportCommitItemActionEnum;
42
+ /**
43
+ * Matched question to version; required only when action is create_version and must match the signed parse result
44
+ * @type {string}
45
+ * @memberof PostQuestionImportCommitItem
46
+ */
47
+ targetQuestionId?: string | null;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof PostQuestionImportCommitItem
52
+ */
53
+ sourceKey?: string | null;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof PostQuestionImportCommitItem
58
+ */
59
+ sourceLocation?: string | null;
60
+ /**
61
+ *
62
+ * @type {PostQuestion}
63
+ * @memberof PostQuestionImportCommitItem
64
+ */
65
+ question: PostQuestion;
66
+ }
67
+
68
+
69
+ /**
70
+ * @export
71
+ */
72
+ export const PostQuestionImportCommitItemActionEnum = {
73
+ Create: 'create',
74
+ CreateVersion: 'create_version',
75
+ Skip: 'skip'
76
+ } as const;
77
+ export type PostQuestionImportCommitItemActionEnum = typeof PostQuestionImportCommitItemActionEnum[keyof typeof PostQuestionImportCommitItemActionEnum];
78
+
79
+
80
+ /**
81
+ * Check if a given object implements the PostQuestionImportCommitItem interface.
82
+ */
83
+ export function instanceOfPostQuestionImportCommitItem(value: object): value is PostQuestionImportCommitItem {
84
+ if (!('draftId' in value) || value['draftId'] === undefined) return false;
85
+ if (!('action' in value) || value['action'] === undefined) return false;
86
+ if (!('question' in value) || value['question'] === undefined) return false;
87
+ return true;
88
+ }
89
+
90
+ export function PostQuestionImportCommitItemFromJSON(json: any): PostQuestionImportCommitItem {
91
+ return PostQuestionImportCommitItemFromJSONTyped(json, false);
92
+ }
93
+
94
+ export function PostQuestionImportCommitItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostQuestionImportCommitItem {
95
+ if (json == null) {
96
+ return json;
97
+ }
98
+ return {
99
+
100
+ 'draftId': json['draft_id'],
101
+ 'action': json['action'],
102
+ 'targetQuestionId': json['target_question_id'] == null ? undefined : json['target_question_id'],
103
+ 'sourceKey': json['source_key'] == null ? undefined : json['source_key'],
104
+ 'sourceLocation': json['source_location'] == null ? undefined : json['source_location'],
105
+ 'question': PostQuestionFromJSON(json['question']),
106
+ };
107
+ }
108
+
109
+ export function PostQuestionImportCommitItemToJSON(json: any): PostQuestionImportCommitItem {
110
+ return PostQuestionImportCommitItemToJSONTyped(json, false);
111
+ }
112
+
113
+ export function PostQuestionImportCommitItemToJSONTyped(value?: PostQuestionImportCommitItem | null, ignoreDiscriminator: boolean = false): any {
114
+ if (value == null) {
115
+ return value;
116
+ }
117
+
118
+ return {
119
+
120
+ 'draft_id': value['draftId'],
121
+ 'action': value['action'],
122
+ 'target_question_id': value['targetQuestionId'],
123
+ 'source_key': value['sourceKey'],
124
+ 'source_location': value['sourceLocation'],
125
+ 'question': PostQuestionToJSON(value['question']),
126
+ };
127
+ }
128
+
@@ -0,0 +1,101 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * LMS API
5
+ * LMS API
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { QuestionImportCommitResult } from './QuestionImportCommitResult';
17
+ import {
18
+ QuestionImportCommitResultFromJSON,
19
+ QuestionImportCommitResultFromJSONTyped,
20
+ QuestionImportCommitResultToJSON,
21
+ QuestionImportCommitResultToJSONTyped,
22
+ } from './QuestionImportCommitResult';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface PostQuestionImportCommitResponse
28
+ */
29
+ export interface PostQuestionImportCommitResponse {
30
+ /**
31
+ *
32
+ * @type {number}
33
+ * @memberof PostQuestionImportCommitResponse
34
+ */
35
+ createdCount: number;
36
+ /**
37
+ * Number of created rows that are new versions of existing questions
38
+ * @type {number}
39
+ * @memberof PostQuestionImportCommitResponse
40
+ */
41
+ versionedCount: number;
42
+ /**
43
+ *
44
+ * @type {number}
45
+ * @memberof PostQuestionImportCommitResponse
46
+ */
47
+ skippedCount: number;
48
+ /**
49
+ *
50
+ * @type {Array<QuestionImportCommitResult>}
51
+ * @memberof PostQuestionImportCommitResponse
52
+ */
53
+ items: Array<QuestionImportCommitResult>;
54
+ }
55
+
56
+ /**
57
+ * Check if a given object implements the PostQuestionImportCommitResponse interface.
58
+ */
59
+ export function instanceOfPostQuestionImportCommitResponse(value: object): value is PostQuestionImportCommitResponse {
60
+ if (!('createdCount' in value) || value['createdCount'] === undefined) return false;
61
+ if (!('versionedCount' in value) || value['versionedCount'] === undefined) return false;
62
+ if (!('skippedCount' in value) || value['skippedCount'] === undefined) return false;
63
+ if (!('items' in value) || value['items'] === undefined) return false;
64
+ return true;
65
+ }
66
+
67
+ export function PostQuestionImportCommitResponseFromJSON(json: any): PostQuestionImportCommitResponse {
68
+ return PostQuestionImportCommitResponseFromJSONTyped(json, false);
69
+ }
70
+
71
+ export function PostQuestionImportCommitResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostQuestionImportCommitResponse {
72
+ if (json == null) {
73
+ return json;
74
+ }
75
+ return {
76
+
77
+ 'createdCount': json['created_count'],
78
+ 'versionedCount': json['versioned_count'],
79
+ 'skippedCount': json['skipped_count'],
80
+ 'items': ((json['items'] as Array<any>).map(QuestionImportCommitResultFromJSON)),
81
+ };
82
+ }
83
+
84
+ export function PostQuestionImportCommitResponseToJSON(json: any): PostQuestionImportCommitResponse {
85
+ return PostQuestionImportCommitResponseToJSONTyped(json, false);
86
+ }
87
+
88
+ export function PostQuestionImportCommitResponseToJSONTyped(value?: PostQuestionImportCommitResponse | null, ignoreDiscriminator: boolean = false): any {
89
+ if (value == null) {
90
+ return value;
91
+ }
92
+
93
+ return {
94
+
95
+ 'created_count': value['createdCount'],
96
+ 'versioned_count': value['versionedCount'],
97
+ 'skipped_count': value['skippedCount'],
98
+ 'items': ((value['items'] as Array<any>).map(QuestionImportCommitResultToJSON)),
99
+ };
100
+ }
101
+