OpenSource » SampleCode » NexPortWebApiClient
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

Initial commit

Changeset 3d5e60ea4d83

by Profile picture of Thai NguyenThai Nguyen

Changes to 94 files · Browse files at 3d5e60ea4d83 Diff from another changeset...

Change 1 of 1 Show Entire File .hgignore Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+syntax: glob +.vs/** +*/bin/** +*/obj/** +NexportApi.sln.DotSettings.user
Change 1 of 1 Show Entire File NexportApi.sln Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@@ -0,0 +1,25 @@
+ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.329 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NexportApi", "NexportApi\NexportApi.csproj", "{0EF49E24-0A45-402B-AF46-C39850E46DF1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0EF49E24-0A45-402B-AF46-C39850E46DF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EF49E24-0A45-402B-AF46-C39850E46DF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EF49E24-0A45-402B-AF46-C39850E46DF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EF49E24-0A45-402B-AF46-C39850E46DF1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B4918B87-912F-49D8-9AC0-890CBCCEB2F9} + EndGlobalSection +EndGlobal
Show Entire File NexportApi/​Api/​AdminApiApi.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Api/​LearningApiApi.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File NexportApi/​Api/​PostmanApiApi.cs Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
@@ -0,0 +1,259 @@
+/* + * NexportVirtualCampus + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using RestSharp; +using NexportApi.Client; +using NexportApi.Model; + +namespace NexportApi.Api +{ + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface IPostmanApiApi : IApiAccessor + { + #region Synchronous Operations + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) + /// </summary> + /// <remarks> + /// Get a postman collection of all visible api + /// </remarks> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>PostmanCollectionGet</returns> + PostmanCollectionGet PostmanApiGetPostmanCollection(); + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) + /// </summary> + /// <remarks> + /// Get a postman collection of all visible api + /// </remarks> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of PostmanCollectionGet</returns> + ApiResponse<PostmanCollectionGet> PostmanApiGetPostmanCollectionWithHttpInfo(); + + + #endregion Synchronous Operations + + #region Asynchronous Operations + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) + /// </summary> + /// <remarks> + /// Get a postman collection of all visible api + /// </remarks> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>Task of PostmanCollectionGet</returns> + Task<PostmanCollectionGet> PostmanApiGetPostmanCollectionAsync(); + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) + /// </summary> + /// <remarks> + /// Get a postman collection of all visible api + /// </remarks> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>Task of ApiResponse (PostmanCollectionGet)</returns> + Task<ApiResponse<PostmanCollectionGet>> PostmanApiGetPostmanCollectionAsyncWithHttpInfo(); + + + #endregion Asynchronous Operations + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public class PostmanApiApi : IPostmanApiApi + { + private ExceptionFactory _exceptionFactory = (name, response) => null; + + /// <summary> + /// Initializes a new instance of the <see cref="PostmanApiApi"/> class. + /// </summary> + /// <returns></returns> + public PostmanApiApi(string basePath) + { + Configuration = new Configuration { BasePath = basePath }; + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="PostmanApiApi"/> class + /// using Configuration object + /// </summary> + /// <param name="configuration">An instance of Configuration</param> + /// <returns></returns> + public PostmanApiApi(Configuration configuration = null) + { + Configuration = configuration ?? Configuration.Default; + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Gets the base path of the API client. + /// </summary> + /// <value>The base path</value> + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// <summary> + /// Gets or sets the configuration object + /// </summary> + /// <value>An instance of the Configuration</value> + public Configuration Configuration {get; set;} + + /// <summary> + /// Provides a factory method hook for the creation of exceptions. + /// </summary> + public ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + + set => _exceptionFactory = value; + } + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) Get a postman collection of all visible api + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>PostmanCollectionGet</returns> + public PostmanCollectionGet PostmanApiGetPostmanCollection () + { + var localVarResponse = PostmanApiGetPostmanCollectionWithHttpInfo(); + return localVarResponse.Data; + } + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) Get a postman collection of all visible api + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of PostmanCollectionGet</returns> + public ApiResponse< PostmanCollectionGet > PostmanApiGetPostmanCollectionWithHttpInfo() + { + + var localVarPath = "/api/v1/PostmanApi/GetPostmanCollection"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + var localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("PostmanApiGetPostmanCollection", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<PostmanCollectionGet>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (PostmanCollectionGet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostmanCollectionGet))); + } + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) Get a postman collection of all visible api + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>Task of PostmanCollectionGet</returns> + public async System.Threading.Tasks.Task<PostmanCollectionGet> PostmanApiGetPostmanCollectionAsync () + { + var localVarResponse = await PostmanApiGetPostmanCollectionAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// <summary> + /// Get a postman collection of all visible Api (Get the [POSTMAN](http://www.getpostman.com) chrome extension) Get a postman collection of all visible api + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <returns>Task of ApiResponse (PostmanCollectionGet)</returns> + public async System.Threading.Tasks.Task<ApiResponse<PostmanCollectionGet>> PostmanApiGetPostmanCollectionAsyncWithHttpInfo() + { + + var localVarPath = "/api/v1/PostmanApi/GetPostmanCollection"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("PostmanApiGetPostmanCollection", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<PostmanCollectionGet>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (PostmanCollectionGet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostmanCollectionGet))); + } + + } +}
Change 1 of 1 Show Entire File NexportApi/​Api/​ScormApiApi.cs Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
@@ -0,0 +1,512 @@
+/* + * NexportVirtualCampus + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using RestSharp; +using NexportApi.Client; +using NexportApi.Model; + +namespace NexportApi.Api +{ + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface IScormApiApi : IApiAccessor + { + #region Synchronous Operations + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>EditScormDataResponse</returns> + EditScormDataResponse ScormApiEditScormData(EditScormDataRequest request, string accessToken); + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>ApiResponse of EditScormDataResponse</returns> + ApiResponse<EditScormDataResponse> ScormApiEditScormDataWithHttpInfo(EditScormDataRequest request, string accessToken); + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>List&lt;GetCmiDataResponseItem&gt;</returns> + List<GetCmiDataResponseItem> ScormApiGetCmiData(GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null); + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>ApiResponse of List&lt;GetCmiDataResponseItem&gt;</returns> + ApiResponse<List<GetCmiDataResponseItem>> ScormApiGetCmiDataWithHttpInfo(GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null); + + + #endregion Synchronous Operations + + #region Asynchronous Operations + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of EditScormDataResponse</returns> + Task<EditScormDataResponse> ScormApiEditScormDataAsync(EditScormDataRequest request, string accessToken); + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of ApiResponse (EditScormDataResponse)</returns> + Task<ApiResponse<EditScormDataResponse>> ScormApiEditScormDataAsyncWithHttpInfo(EditScormDataRequest request, string accessToken); + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>Task of List&lt;GetCmiDataResponseItem&gt;</returns> + Task<List<GetCmiDataResponseItem>> ScormApiGetCmiDataAsync(GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null); + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>Task of ApiResponse (List&lt;GetCmiDataResponseItem&gt;)</returns> + Task<ApiResponse<List<GetCmiDataResponseItem>>> ScormApiGetCmiDataAsyncWithHttpInfo(GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null); + + + #endregion Asynchronous Operations + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public class ScormApiApi : IScormApiApi + { + private ExceptionFactory _exceptionFactory = (name, response) => null; + + /// <summary> + /// Initializes a new instance of the <see cref="ScormApiApi"/> class. + /// </summary> + /// <returns></returns> + public ScormApiApi(string basePath) + { + Configuration = new Configuration { BasePath = basePath }; + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ScormApiApi"/> class + /// using Configuration object + /// </summary> + /// <param name="configuration">An instance of Configuration</param> + /// <returns></returns> + public ScormApiApi(Configuration configuration = null) + { + Configuration = configuration ?? Configuration.Default; + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Gets the base path of the API client. + /// </summary> + /// <value>The base path</value> + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// <summary> + /// Gets or sets the configuration object + /// </summary> + /// <value>An instance of the Configuration</value> + public Configuration Configuration {get; set;} + + /// <summary> + /// Provides a factory method hook for the creation of exceptions. + /// </summary> + public ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + + set => _exceptionFactory = value; + } + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>EditScormDataResponse</returns> + public EditScormDataResponse ScormApiEditScormData (EditScormDataRequest request, string accessToken) + { + var localVarResponse = ScormApiEditScormDataWithHttpInfo(request, accessToken); + return localVarResponse.Data; + } + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>ApiResponse of EditScormDataResponse</returns> + public ApiResponse< EditScormDataResponse > ScormApiEditScormDataWithHttpInfo(EditScormDataRequest request, string accessToken) + { + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApiApi->ScormApiEditScormData"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApiApi->ScormApiEditScormData"); + + var localVarPath = "/api/v1/ScormApi/EditScormData"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (request != null && request.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(request); // http body (model) parameter + } + else + { + localVarPostBody = request; // byte array + } + + + // make the HTTP request + var localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("ScormApiEditScormData", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<EditScormDataResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (EditScormDataResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(EditScormDataResponse))); + } + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of EditScormDataResponse</returns> + public async System.Threading.Tasks.Task<EditScormDataResponse> ScormApiEditScormDataAsync (EditScormDataRequest request, string accessToken) + { + var localVarResponse = await ScormApiEditScormDataAsyncWithHttpInfo(request, accessToken); + return localVarResponse.Data; + + } + + /// <summary> + /// Edits data for a student's SCORM courseware attempt and corresponding history (if applicable) based on the supplied assignment status id and SCO id. If a field is not passed in, the value will remain unchanged. Requires the Update Section Enrollments permission in the assignment status enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of ApiResponse (EditScormDataResponse)</returns> + public async System.Threading.Tasks.Task<ApiResponse<EditScormDataResponse>> ScormApiEditScormDataAsyncWithHttpInfo(EditScormDataRequest request, string accessToken) + { + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApiApi->ScormApiEditScormData"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApiApi->ScormApiEditScormData"); + + var localVarPath = "/api/v1/ScormApi/EditScormData"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (request != null && request.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(request); // http body (model) parameter + } + else + { + localVarPostBody = request; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("ScormApiEditScormData", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<EditScormDataResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (EditScormDataResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(EditScormDataResponse))); + } + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>List&lt;GetCmiDataResponseItem&gt;</returns> + public List<GetCmiDataResponseItem> ScormApiGetCmiData (GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null) + { + var localVarResponse = ScormApiGetCmiDataWithHttpInfo(request, accessToken, page, perPage); + return localVarResponse.Data; + } + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>ApiResponse of List&lt;GetCmiDataResponseItem&gt;</returns> + public ApiResponse< List<GetCmiDataResponseItem> > ScormApiGetCmiDataWithHttpInfo(GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null) + { + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApiApi->ScormApiGetCmiData"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApiApi->ScormApiGetCmiData"); + + var localVarPath = "/api/v1/ScormApi/GetCmiData"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (page != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "page", page)); // query parameter + if (perPage != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "per_page", perPage)); // query parameter + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (request != null && request.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(request); // http body (model) parameter + } + else + { + localVarPostBody = request; // byte array + } + + + // make the HTTP request + var localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("ScormApiGetCmiData", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<List<GetCmiDataResponseItem>>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (List<GetCmiDataResponseItem>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<GetCmiDataResponseItem>))); + } + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>Task of List&lt;GetCmiDataResponseItem&gt;</returns> + public async System.Threading.Tasks.Task<List<GetCmiDataResponseItem>> ScormApiGetCmiDataAsync (GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null) + { + var localVarResponse = await ScormApiGetCmiDataAsyncWithHttpInfo(request, accessToken, page, perPage); + return localVarResponse.Data; + + } + + /// <summary> + /// Gets data for the specified SCORM CMI fields based on the element names. Results are ordered alphabetically by SCO ID. Requires the View Section Enrollments permission in the enrollment organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage">How many results to show per page (optional)</param> + /// <returns>Task of ApiResponse (List&lt;GetCmiDataResponseItem&gt;)</returns> + public async System.Threading.Tasks.Task<ApiResponse<List<GetCmiDataResponseItem>>> ScormApiGetCmiDataAsyncWithHttpInfo(GetCmiDataRequest request, string accessToken, int? page = null, int? perPage = null) + { + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApiApi->ScormApiGetCmiData"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApiApi->ScormApiGetCmiData"); + + var localVarPath = "/api/v1/ScormApi/GetCmiData"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (page != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "page", page)); // query parameter + if (perPage != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "per_page", perPage)); // query parameter + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (request != null && request.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(request); // http body (model) parameter + } + else + { + localVarPostBody = request; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("ScormApiGetCmiData", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<List<GetCmiDataResponseItem>>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (List<GetCmiDataResponseItem>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<GetCmiDataResponseItem>))); + } + + } +}
Change 1 of 1 Show Entire File NexportApi/​Api/​SsoApiApi.cs Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
@@ -0,0 +1,492 @@
+/* + * NexportVirtualCampus + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using RestSharp; +using NexportApi.Client; +using NexportApi.Model; + +namespace NexportApi.Api +{ + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface ISsoApiApi : IApiAccessor + { + #region Synchronous Operations + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>SsoResponse</returns> + SsoResponse SsoApiClassroom(ClassroomSsoRequest classroomSsoRequest, string accessToken); + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>ApiResponse of SsoResponse</returns> + ApiResponse<SsoResponse> SsoApiClassroomWithHttpInfo(ClassroomSsoRequest classroomSsoRequest, string accessToken); + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>SsoResponse</returns> + SsoResponse SsoApiSignIn(SsoRequest ssoRequest, string accessToken); + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>ApiResponse of SsoResponse</returns> + ApiResponse<SsoResponse> SsoApiSignInWithHttpInfo(SsoRequest ssoRequest, string accessToken); + + + #endregion Synchronous Operations + + #region Asynchronous Operations + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of SsoResponse</returns> + Task<SsoResponse> SsoApiClassroomAsync(ClassroomSsoRequest classroomSsoRequest, string accessToken); + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of ApiResponse (SsoResponse)</returns> + Task<ApiResponse<SsoResponse>> SsoApiClassroomAsyncWithHttpInfo(ClassroomSsoRequest classroomSsoRequest, string accessToken); + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of SsoResponse</returns> + Task<SsoResponse> SsoApiSignInAsync(SsoRequest ssoRequest, string accessToken); + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of ApiResponse (SsoResponse)</returns> + Task<ApiResponse<SsoResponse>> SsoApiSignInAsyncWithHttpInfo(SsoRequest ssoRequest, string accessToken); + + + #endregion Asynchronous Operations + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public class SsoApiApi : ISsoApiApi + { + private ExceptionFactory _exceptionFactory = (name, response) => null; + + /// <summary> + /// Initializes a new instance of the <see cref="SsoApiApi"/> class. + /// </summary> + /// <returns></returns> + public SsoApiApi(string basePath) + { + Configuration = new Configuration { BasePath = basePath }; + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="SsoApiApi"/> class + /// using Configuration object + /// </summary> + /// <param name="configuration">An instance of Configuration</param> + /// <returns></returns> + public SsoApiApi(Configuration configuration = null) + { + Configuration = configuration ?? Configuration.Default; + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Gets the base path of the API client. + /// </summary> + /// <value>The base path</value> + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// <summary> + /// Gets or sets the configuration object + /// </summary> + /// <value>An instance of the Configuration</value> + public Configuration Configuration {get; set;} + + /// <summary> + /// Provides a factory method hook for the creation of exceptions. + /// </summary> + public ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + + set => _exceptionFactory = value; + } + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>SsoResponse</returns> + public SsoResponse SsoApiClassroom (ClassroomSsoRequest classroomSsoRequest, string accessToken) + { + var localVarResponse = SsoApiClassroomWithHttpInfo(classroomSsoRequest, accessToken); + return localVarResponse.Data; + } + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>ApiResponse of SsoResponse</returns> + public ApiResponse< SsoResponse > SsoApiClassroomWithHttpInfo(ClassroomSsoRequest classroomSsoRequest, string accessToken) + { + // verify the required parameter 'classroomSsoRequest' is set + if (classroomSsoRequest == null) + throw new ApiException(400, "Missing required parameter 'classroomSsoRequest' when calling SsoApiApi->SsoApiClassroom"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling SsoApiApi->SsoApiClassroom"); + + var localVarPath = "/api/v1/SsoApi/Classroom"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (classroomSsoRequest != null && classroomSsoRequest.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(classroomSsoRequest); // http body (model) parameter + } + else + { + localVarPostBody = classroomSsoRequest; // byte array + } + + + // make the HTTP request + var localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("SsoApiClassroom", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<SsoResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (SsoResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SsoResponse))); + } + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of SsoResponse</returns> + public async System.Threading.Tasks.Task<SsoResponse> SsoApiClassroomAsync (ClassroomSsoRequest classroomSsoRequest, string accessToken) + { + var localVarResponse = await SsoApiClassroomAsyncWithHttpInfo(classroomSsoRequest, accessToken); + return localVarResponse.Data; + + } + + /// <summary> + /// Retrieves url of classroom student view for a particular enrollment. Can also create a redirect entity to attach to the subscription of the enrollment which will cause the subscribed user to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Requires the Use SSO API permission in the enrollment subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="classroomSsoRequest">Contains option for chrome/nochrome and enrollment id</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of ApiResponse (SsoResponse)</returns> + public async System.Threading.Tasks.Task<ApiResponse<SsoResponse>> SsoApiClassroomAsyncWithHttpInfo(ClassroomSsoRequest classroomSsoRequest, string accessToken) + { + // verify the required parameter 'classroomSsoRequest' is set + if (classroomSsoRequest == null) + throw new ApiException(400, "Missing required parameter 'classroomSsoRequest' when calling SsoApiApi->SsoApiClassroom"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling SsoApiApi->SsoApiClassroom"); + + var localVarPath = "/api/v1/SsoApi/Classroom"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (classroomSsoRequest != null && classroomSsoRequest.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(classroomSsoRequest); // http body (model) parameter + } + else + { + localVarPostBody = classroomSsoRequest; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("SsoApiClassroom", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<SsoResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (SsoResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SsoResponse))); + } + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>SsoResponse</returns> + public SsoResponse SsoApiSignIn (SsoRequest ssoRequest, string accessToken) + { + var localVarResponse = SsoApiSignInWithHttpInfo(ssoRequest, accessToken); + return localVarResponse.Data; + } + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>ApiResponse of SsoResponse</returns> + public ApiResponse< SsoResponse > SsoApiSignInWithHttpInfo(SsoRequest ssoRequest, string accessToken) + { + // verify the required parameter 'ssoRequest' is set + if (ssoRequest == null) + throw new ApiException(400, "Missing required parameter 'ssoRequest' when calling SsoApiApi->SsoApiSignIn"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling SsoApiApi->SsoApiSignIn"); + + var localVarPath = "/api/v1/SsoApi/SignIn"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (ssoRequest != null && ssoRequest.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(ssoRequest); // http body (model) parameter + } + else + { + localVarPostBody = ssoRequest; // byte array + } + + + // make the HTTP request + var localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("SsoApiSignIn", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<SsoResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (SsoResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SsoResponse))); + } + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of SsoResponse</returns> + public async System.Threading.Tasks.Task<SsoResponse> SsoApiSignInAsync (SsoRequest ssoRequest, string accessToken) + { + var localVarResponse = await SsoApiSignInAsyncWithHttpInfo(ssoRequest, accessToken); + return localVarResponse.Data; + + } + + /// <summary> + /// Automatically log users into Nexport with out requiring their login credentials. Can also create a redirect entity to attach to the subscription of the user in the organization which will cause them to be redirected upon logging out, using an expired token, or using an invalid token (if those urls are set). Can use either user_id and org_id OR just subscription_id. Requires the Use SSO API permission in the subscription organization or an ancestor. + /// </summary> + /// <exception cref="ApiException">Thrown when fails to make API call</exception> + /// <param name="ssoRequest">Request information</param> + /// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <returns>Task of ApiResponse (SsoResponse)</returns> + public async System.Threading.Tasks.Task<ApiResponse<SsoResponse>> SsoApiSignInAsyncWithHttpInfo(SsoRequest ssoRequest, string accessToken) + { + // verify the required parameter 'ssoRequest' is set + if (ssoRequest == null) + throw new ApiException(400, "Missing required parameter 'ssoRequest' when calling SsoApiApi->SsoApiSignIn"); + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling SsoApiApi->SsoApiSignIn"); + + var localVarPath = "/api/v1/SsoApi/SignIn"; + var localVarPathParams = new Dictionary<string, string>(); + var localVarQueryParams = new List<KeyValuePair<string, string>>(); + var localVarHeaderParams = new Dictionary<string, string>(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary<string, string>(); + var localVarFileParams = new Dictionary<string, FileParameter>(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new string [] { + "application/json", + "text/json" + }; + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new string [] { + "application/json", + "text/json" + }; + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (accessToken != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "access_token", accessToken)); // query parameter + if (ssoRequest != null && ssoRequest.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(ssoRequest); // http body (model) parameter + } + else + { + localVarPostBody = ssoRequest; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + var localVarStatusCode = (int) localVarResponse.StatusCode; + + var exception = ExceptionFactory?.Invoke("SsoApiSignIn", localVarResponse); + if (exception != null) throw exception; + + return new ApiResponse<SsoResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (SsoResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SsoResponse))); + } + + } +}
Show Entire File NexportApi/​Client/​ApiClient.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File NexportApi/​Client/​ApiException.cs Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@@ -0,0 +1,60 @@
+/* + * NexportVirtualCampus + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; + +namespace NexportApi.Client +{ + /// <summary> + /// API Exception + /// </summary> + public class ApiException : Exception + { + /// <summary> + /// Gets or sets the error code (HTTP status code) + /// </summary> + /// <value>The error code (HTTP status code).</value> + public int ErrorCode { get; set; } + + /// <summary> + /// Gets or sets the error content (body json object) + /// </summary> + /// <value>The error content (Http response body).</value> + public dynamic ErrorContent { get; private set; } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiException"/> class. + /// </summary> + public ApiException() {} + + /// <summary> + /// Initializes a new instance of the <see cref="ApiException"/> class. + /// </summary> + /// <param name="errorCode">HTTP status code.</param> + /// <param name="message">Error message.</param> + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiException"/> class. + /// </summary> + /// <param name="errorCode">HTTP status code.</param> + /// <param name="message">Error message.</param> + /// <param name="errorContent">Error content.</param> + public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + } + } + +}
Show Entire File NexportApi/​Client/​ApiResponse.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Model/​CmiField.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Model/​SsoRequest.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Model/​SsoResponse.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​NexportApi.csproj Stacked
This file's diff was not loaded because this changeset is very large. Load changes