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

Update new API client:
- Update to the latest Nexport API specs

- Switch to OpenApi-Generator to generate api client
- Additional clean up

Changeset 6861117da182

Parent c1c6f75e64e3

by Profile picture of Thai NguyenThai Nguyen

Changes to 121 files · Browse files at 6861117da182 Showing diff from parent c1c6f75e64e3 Diff from another changeset...

Show Entire File NexportApi/​Api/​AdminApi.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Api/​AdminApiApi.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Api/​AssessmentApi.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/​LearningApi.cs Stacked
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
Show Entire File NexportApi/​Api/​PointOfSaleApi.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/​PostmanApi.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
@@ -0,0 +1,278 @@
+/* + * NexPort Web API + * + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API. + * + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Threading.Tasks; +using NexportApi.Client; +using NexportApi.Model; + +namespace NexportApi.Api +{ + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface IPostmanApiSync : 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 + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface IPostmanApiAsync : IApiAccessor + { + #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 interface IPostmanApi : IPostmanApiSync, IPostmanApiAsync + { + + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public class PostmanApi : IPostmanApi + { + private ExceptionFactory _exceptionFactory = (name, response) => null; + + /// <summary> + /// Initializes a new instance of the <see cref="PostmanApi"/> class. + /// </summary> + /// <returns></returns> + public PostmanApi() : this((string)null) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="PostmanApi"/> class. + /// </summary> + /// <returns></returns> + public PostmanApi(string basePath) + { + Configuration = NexportApi.Client.Configuration.MergeConfigurations( + GlobalConfiguration.Instance, + new Configuration { BasePath = basePath } + ); + Client = new ApiClient(Configuration.BasePath); + AsynchronousClient = new ApiClient(Configuration.BasePath); + ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="PostmanApi"/> class + /// using Configuration object + /// </summary> + /// <param name="configuration">An instance of Configuration</param> + /// <returns></returns> + public PostmanApi(Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException(nameof(configuration)); + + Configuration = NexportApi.Client.Configuration.MergeConfigurations( + GlobalConfiguration.Instance, + configuration + ); + Client = new ApiClient(Configuration.BasePath); + AsynchronousClient = new ApiClient(Configuration.BasePath); + ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="PostmanApi"/> class + /// using a Configuration object and client instance. + /// </summary> + /// <param name="client">The client interface for synchronous API access.</param> + /// <param name="asyncClient">The client interface for asynchronous API access.</param> + /// <param name="configuration">The configuration object.</param> + public PostmanApi(ISynchronousClient client, IAsynchronousClient asyncClient, IReadableConfiguration configuration) + { + Client = client ?? throw new ArgumentNullException(nameof(client)); + AsynchronousClient = asyncClient ?? throw new ArgumentNullException(nameof(asyncClient)); + Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); + ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// The client for accessing this underlying API asynchronously. + /// </summary> + public IAsynchronousClient AsynchronousClient { get; set; } + + /// <summary> + /// The client for accessing this underlying API synchronously. + /// </summary> + public ISynchronousClient Client { get; set; } + + /// <summary> + /// Gets the base path of the API client. + /// </summary> + /// <value>The base path</value> + public string GetBasePath() + { + return Configuration.BasePath; + } + + /// <summary> + /// Gets or sets the configuration object + /// </summary> + /// <value>An instance of the Configuration</value> + public IReadableConfiguration 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 localVarRequestOptions = new RequestOptions(); + + var contentTypes = new string[] { + }; + + // to determine the Accept header + var accepts = new[] { + "application/json", + "text/json" + }; + + var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = ClientUtils.SelectHeaderAccept(accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // make the HTTP request + var localVarResponse = Client.Get<PostmanCollectionGet>("/api/v1/PostmanApi/GetPostmanCollection", localVarRequestOptions, Configuration); + + var exception = ExceptionFactory?.Invoke("PostmanApiGetPostmanCollection", localVarResponse); + if (exception != null) throw exception; + + return localVarResponse; + } + + /// <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 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 Task<ApiResponse<PostmanCollectionGet>> PostmanApiGetPostmanCollectionAsyncWithHttpInfo() + { + var localVarRequestOptions = new RequestOptions(); + + var contentTypes = new string[] { + }; + + // to determine the Accept header + var accepts = new[] { + "application/json", + "text/json" + }; + + foreach (var contentType in contentTypes) + localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType); + + foreach (var accept in accepts) + localVarRequestOptions.HeaderParameters.Add("Accept", accept); + + + // make the HTTP request + var localVarResponse = await AsynchronousClient.GetAsync<PostmanCollectionGet>("/api/v1/PostmanApi/GetPostmanCollection", localVarRequestOptions, Configuration); + + var exception = ExceptionFactory?.Invoke("PostmanApiGetPostmanCollection", localVarResponse); + if (exception != null) throw exception; + + return localVarResponse; + } + } +}
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,258 +0,0 @@
-/* - * 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.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 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 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 - var 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/​ScormApi.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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
@@ -0,0 +1,553 @@
+/* + * NexPort Web API + * + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API. + * + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using NexportApi.Client; +using NexportApi.Model; + +namespace NexportApi.Api +{ + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface IScormApiSync : IApiAccessor + { + #region Synchronous Operations + /// <summary> + /// Edits data for a student&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>EditScormDataResponse</returns> + EditScormDataResponse ScormApiEditScormData(string accessToken, EditScormDataRequest request); + + /// <summary> + /// Edits data for a student&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>ApiResponse of EditScormDataResponse</returns> + ApiResponse<EditScormDataResponse> ScormApiEditScormDataWithHttpInfo(string accessToken, EditScormDataRequest request); + + /// <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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>List&lt;GetCmiDataResponseItem&gt;</returns> + List<GetCmiDataResponseItem> ScormApiGetCmiData(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default); + + /// <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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>ApiResponse of List&lt;GetCmiDataResponseItem&gt;</returns> + ApiResponse<List<GetCmiDataResponseItem>> ScormApiGetCmiDataWithHttpInfo(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default); + #endregion Synchronous Operations + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface IScormApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// <summary> + /// Edits data for a student&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>Task of EditScormDataResponse</returns> + Task<EditScormDataResponse> ScormApiEditScormDataAsync(string accessToken, EditScormDataRequest request); + + /// <summary> + /// Edits data for a student&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>Task of ApiResponse (EditScormDataResponse)</returns> + Task<ApiResponse<EditScormDataResponse>> ScormApiEditScormDataAsyncWithHttpInfo(string accessToken, EditScormDataRequest request); + + /// <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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>Task of List&lt;GetCmiDataResponseItem&gt;</returns> + Task<List<GetCmiDataResponseItem>> ScormApiGetCmiDataAsync(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default); + + /// <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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>Task of ApiResponse (List&lt;GetCmiDataResponseItem&gt;)</returns> + Task<ApiResponse<List<GetCmiDataResponseItem>>> ScormApiGetCmiDataAsyncWithHttpInfo(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default); + #endregion Asynchronous Operations + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface IScormApi : IScormApiSync, IScormApiAsync + { + + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public class ScormApi : IScormApi + { + private ExceptionFactory _exceptionFactory = (name, response) => null; + + /// <summary> + /// Initializes a new instance of the <see cref="ScormApi"/> class. + /// </summary> + /// <returns></returns> + public ScormApi() : this((string)null) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="ScormApi"/> class. + /// </summary> + /// <returns></returns> + public ScormApi(string basePath) + { + Configuration = NexportApi.Client.Configuration.MergeConfigurations( + GlobalConfiguration.Instance, + new Configuration { BasePath = basePath } + ); + Client = new ApiClient(Configuration.BasePath); + AsynchronousClient = new ApiClient(Configuration.BasePath); + ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ScormApi"/> class + /// using Configuration object + /// </summary> + /// <param name="configuration">An instance of Configuration</param> + /// <returns></returns> + public ScormApi(Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException(nameof(configuration)); + + Configuration = NexportApi.Client.Configuration.MergeConfigurations( + GlobalConfiguration.Instance, + configuration + ); + Client = new ApiClient(Configuration.BasePath); + AsynchronousClient = new ApiClient(Configuration.BasePath); + ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ScormApi"/> class + /// using a Configuration object and client instance. + /// </summary> + /// <param name="client">The client interface for synchronous API access.</param> + /// <param name="asyncClient">The client interface for asynchronous API access.</param> + /// <param name="configuration">The configuration object.</param> + public ScormApi(ISynchronousClient client, IAsynchronousClient asyncClient, IReadableConfiguration configuration) + { + Client = client ?? throw new ArgumentNullException(nameof(client)); + AsynchronousClient = asyncClient ?? throw new ArgumentNullException(nameof(asyncClient)); + Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); + ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// The client for accessing this underlying API asynchronously. + /// </summary> + public IAsynchronousClient AsynchronousClient { get; set; } + + /// <summary> + /// The client for accessing this underlying API synchronously. + /// </summary> + public ISynchronousClient Client { get; set; } + + /// <summary> + /// Gets the base path of the API client. + /// </summary> + /// <value>The base path</value> + public string GetBasePath() + { + return Configuration.BasePath; + } + + /// <summary> + /// Gets or sets the configuration object + /// </summary> + /// <value>An instance of the Configuration</value> + public IReadableConfiguration 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&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>EditScormDataResponse</returns> + public EditScormDataResponse ScormApiEditScormData(string accessToken, EditScormDataRequest request) + { + var localVarResponse = ScormApiEditScormDataWithHttpInfo(accessToken, request); + return localVarResponse.Data; + } + + /// <summary> + /// Edits data for a student&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>ApiResponse of EditScormDataResponse</returns> + public ApiResponse<EditScormDataResponse> ScormApiEditScormDataWithHttpInfo(string accessToken, EditScormDataRequest request) + { + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApi->ScormApiEditScormData"); + + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApi->ScormApiEditScormData"); + + var localVarRequestOptions = new RequestOptions(); + + var contentTypes = new[] { + "application/json", + "text/json" + }; + + // to determine the Accept header + var accepts = new[] { + "application/json", + "text/json" + }; + + var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = ClientUtils.SelectHeaderAccept(accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + + localVarRequestOptions.Data = request; + + // make the HTTP request + var localVarResponse = Client.Post<EditScormDataResponse>("/api/v1/ScormApi/EditScormData", localVarRequestOptions, Configuration); + + var exception = ExceptionFactory?.Invoke("ScormApiEditScormData", localVarResponse); + if (exception != null) throw exception; + + return localVarResponse; + } + + /// <summary> + /// Edits data for a student&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>Task of EditScormDataResponse</returns> + public async Task<EditScormDataResponse> ScormApiEditScormDataAsync(string accessToken, EditScormDataRequest request) + { + var localVarResponse = await ScormApiEditScormDataAsyncWithHttpInfo(accessToken, request); + return localVarResponse.Data; + } + + /// <summary> + /// Edits data for a student&#39;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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains assignment status id, sco id, and relevant fields to edit</param> + /// <returns>Task of ApiResponse (EditScormDataResponse)</returns> + public async Task<ApiResponse<EditScormDataResponse>> ScormApiEditScormDataAsyncWithHttpInfo(string accessToken, EditScormDataRequest request) + { + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApi->ScormApiEditScormData"); + + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApi->ScormApiEditScormData"); + + var localVarRequestOptions = new RequestOptions(); + + var contentTypes = new[] { + "application/json", + "text/json" + }; + + // to determine the Accept header + var accepts = new[] { + "application/json", + "text/json" + }; + + foreach (var contentType in contentTypes) + localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType); + + foreach (var accept in accepts) + localVarRequestOptions.HeaderParameters.Add("Accept", accept); + + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + + localVarRequestOptions.Data = request; + + // make the HTTP request + var localVarResponse = await AsynchronousClient.PostAsync<EditScormDataResponse>("/api/v1/ScormApi/EditScormData", localVarRequestOptions, Configuration); + + var exception = ExceptionFactory?.Invoke("ScormApiEditScormData", localVarResponse); + if (exception != null) throw exception; + + return localVarResponse; + } + + /// <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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>List&lt;GetCmiDataResponseItem&gt;</returns> + public List<GetCmiDataResponseItem> ScormApiGetCmiData(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default) + { + var localVarResponse = ScormApiGetCmiDataWithHttpInfo(accessToken, request, 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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>ApiResponse of List&lt;GetCmiDataResponseItem&gt;</returns> + public ApiResponse<List<GetCmiDataResponseItem>> ScormApiGetCmiDataWithHttpInfo(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default) + { + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApi->ScormApiGetCmiData"); + + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApi->ScormApiGetCmiData"); + + var localVarRequestOptions = new RequestOptions(); + + var contentTypes = new[] { + "application/json", + "text/json" + }; + + // to determine the Accept header + var accepts = new[] { + "application/json", + "text/json" + }; + + var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = ClientUtils.SelectHeaderAccept(accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (page != null) + { + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "page", page)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + } + + if (perPage != null) + { + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "per_page", perPage)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + } + + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + + localVarRequestOptions.Data = request; + + // make the HTTP request + var localVarResponse = Client.Post<List<GetCmiDataResponseItem>>("/api/v1/ScormApi/GetCmiData", localVarRequestOptions, Configuration); + + var exception = ExceptionFactory?.Invoke("ScormApiGetCmiData", localVarResponse); + if (exception != null) throw exception; + + return localVarResponse; + } + + /// <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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>Task of List&lt;GetCmiDataResponseItem&gt;</returns> + public async Task<List<GetCmiDataResponseItem>> ScormApiGetCmiDataAsync(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default) + { + var localVarResponse = await ScormApiGetCmiDataAsyncWithHttpInfo(accessToken, request, 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="accessToken">Use the AdminApi Authenticate method to get the access_token</param> + /// <param name="request">Contains list of CMI element names</param> + /// <param name="page">Which page of results to start on (optional)</param> + /// <param name="perPage"> (optional)</param> + /// <returns>Task of ApiResponse (List&lt;GetCmiDataResponseItem&gt;)</returns> + public async Task<ApiResponse<List<GetCmiDataResponseItem>>> ScormApiGetCmiDataAsyncWithHttpInfo(string accessToken, GetCmiDataRequest request, int? page = default, int? perPage = default) + { + // verify the required parameter 'accessToken' is set + if (accessToken == null) + throw new ApiException(400, "Missing required parameter 'accessToken' when calling ScormApi->ScormApiGetCmiData"); + + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling ScormApi->ScormApiGetCmiData"); + + var localVarRequestOptions = new RequestOptions(); + + var contentTypes = new[] { + "application/json", + "text/json" + }; + + // to determine the Accept header + var accepts = new[] { + "application/json", + "text/json" + }; + + foreach (var contentType in contentTypes) + localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType); + + foreach (var accept in accepts) + localVarRequestOptions.HeaderParameters.Add("Accept", accept); + + if (page != null) + { + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "page", page)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + } + + if (perPage != null) + { + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "per_page", perPage)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + } + + foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken)) + { + foreach (var kvpValue in kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue); + } + } + + localVarRequestOptions.Data = request; + + // make the HTTP request + var localVarResponse = await AsynchronousClient.PostAsync<List<GetCmiDataResponseItem>>("/api/v1/ScormApi/GetCmiData", localVarRequestOptions, Configuration); + + var exception = ExceptionFactory?.Invoke("ScormApiGetCmiData", localVarResponse); + if (exception != null) throw exception; + + return localVarResponse; + } + } +}
Show Entire File NexportApi/​Api/​ScormApiApi.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Api/​SsoApi.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Api/​SsoApiApi.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Client/​ApiClient.cs Stacked
This file's diff was not loaded because this changeset is very large. Load changes
 
1
2
 
3
4
 
5
6
7
8
 
 
 
9
10
11
 
41
42
43
44
 
45
46
47
 
52
53
54
55
56
 
 
57
58
59
 
1
 
2
3
 
4
5
 
 
 
6
7
8
9
10
11
 
41
42
43
 
44
45
46
47
 
52
53
54
 
 
55
56
57
58
59
@@ -1,11 +1,11 @@
 /* - * NexportVirtualCampus + * NexPort Web API   * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API.   * - * OpenAPI spec version: v1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git   */    using System; @@ -41,7 +41,7 @@
  /// <param name="message">Error message.</param>   public ApiException(int errorCode, string message) : base(message)   { - this.ErrorCode = errorCode; + ErrorCode = errorCode;   }     /// <summary> @@ -52,8 +52,8 @@
  /// <param name="errorContent">Error content.</param>   public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message)   { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; + ErrorCode = errorCode; + ErrorContent = errorContent;   }   }  
 
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
 
36
37
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
40
41
42
43
44
 
45
46
 
47
48
49
 
 
 
 
 
 
 
 
 
 
 
 
 
50
51
 
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
 
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
@@ -1,33 +1,75 @@
 /* - * NexportVirtualCampus + * NexPort Web API   * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API.   * - * OpenAPI spec version: v1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git   */   +using System;  using System.Collections.Generic; +using System.Net;    namespace NexportApi.Client  {   /// <summary> - /// API Response + /// Provides a non-generic contract for the ApiResponse wrapper.   /// </summary> - public class ApiResponse<T> + public interface IApiResponse   {   /// <summary> + /// The data type of <see cref="Content"/> + /// </summary> + Type ResponseType { get; } + + /// <summary> + /// The content of this response + /// </summary> + object Content { get; } + + /// <summary>   /// Gets or sets the status code (HTTP status code)   /// </summary>   /// <value>The status code.</value> - public int StatusCode { get; } + HttpStatusCode StatusCode { get; }     /// <summary>   /// Gets or sets the HTTP headers   /// </summary>   /// <value>HTTP headers</value> - public IDictionary<string, string> Headers { get; } + Multimap<string, string> Headers { get; } + + /// <summary> + /// Gets or sets any error text defined by the calling client. + /// </summary> + string ErrorText { get; set; } + + /// <summary> + /// Gets or sets any cookies passed along on the response. + /// </summary> + List<Cookie> Cookies { get; set; } + } + + /// <summary> + /// API Response + /// </summary> + public class ApiResponse<T> : IApiResponse + { + #region Properties + + /// <summary> + /// Gets or sets the status code (HTTP status code) + /// </summary> + /// <value>The status code.</value> + public HttpStatusCode StatusCode { get; } + + /// <summary> + /// Gets or sets the HTTP headers + /// </summary> + /// <value>HTTP headers</value> + public Multimap<string, string> Headers { get; }     /// <summary>   /// Gets or sets the data (parsed HTTP body) @@ -36,16 +78,53 @@
  public T Data { get; }     /// <summary> + /// Gets or sets any error text defined by the calling client. + /// </summary> + public string ErrorText { get; set; } + + /// <summary> + /// Gets or sets any cookies passed along on the response. + /// </summary> + public List<Cookie> Cookies { get; set; } + + /// <summary> + /// The content of this response + /// </summary> + public Type ResponseType => typeof(T); + + /// <summary> + /// The data type of <see cref="Content"/> + /// </summary> + public object Content => Data; + + #endregion Properties + + #region Constructors + + /// <summary>   /// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.   /// </summary>   /// <param name="statusCode">HTTP status code.</param>   /// <param name="headers">HTTP headers.</param>   /// <param name="data">Data (parsed HTTP body)</param> - public ApiResponse(int statusCode, IDictionary<string, string> headers, T data) + public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data)   { - StatusCode= statusCode; + StatusCode = statusCode;   Headers = headers;   Data = data;   } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiResponse{T}" /> class. + /// </summary> + /// <param name="statusCode">HTTP status code.</param> + /// <param name="data">Data (parsed HTTP body)</param> + public ApiResponse(HttpStatusCode statusCode, T data) + { + StatusCode = statusCode; + Data = data; + } + + #endregion Constructors   }  }
Change 1 of 1 Show Entire File NexportApi/​Client/​ClientUtils.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
@@ -0,0 +1,249 @@
+/* + * NexPort Web API + * + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API. + * + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace NexportApi.Client +{ + /// <summary> + /// Utility functions providing some benefit to API client consumers. + /// </summary> + public static class ClientUtils + { + /// <summary> + /// Sanitize filename by removing the path + /// </summary> + /// <param name="filename">Filename</param> + /// <returns>Filename</returns> + public static string SanitizeFilename(string filename) + { + var match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// <summary> + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// </summary> + /// <param name="collectionFormat">The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi</param> + /// <param name="name">Key name.</param> + /// <param name="value">Value object.</param> + /// <returns>A multimap of keys with 1..n associated values.</returns> + public static Multimap<string, string> ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap<string, string>(); + + if (IsCollection(value) && collectionFormat == "multi") + { + if (value is IEnumerable valueCollection) + { + foreach (var item in valueCollection) + { + parameters.Add(name, ParameterToString(item)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// <summary> + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// </summary> + /// <param name="obj">The parameter (header, path, query, form).</param> + /// <param name="configuration">An optional configuration instance, providing formatting options used in processing.</param> + /// <returns>Formatted string.</returns> + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime time) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return time.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset offset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return offset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is IList list ) + { + var flattenedString = new StringBuilder(); + foreach (var param in list) + { + if (flattenedString.Length > 0) + flattenedString.Append(","); + flattenedString.Append(param); + } + return flattenedString.ToString(); + } + + return Convert.ToString(obj); + } + + /// <summary> + /// Check if generic object is a collection. + /// </summary> + /// <param name="value"></param> + /// <returns>True if object is a collection type</returns> + private static bool IsCollection(object value) + { + return value is IList || value is ICollection; + } + + /// <summary> + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// </summary> + /// <param name="input">String to be URL encoded</param> + /// <returns>Byte array</returns> + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + var sb = new StringBuilder(input.Length * 2); + var index = 0; + + while (index < input.Length) + { + var length = Math.Min(input.Length - index, maxLength); + var subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// <summary> + /// Encode string in base64 format. + /// </summary> + /// <param name="text">String to be encoded.</param> + /// <returns>Encoded string.</returns> + public static string Base64Encode(string text) + { + return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// <summary> + /// Convert stream to byte array + /// </summary> + /// <param name="inputStream">Input stream to be converted</param> + /// <returns>Byte array</returns> + public static byte[] ReadAsBytes(Stream inputStream) + { + var buf = new byte[16 * 1024]; + using (var ms = new MemoryStream()) + { + int count; + while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) + { + ms.Write(buf, 0, count); + } + return ms.ToArray(); + } + } + + /// <summary> + /// Dynamically cast the object into target type. + /// </summary> + /// <param name="fromObject">Object to be casted</param> + /// <param name="toObject">Target type</param> + /// <returns>Casted object</returns> + public static dynamic ConvertType(dynamic fromObject, Type toObject) + { + return Convert.ChangeType(fromObject, toObject); + } + + /// <summary> + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// </summary> + /// <param name="contentTypes">The Content-Type array to select from.</param> + /// <returns>The Content-Type header to use.</returns> + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return "application/json"; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// <summary> + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// </summary> + /// <param name="accepts">The accepts array to select from.</param> + /// <returns>The Accept header to use.</returns> + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// <summary> + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// </summary> + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// <summary> + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// </summary> + /// <param name="mime">MIME</param> + /// <returns>Returns True if MIME type is json.</returns> + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + } +}
This file's diff was not loaded because this changeset is very large. Load changes
 
1
2
 
3
4
 
5
6
7
8
 
 
 
9
10
11
12
13
14
15
16
 
20
21
22
23
 
24
 
1
 
2
3
 
4
5
 
 
 
6
7
8
9
10
 
11
 
12
13
14
 
18
19
20
 
21
22
@@ -1,16 +1,14 @@
 /* - * NexportVirtualCampus + * NexPort Web API   * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API.   * - * OpenAPI spec version: v1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git   */   -  using System; -using RestSharp;    namespace NexportApi.Client  { @@ -20,5 +18,5 @@
  /// <param name="methodName">Method name</param>   /// <param name="response">Response</param>   /// <returns>Exceptions</returns> - public delegate Exception ExceptionFactory(string methodName, IRestResponse response); + public delegate Exception ExceptionFactory(string methodName, IApiResponse response);  }
 
1
2
 
3
4
 
5
6
7
8
 
 
 
9
10
11
12
13
14
15
16
17
18
19
20
21
 
25
26
27
28
 
29
30
31
 
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
34
 
 
1
 
2
3
 
4
5
 
 
 
6
7
8
9
10
 
 
 
11
 
 
 
 
12
13
14
 
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
 
@@ -1,21 +1,14 @@
 /* - * NexportVirtualCampus + * NexPort Web API   * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API.   * - * OpenAPI spec version: v1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git   */   - -using System; -using System.Reflection;  using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading;    namespace NexportApi.Client  { @@ -25,10 +18,50 @@
  /// </summary>   /// <remarks>   /// A customized implementation via partial class may reside in another file and may - /// be excluded from automatic generation via a .swagger-codegen-ignore file. + /// be excluded from automatic generation via a .openapi-generator-ignore file.   /// </remarks>   public partial class GlobalConfiguration : Configuration   { + #region Private Members   + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// <inheritdoc /> + private GlobalConfiguration() + { + } + + /// <inheritdoc /> + public GlobalConfiguration(IDictionary<string, string> defaultHeader, IDictionary<string, string> apiKey, IDictionary<string, string> apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// <summary> + /// Gets or sets the default Configuration. + /// </summary> + /// <value>Configuration.</value> + public static IReadableConfiguration Instance + { + get => _globalConfiguration; + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + }   }  } \ No newline at end of file
Change 1 of 1 Show Entire File NexportApi/​Client/​HttpMethod.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
@@ -0,0 +1,33 @@
+/* + * NexPort Web API + * + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API. + * + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +namespace NexportApi.Client +{ + /// <summary> + /// Http methods supported by swagger + /// </summary> + public enum HttpMethod + { + /// <summary>HTTP GET request.</summary> + Get, + /// <summary>HTTP POST request.</summary> + Post, + /// <summary>HTTP PUT request.</summary> + Put, + /// <summary>HTTP DELETE request.</summary> + Delete, + /// <summary>HTTP HEAD request.</summary> + Head, + /// <summary>HTTP OPTIONS request.</summary> + Options, + /// <summary>HTTP PATCH request.</summary> + Patch + } +}
 
1
2
 
3
4
 
5
6
7
8
 
 
 
9
10
11
12
13
14
15
16
17
18
19
20
 
26
27
28
29
 
30
31
32
33
34
35
36
 
 
37
38
39
 
1
 
2
3
 
4
5
 
 
 
6
7
8
9
10
 
 
 
 
 
 
 
11
12
13
 
19
20
21
 
22
23
24
25
26
27
 
 
28
29
30
31
32
@@ -1,20 +1,13 @@
 /* - * NexportVirtualCampus + * NexPort Web API   * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API.   * - * OpenAPI spec version: v1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git   */   - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp; -  namespace NexportApi.Client  {   /// <summary> @@ -26,14 +19,14 @@
  /// Gets or sets the configuration object   /// </summary>   /// <value>An instance of the Configuration</value> - Configuration Configuration {get; set;} + IReadableConfiguration Configuration {get; set;}     /// <summary>   /// Gets the base path of the API client.   /// </summary>   /// <value>The base path</value> - String GetBasePath(); - + string GetBasePath(); +   /// <summary>   /// Provides a factory method hook for the creation of exceptions.   /// </summary>
This file's diff was not loaded because this changeset is very large. Load changes
 
1
2
 
3
4
 
5
6
7
8
 
 
 
9
10
11
 
 
12
13
14
 
45
46
47
48
 
49
50
51
52
53
54
 
55
56
57
 
 
 
 
 
 
58
59
60
 
84
85
86
 
 
 
 
 
 
87
88
89
 
1
 
2
3
 
4
5
 
 
 
6
7
8
9
10
 
11
12
13
14
15
 
46
47
48
 
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
92
93
94
95
96
97
98
99
100
101
102
103
@@ -1,14 +1,15 @@
 /* - * NexportVirtualCampus + * NexPort Web API   * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API.   * - * OpenAPI spec version: v1 - * - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git   */   - +using RestSharp; +using System;  using System.Collections.Generic;    namespace NexportApi.Client @@ -45,16 +46,23 @@
  /// <summary>   /// Gets the date time format.   /// </summary> - /// <value>Date time foramt.</value> + /// <value>Date time format.</value>   string DateTimeFormat { get; }     /// <summary>   /// Gets the default header.   /// </summary>   /// <value>Default header.</value> + [Obsolete("Use DefaultHeaders instead.")]   IDictionary<string, string> DefaultHeader { get; }     /// <summary> + /// Gets the default headers. + /// </summary> + /// <value>Default headers.</value> + IDictionary<string, string> DefaultHeaders { get; } + + /// <summary>   /// Gets the temp folder path.   /// </summary>   /// <value>Temp folder path.</value> @@ -84,6 +92,12 @@
  /// <value>Password.</value>   string Password { get; }   + /// <summary> + /// Gets the rest client. + /// </summary> + /// <value>RestClient.</value> + RestClient RestClient{ get; } +   /// <summary>   /// Gets the API key with prefix.   /// </summary>
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File NexportApi/​Client/​Multimap.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/​OpenAPIDateConverter.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
@@ -0,0 +1,29 @@
+/* + * NexPort Web API + * + * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API. + * + * The version of the OpenAPI document: v1 + * Contact: support@nexportcampus.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using Newtonsoft.Json.Converters; + +namespace NexportApi.Client +{ + /// <summary> + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// </summary> + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// <summary> + /// Initializes a new instance of the <see cref="OpenAPIDateConverter" /> class. + /// </summary> + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +}
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
Show Entire File NexportApi/​Model/​Enums.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
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