@superoffice/webapi 11.7.727 → 11.9.1204

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/LICENSE.md +15 -15
  2. package/README.md +184 -184
  3. package/__tests__/Appointment63-notz.json +1925 -1925
  4. package/__tests__/Appointment63-utctz.json +1925 -1925
  5. package/__tests__/Appointment63.json +1925 -1925
  6. package/__tests__/AppointmentTzTest.ts +115 -115
  7. package/__tests__/AxiosNockTest.ts +28 -28
  8. package/__tests__/ContactDefault.json +699 -699
  9. package/__tests__/ContactEntity.json +272 -272
  10. package/__tests__/ContactRestTest.ts +144 -144
  11. package/__tests__/ContactTest.ts +395 -395
  12. package/__tests__/ConvertersTest.ts +97 -97
  13. package/__tests__/DocumentTest.ts +101 -101
  14. package/__tests__/Person210-notz.json +1932 -1932
  15. package/__tests__/Person210-utctz.json +1932 -1932
  16. package/__tests__/Person210.json +1932 -1932
  17. package/__tests__/PersonImageData.nock +22 -22
  18. package/__tests__/PersonTest.ts +41 -41
  19. package/__tests__/PersonTzTest.ts +113 -113
  20. package/__tests__/RecurrenceInfo.json +55 -55
  21. package/__tests__/ResponseCallbackTest.ts +23 -23
  22. package/__tests__/TableRights.json +441 -441
  23. package/__tests__/WebapiTest.ts +264 -264
  24. package/__tests__/Webhook.json +16 -16
  25. package/__tests__/WebhookTest.ts +209 -209
  26. package/dist/cjs/AIAgent.d.ts +62 -0
  27. package/dist/cjs/AIAgent.d.ts.map +1 -1
  28. package/dist/cjs/AIAgent.js +149 -0
  29. package/dist/cjs/AIAgent.js.map +1 -1
  30. package/dist/cjs/Carriers.d.ts +640 -14
  31. package/dist/cjs/Carriers.d.ts.map +1 -1
  32. package/dist/cjs/Converters.d.ts +24 -0
  33. package/dist/cjs/Converters.d.ts.map +1 -1
  34. package/dist/cjs/Converters.js +388 -17
  35. package/dist/cjs/Converters.js.map +1 -1
  36. package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
  37. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  38. package/dist/cjs/DiagnosticsAgent.js +91 -0
  39. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  40. package/dist/cjs/Enums.d.ts +77 -1
  41. package/dist/cjs/Enums.d.ts.map +1 -1
  42. package/dist/cjs/Enums.js +83 -4
  43. package/dist/cjs/Enums.js.map +1 -1
  44. package/dist/cjs/ListAgent.d.ts +71 -6
  45. package/dist/cjs/ListAgent.d.ts.map +1 -1
  46. package/dist/cjs/ListAgent.js +157 -0
  47. package/dist/cjs/ListAgent.js.map +1 -1
  48. package/dist/cjs/MarketingAgent.d.ts +68 -0
  49. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  50. package/dist/cjs/MarketingAgent.js +157 -0
  51. package/dist/cjs/MarketingAgent.js.map +1 -1
  52. package/dist/cjs/TicketAgent.d.ts +23 -0
  53. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  54. package/dist/cjs/TicketAgent.js +65 -0
  55. package/dist/cjs/TicketAgent.js.map +1 -1
  56. package/dist/esm/AIAgent.d.ts +62 -0
  57. package/dist/esm/AIAgent.d.ts.map +1 -1
  58. package/dist/esm/AIAgent.js +150 -1
  59. package/dist/esm/AIAgent.js.map +1 -1
  60. package/dist/esm/Carriers.d.ts +640 -14
  61. package/dist/esm/Carriers.d.ts.map +1 -1
  62. package/dist/esm/Converters.d.ts +24 -0
  63. package/dist/esm/Converters.d.ts.map +1 -1
  64. package/dist/esm/Converters.js +346 -0
  65. package/dist/esm/Converters.js.map +1 -1
  66. package/dist/esm/DiagnosticsAgent.d.ts +38 -0
  67. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  68. package/dist/esm/DiagnosticsAgent.js +91 -0
  69. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  70. package/dist/esm/Enums.d.ts +77 -1
  71. package/dist/esm/Enums.d.ts.map +1 -1
  72. package/dist/esm/Enums.js +79 -0
  73. package/dist/esm/Enums.js.map +1 -1
  74. package/dist/esm/ListAgent.d.ts +71 -6
  75. package/dist/esm/ListAgent.d.ts.map +1 -1
  76. package/dist/esm/ListAgent.js +157 -0
  77. package/dist/esm/ListAgent.js.map +1 -1
  78. package/dist/esm/MarketingAgent.d.ts +68 -0
  79. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  80. package/dist/esm/MarketingAgent.js +157 -0
  81. package/dist/esm/MarketingAgent.js.map +1 -1
  82. package/dist/esm/TicketAgent.d.ts +23 -0
  83. package/dist/esm/TicketAgent.d.ts.map +1 -1
  84. package/dist/esm/TicketAgent.js +65 -0
  85. package/dist/esm/TicketAgent.js.map +1 -1
  86. package/examples-js/hello.js +12 -12
  87. package/examples-ts/hello.ts +8 -8
  88. package/package.json +93 -93
  89. package/scripts/postbuild.js +22 -22
  90. package/scripts/setVersion.js +44 -44
  91. package/src/AIAgent.ts +2239 -1992
  92. package/src/AppointmentAgent.ts +6263 -6263
  93. package/src/AppointmentRestApi.ts +225 -225
  94. package/src/ArchiveAgent.ts +1950 -1950
  95. package/src/AssociateAgent.ts +422 -422
  96. package/src/AxiosCacheHandler.ts +74 -74
  97. package/src/BLOBAgent.ts +2100 -2100
  98. package/src/Base64.ts +285 -285
  99. package/src/BatchAgent.ts +910 -910
  100. package/src/BulkUpdateAgent.ts +504 -504
  101. package/src/CRMScriptAgent.ts +1390 -1390
  102. package/src/Carriers.ts +53121 -52274
  103. package/src/ChatAgent.ts +1422 -1422
  104. package/src/ConfigurationAgent.ts +2228 -2228
  105. package/src/ContactAgent.ts +1756 -1756
  106. package/src/ContactRestApi.ts +237 -237
  107. package/src/Converters.ts +23496 -23090
  108. package/src/CustomerServiceAgent.ts +1799 -1799
  109. package/src/DashAgent.ts +1674 -1674
  110. package/src/DatabaseAgent.ts +120 -120
  111. package/src/DatabaseTableAgent.ts +534 -534
  112. package/src/Day_js.ts +41 -41
  113. package/src/DiagnosticsAgent.ts +1384 -1240
  114. package/src/DocumentAgent.ts +5079 -5079
  115. package/src/DocumentMigrationAgent.ts +524 -524
  116. package/src/DocumentRestApi.ts +259 -259
  117. package/src/EMailAgent.ts +5328 -5328
  118. package/src/Enums.ts +6998 -6916
  119. package/src/ErpSyncAgent.ts +2658 -2658
  120. package/src/FavouriteAgent.ts +720 -720
  121. package/src/FindAgent.ts +2330 -2330
  122. package/src/ForeignSystemAgent.ts +1710 -1710
  123. package/src/FreeTextAgent.ts +372 -372
  124. package/src/ImportAgent.ts +304 -304
  125. package/src/LicenseAgent.ts +1230 -1230
  126. package/src/ListAgent.ts +11451 -11237
  127. package/src/MDOAgent.ts +748 -748
  128. package/src/MarketingAgent.ts +1146 -890
  129. package/src/MessagingAgent.ts +384 -384
  130. package/src/NavigatorAgent.ts +140 -140
  131. package/src/NumberAllocationAgent.ts +296 -296
  132. package/src/PersonAgent.ts +3287 -3287
  133. package/src/PersonRestApi.ts +241 -241
  134. package/src/PhoneListAgent.ts +458 -458
  135. package/src/PocketAgent.ts +780 -780
  136. package/src/PreferenceAgent.ts +1900 -1900
  137. package/src/PreviewsAgent.ts +116 -116
  138. package/src/ProjectAgent.ts +2391 -2391
  139. package/src/ProjectRestApi.ts +239 -239
  140. package/src/QuoteAgent.ts +5159 -5159
  141. package/src/RelationAgent.ts +220 -220
  142. package/src/ReportAgent.ts +154 -154
  143. package/src/ResourceAgent.ts +358 -358
  144. package/src/SaintAgent.ts +601 -601
  145. package/src/SaleAgent.ts +2034 -2034
  146. package/src/SaleRestApi.ts +233 -233
  147. package/src/SelectionAgent.ts +3195 -3195
  148. package/src/SentryAgent.ts +462 -462
  149. package/src/SoApiConstants.ts +8 -8
  150. package/src/TargetsAgent.ts +1104 -1104
  151. package/src/TicketAgent.ts +3708 -3638
  152. package/src/TimeZoneAgent.ts +528 -528
  153. package/src/TooltipsAgent.ts +116 -116
  154. package/src/UserAgent.ts +4856 -4856
  155. package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
  156. package/src/ViewStateAgent.ts +858 -858
  157. package/src/WebApi.ts +872 -872
  158. package/src/WebApiBase.ts +565 -565
  159. package/src/WebhookAgent.ts +388 -388
  160. package/src/WorkflowAgent.ts +1338 -1338
  161. package/tsconfig.esm.json +8 -8
  162. package/tsconfig.jest.json +8 -8
  163. package/tsconfig.json +34 -34
package/src/BatchAgent.ts CHANGED
@@ -1,910 +1,910 @@
1
- // <auto-generated>
2
- // SuperOffice Code Generator
3
- // modelling\templates\servicestswebapi\tswebapiagents.tt
4
- // </auto-generated>
5
-
6
-
7
- /* tslint:disable */
8
- //----------------------------------------------------------------------------
9
- // G E N E R A T E D F I L E ! D O N O T E D I T !
10
- //----------------------------------------------------------------------------
11
- //
12
- // File: WebApi/BatchAgent.ts
13
- //
14
- //----------------------------------------------------------------------------
15
- // Copyright (C) SuperOffice AS
16
- //----------------------------------------------------------------------------
17
-
18
- import { AxiosRequestConfig } from 'axios';
19
- import { Duration } from 'dayjs/plugin/duration';
20
- import * as enums from './Enums';
21
- import * as base from './WebApiBase';
22
- import * as carriers from './Carriers';
23
- import * as converters from './Converters';
24
- import { FromBase64ToString, ToBase64 } from './Base64';
25
-
26
- /**
27
- * Start, stop and monitor predefined batch tasks
28
- */
29
- export interface IBatchAgent {
30
- getBatchTaskInfoAsync(request: carriers.Batch_GetBatchTaskInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
31
- getBatchTaskInfoAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
32
- getBatchTaskInfosByAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
33
- getBatchTaskInfosByAssociatesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
34
- startBatchJobAsync(request: carriers.Batch_StartBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
35
- startBatchJobAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
36
- stopBatchJobAsync(request: carriers.Batch_StopBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
37
- stopBatchJobAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
38
- getBatchTaskInfosByStateAsync(request: carriers.Batch_GetBatchTaskInfosByStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
39
- getBatchTaskInfosByStateAsync(state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
40
- updateBatchTaskAsync(request: carriers.Batch_UpdateBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
41
- updateBatchTaskAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
42
- getBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
43
- getBatchTaskInfosByNameAndStateAsync(name: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
44
- getBatchTaskInfosByNameAndAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
45
- getBatchTaskInfosByNameAndAssociatesAsync(name: string, associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
46
- getBatchTaskInfosByAssociatesAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
47
- getBatchTaskInfosByAssociatesAndStateAsync(associateIds: number[], state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
48
- deleteBatchTasksAsync(request: carriers.Batch_DeleteBatchTasksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
49
- deleteBatchTasksAsync(batchTaskIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
50
- deleteBatchTaskAsync(request: carriers.Batch_DeleteBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
51
- deleteBatchTaskAsync(batchTaskId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
52
- getAllBatchTaskInfosByNameAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
53
- getAllBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
54
- getAllBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
55
- getAllBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
56
- getSystemBatchTaskInfosByNameAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
57
- getSystemBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
58
- getSystemBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
59
- getSystemBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
60
- } // interface IBatchAgent
61
-
62
-
63
-
64
-
65
- /**
66
- * Start, stop and monitor predefined batch tasks
67
- */
68
- export class BatchAgent extends base.WebApiBase implements IBatchAgent {
69
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
70
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
71
- constructor(baseUrl: string, resourceManager:any);
72
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
73
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
74
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
75
- constructor(options: base.WebApiOptions);
76
-
77
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
78
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
79
- langOrResourceOrRM?:string|base.ResourceParsing|any,
80
- cultureCode?: string,
81
- ) {
82
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
83
- options.basePath = "v1/Agents/Batch/";
84
- super(options);
85
- }
86
-
87
-
88
-
89
- private async _getBatchTaskInfoAsync(request: carriers.Batch_GetBatchTaskInfoRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
90
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
91
- base.WebApiBase.SetPending(options);
92
- return new Promise< carriers.BatchTaskInfo >(async (resolve, reject) => {
93
- try {
94
- config.baseURL = this._options.baseUrl;
95
- const response = await this._axios.post("GetBatchTaskInfo", request , config);
96
- base.WebApiBase.SetCompleted(options, response);
97
- const res : carriers.BatchTaskInfo = converters.Create_BatchTaskInfo_From( response.data );
98
- resolve(res);
99
- }
100
- catch( err ) {
101
- base.WebApiBase.HandleError(options, config, err);
102
- reject(err);
103
- }
104
- });
105
- }
106
-
107
-
108
-
109
- /**
110
- * Get a single BatchTaskInfo based on Id.
111
- * @param request - Id
112
- * @returns Returns a BatchTaskInfo.
113
- */
114
- public async getBatchTaskInfoAsync(request: carriers.Batch_GetBatchTaskInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
115
-
116
- /**
117
- * Get a single BatchTaskInfo based on Id.
118
- * @param id - Id of the BatchTaskInfo to get.
119
- * @returns Returns a BatchTaskInfo.
120
- */
121
- public async getBatchTaskInfoAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
122
-
123
- public async getBatchTaskInfoAsync(id:number|carriers.Batch_GetBatchTaskInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
124
- let _request : carriers.Batch_GetBatchTaskInfoRequest = null;
125
- let _options : base.WebApiRequestOptions = null;
126
- const first : any = id;
127
- if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
128
- {
129
- _request = id as carriers.Batch_GetBatchTaskInfoRequest;
130
- _options = webapi_options as base.WebApiRequestOptions;
131
- }
132
- else
133
- {
134
- _request = {
135
- id: id as number,
136
- };
137
- _options = webapi_options;
138
- }
139
- return this._getBatchTaskInfoAsync( _request, _options );
140
- }
141
-
142
-
143
- private async _getBatchTaskInfosByAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
144
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
145
- base.WebApiBase.SetPending(options);
146
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
147
- try {
148
- config.baseURL = this._options.baseUrl;
149
- const response = await this._axios.post("GetBatchTaskInfosByAssociates", request , config);
150
- base.WebApiBase.SetCompleted(options, response);
151
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
152
- resolve(res);
153
- }
154
- catch( err ) {
155
- base.WebApiBase.HandleError(options, config, err);
156
- reject(err);
157
- }
158
- });
159
- }
160
-
161
-
162
-
163
- /**
164
- * Get an array of BatchTaskInfo for the provided associate id&apos;s.
165
- * @param request - AssociateIds
166
- * @returns Returns an array of user's BatchTaskInfo.
167
- */
168
- public async getBatchTaskInfosByAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
169
-
170
- /**
171
- * Get an array of BatchTaskInfo for the provided associate id&apos;s.
172
- * @param associateIds - Array of associate id's. empty array = all tasks, 0 = system tasks, -1 = all user tasks.
173
- * @returns Returns an array of user's BatchTaskInfo.
174
- */
175
- public async getBatchTaskInfosByAssociatesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
176
-
177
- public async getBatchTaskInfosByAssociatesAsync(associateIds:number[]|carriers.Batch_GetBatchTaskInfosByAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
178
- let _request : carriers.Batch_GetBatchTaskInfosByAssociatesRequest = null;
179
- let _options : base.WebApiRequestOptions = null;
180
- const first : any = associateIds;
181
- if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' ) )
182
- {
183
- _request = associateIds as carriers.Batch_GetBatchTaskInfosByAssociatesRequest;
184
- _options = webapi_options as base.WebApiRequestOptions;
185
- }
186
- else
187
- {
188
- _request = {
189
- associateIds: associateIds as number[],
190
- };
191
- _options = webapi_options;
192
- }
193
- return this._getBatchTaskInfosByAssociatesAsync( _request, _options );
194
- }
195
-
196
-
197
- private async _startBatchJobAsync(request: carriers.Batch_StartBatchJobRequest, options?:base.WebApiRequestOptions) : Promise< number > {
198
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
199
- base.WebApiBase.SetPending(options);
200
- return new Promise< number >(async (resolve, reject) => {
201
- try {
202
- config.baseURL = this._options.baseUrl;
203
- const response = await this._axios.post("StartBatchJob", request , config);
204
- base.WebApiBase.SetCompleted(options, response);
205
- const res : number = response.data as number;
206
- resolve(res);
207
- }
208
- catch( err ) {
209
- base.WebApiBase.HandleError(options, config, err);
210
- reject(err);
211
- }
212
- });
213
- }
214
-
215
-
216
-
217
- /**
218
- * Start a batch job based on BatchTaskInfo.
219
- * @param request - BatchTaskInfo
220
- * @returns Returns the id of the created batch job.
221
- */
222
- public async startBatchJobAsync(request: carriers.Batch_StartBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
223
-
224
- /**
225
- * Start a batch job based on BatchTaskInfo.
226
- * @param batchTaskInfo - Use BatchTaskInfo to describe the new batch job.
227
- * @returns Returns the id of the created batch job.
228
- */
229
- public async startBatchJobAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
230
-
231
- public async startBatchJobAsync(batchTaskInfo:carriers.BatchTaskInfo|carriers.Batch_StartBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
232
- let _request : carriers.Batch_StartBatchJobRequest = null;
233
- let _options : base.WebApiRequestOptions = null;
234
- const first : any = batchTaskInfo;
235
- if( typeof( first ) === "object" && first && ( typeof(first.batchTaskInfo)!='undefined' ) )
236
- {
237
- _request = batchTaskInfo as carriers.Batch_StartBatchJobRequest;
238
- _options = webapi_options as base.WebApiRequestOptions;
239
- }
240
- else
241
- {
242
- _request = {
243
- batchTaskInfo: batchTaskInfo as carriers.BatchTaskInfo,
244
- };
245
- _options = webapi_options;
246
- }
247
- return this._startBatchJobAsync( _request, _options );
248
- }
249
-
250
-
251
- private async _stopBatchJobAsync(request: carriers.Batch_StopBatchJobRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
252
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
253
- base.WebApiBase.SetPending(options);
254
- return new Promise< boolean >(async (resolve, reject) => {
255
- try {
256
- config.baseURL = this._options.baseUrl;
257
- const response = await this._axios.post("StopBatchJob", request , config);
258
- base.WebApiBase.SetCompleted(options, response);
259
- const res : boolean = response.data as boolean;
260
- resolve(res);
261
- }
262
- catch( err ) {
263
- base.WebApiBase.HandleError(options, config, err);
264
- reject(err);
265
- }
266
- });
267
- }
268
-
269
-
270
-
271
- /**
272
- * Stop a batch job based on Id.
273
- * @param request - Id
274
- * @returns Returns true if the job was stopped successfully.
275
- */
276
- public async stopBatchJobAsync(request: carriers.Batch_StopBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
277
-
278
- /**
279
- * Stop a batch job based on Id.
280
- * @param id - Id of the batch job to stop.
281
- * @returns Returns true if the job was stopped successfully.
282
- */
283
- public async stopBatchJobAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
284
-
285
- public async stopBatchJobAsync(id:number|carriers.Batch_StopBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
286
- let _request : carriers.Batch_StopBatchJobRequest = null;
287
- let _options : base.WebApiRequestOptions = null;
288
- const first : any = id;
289
- if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
290
- {
291
- _request = id as carriers.Batch_StopBatchJobRequest;
292
- _options = webapi_options as base.WebApiRequestOptions;
293
- }
294
- else
295
- {
296
- _request = {
297
- id: id as number,
298
- };
299
- _options = webapi_options;
300
- }
301
- return this._stopBatchJobAsync( _request, _options );
302
- }
303
-
304
-
305
- private async _getBatchTaskInfosByStateAsync(request: carriers.Batch_GetBatchTaskInfosByStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
306
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
307
- base.WebApiBase.SetPending(options);
308
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
309
- try {
310
- config.baseURL = this._options.baseUrl;
311
- const response = await this._axios.post("GetBatchTaskInfosByState", request , config);
312
- base.WebApiBase.SetCompleted(options, response);
313
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
314
- resolve(res);
315
- }
316
- catch( err ) {
317
- base.WebApiBase.HandleError(options, config, err);
318
- reject(err);
319
- }
320
- });
321
- }
322
-
323
-
324
-
325
- /**
326
- * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState.
327
- * @param request - State
328
- * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
329
- */
330
- public async getBatchTaskInfosByStateAsync(request: carriers.Batch_GetBatchTaskInfosByStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
331
-
332
- /**
333
- * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState.
334
- * @param state - The BatchTaskState to get batch tasks for.
335
- * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
336
- */
337
- public async getBatchTaskInfosByStateAsync(state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
338
-
339
- public async getBatchTaskInfosByStateAsync(state:enums.BatchTaskState|carriers.Batch_GetBatchTaskInfosByStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
340
- let _request : carriers.Batch_GetBatchTaskInfosByStateRequest = null;
341
- let _options : base.WebApiRequestOptions = null;
342
- const first : any = state;
343
- if( typeof( first ) === "object" && first && ( typeof(first.state)!='undefined' ) )
344
- {
345
- _request = state as carriers.Batch_GetBatchTaskInfosByStateRequest;
346
- _options = webapi_options as base.WebApiRequestOptions;
347
- }
348
- else
349
- {
350
- _request = {
351
- state: state as enums.BatchTaskState,
352
- };
353
- _options = webapi_options;
354
- }
355
- return this._getBatchTaskInfosByStateAsync( _request, _options );
356
- }
357
-
358
-
359
- private async _updateBatchTaskAsync(request: carriers.Batch_UpdateBatchTaskRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
360
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
361
- base.WebApiBase.SetPending(options);
362
- return new Promise< carriers.BatchTaskInfo >(async (resolve, reject) => {
363
- try {
364
- config.baseURL = this._options.baseUrl;
365
- const response = await this._axios.post("UpdateBatchTask", request , config);
366
- base.WebApiBase.SetCompleted(options, response);
367
- const res : carriers.BatchTaskInfo = converters.Create_BatchTaskInfo_From( response.data );
368
- resolve(res);
369
- }
370
- catch( err ) {
371
- base.WebApiBase.HandleError(options, config, err);
372
- reject(err);
373
- }
374
- });
375
- }
376
-
377
-
378
-
379
- /**
380
- * Update information about a BatchTask. Only the following properties can be updated: State, Description, Response and Request.
381
- * @param request - BatchTaskInfo
382
- * @returns The updated BatchTaskInfo
383
- */
384
- public async updateBatchTaskAsync(request: carriers.Batch_UpdateBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
385
-
386
- /**
387
- * Update information about a BatchTask. Only the following properties can be updated: State, Description, Response and Request.
388
- * @param batchTaskInfo - The updated information to save.
389
- * @returns The updated BatchTaskInfo
390
- */
391
- public async updateBatchTaskAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
392
-
393
- public async updateBatchTaskAsync(batchTaskInfo:carriers.BatchTaskInfo|carriers.Batch_UpdateBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
394
- let _request : carriers.Batch_UpdateBatchTaskRequest = null;
395
- let _options : base.WebApiRequestOptions = null;
396
- const first : any = batchTaskInfo;
397
- if( typeof( first ) === "object" && first && ( typeof(first.batchTaskInfo)!='undefined' ) )
398
- {
399
- _request = batchTaskInfo as carriers.Batch_UpdateBatchTaskRequest;
400
- _options = webapi_options as base.WebApiRequestOptions;
401
- }
402
- else
403
- {
404
- _request = {
405
- batchTaskInfo: batchTaskInfo as carriers.BatchTaskInfo,
406
- };
407
- _options = webapi_options;
408
- }
409
- return this._updateBatchTaskAsync( _request, _options );
410
- }
411
-
412
-
413
- private async _getBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
414
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
415
- base.WebApiBase.SetPending(options);
416
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
417
- try {
418
- config.baseURL = this._options.baseUrl;
419
- const response = await this._axios.post("GetBatchTaskInfosByNameAndState", request , config);
420
- base.WebApiBase.SetCompleted(options, response);
421
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
422
- resolve(res);
423
- }
424
- catch( err ) {
425
- base.WebApiBase.HandleError(options, config, err);
426
- reject(err);
427
- }
428
- });
429
- }
430
-
431
-
432
-
433
- /**
434
- * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.
435
- * @param request - Name, State
436
- * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
437
- */
438
- public async getBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
439
-
440
- /**
441
- * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.
442
- * @param name - Batchtask definition name. Blank for all tasks.
443
- * @param state - The BatchTaskState to get batch tasks for.
444
- * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
445
- */
446
- public async getBatchTaskInfosByNameAndStateAsync(name: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
447
-
448
- public async getBatchTaskInfosByNameAndStateAsync(name:string|carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
449
- let _request : carriers.Batch_GetBatchTaskInfosByNameAndStateRequest = null;
450
- let _options : base.WebApiRequestOptions = null;
451
- const first : any = name;
452
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.state)!='undefined' ) )
453
- {
454
- _request = name as carriers.Batch_GetBatchTaskInfosByNameAndStateRequest;
455
- _options = state as base.WebApiRequestOptions;
456
- }
457
- else
458
- {
459
- _request = {
460
- name: name as string,
461
- state: state as enums.BatchTaskState,
462
- };
463
- _options = webapi_options;
464
- }
465
- return this._getBatchTaskInfosByNameAndStateAsync( _request, _options );
466
- }
467
-
468
-
469
- private async _getBatchTaskInfosByNameAndAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
470
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
471
- base.WebApiBase.SetPending(options);
472
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
473
- try {
474
- config.baseURL = this._options.baseUrl;
475
- const response = await this._axios.post("GetBatchTaskInfosByNameAndAssociates", request , config);
476
- base.WebApiBase.SetCompleted(options, response);
477
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
478
- resolve(res);
479
- }
480
- catch( err ) {
481
- base.WebApiBase.HandleError(options, config, err);
482
- reject(err);
483
- }
484
- });
485
- }
486
-
487
-
488
-
489
- /**
490
- * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task definition name.
491
- * @param request - Name, AssociateIds
492
- * @returns Returns an array of BatchTaskInfo.
493
- */
494
- public async getBatchTaskInfosByNameAndAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
495
-
496
- /**
497
- * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task definition name.
498
- * @param name - Batchtask definition name. Blank for all tasks.
499
- * @param associateIds - Array of associate id's. Empty array for all. 0 for system tasks, -1 for all users, or specific user ids.
500
- * @returns Returns an array of BatchTaskInfo.
501
- */
502
- public async getBatchTaskInfosByNameAndAssociatesAsync(name: string, associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
503
-
504
- public async getBatchTaskInfosByNameAndAssociatesAsync(name:string|carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, associateIds?:number[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
505
- let _request : carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest = null;
506
- let _options : base.WebApiRequestOptions = null;
507
- const first : any = name;
508
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.associateIds)!='undefined' ) )
509
- {
510
- _request = name as carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest;
511
- _options = associateIds as base.WebApiRequestOptions;
512
- }
513
- else
514
- {
515
- _request = {
516
- name: name as string,
517
- associateIds: associateIds as number[],
518
- };
519
- _options = webapi_options;
520
- }
521
- return this._getBatchTaskInfosByNameAndAssociatesAsync( _request, _options );
522
- }
523
-
524
-
525
- private async _getBatchTaskInfosByAssociatesAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
526
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
527
- base.WebApiBase.SetPending(options);
528
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
529
- try {
530
- config.baseURL = this._options.baseUrl;
531
- const response = await this._axios.post("GetBatchTaskInfosByAssociatesAndState", request , config);
532
- base.WebApiBase.SetCompleted(options, response);
533
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
534
- resolve(res);
535
- }
536
- catch( err ) {
537
- base.WebApiBase.HandleError(options, config, err);
538
- reject(err);
539
- }
540
- });
541
- }
542
-
543
-
544
-
545
- /**
546
- * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task state.
547
- * @param request - AssociateIds, State
548
- * @returns Returns an array of BatchTaskInfo.
549
- */
550
- public async getBatchTaskInfosByAssociatesAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
551
-
552
- /**
553
- * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task state.
554
- * @param associateIds - Array of associate id's. Empty array for all. 0 for system tasks, -1 for all users, or specific user ids.
555
- * @param state - The BatchTaskState to get batch tasks for.
556
- * @returns Returns an array of BatchTaskInfo.
557
- */
558
- public async getBatchTaskInfosByAssociatesAndStateAsync(associateIds: number[], state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
559
-
560
- public async getBatchTaskInfosByAssociatesAndStateAsync(associateIds:number[]|carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
561
- let _request : carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest = null;
562
- let _options : base.WebApiRequestOptions = null;
563
- const first : any = associateIds;
564
- if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' || typeof(first.state)!='undefined' ) )
565
- {
566
- _request = associateIds as carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest;
567
- _options = state as base.WebApiRequestOptions;
568
- }
569
- else
570
- {
571
- _request = {
572
- associateIds: associateIds as number[],
573
- state: state as enums.BatchTaskState,
574
- };
575
- _options = webapi_options;
576
- }
577
- return this._getBatchTaskInfosByAssociatesAndStateAsync( _request, _options );
578
- }
579
-
580
-
581
- private async _deleteBatchTasksAsync(request: carriers.Batch_DeleteBatchTasksRequest, options?:base.WebApiRequestOptions) : Promise< void > {
582
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
583
- base.WebApiBase.SetPending(options);
584
- return new Promise< void >(async (resolve, reject) => {
585
- try {
586
- config.baseURL = this._options.baseUrl;
587
- const response = await this._axios.post("DeleteBatchTasks", request , config);
588
- base.WebApiBase.SetCompleted(options, response);
589
- const res = response.data;
590
- resolve(res);
591
- }
592
- catch( err ) {
593
- base.WebApiBase.HandleError(options, config, err);
594
- reject(err);
595
- }
596
- });
597
- }
598
-
599
-
600
-
601
- /**
602
- * Delete batch tasks from the database.
603
- * @param request - BatchTaskIds
604
- * @returns
605
- */
606
- public async deleteBatchTasksAsync(request: carriers.Batch_DeleteBatchTasksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
607
-
608
- /**
609
- * Delete batch tasks from the database.
610
- * @param batchTaskIds - Array of batchTask ids to delete.
611
- * @returns
612
- */
613
- public async deleteBatchTasksAsync(batchTaskIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
614
-
615
- public async deleteBatchTasksAsync(batchTaskIds:number[]|carriers.Batch_DeleteBatchTasksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
616
- let _request : carriers.Batch_DeleteBatchTasksRequest = null;
617
- let _options : base.WebApiRequestOptions = null;
618
- const first : any = batchTaskIds;
619
- if( typeof( first ) === "object" && first && ( typeof(first.batchTaskIds)!='undefined' ) )
620
- {
621
- _request = batchTaskIds as carriers.Batch_DeleteBatchTasksRequest;
622
- _options = webapi_options as base.WebApiRequestOptions;
623
- }
624
- else
625
- {
626
- _request = {
627
- batchTaskIds: batchTaskIds as number[],
628
- };
629
- _options = webapi_options;
630
- }
631
- return this._deleteBatchTasksAsync( _request, _options );
632
- }
633
-
634
-
635
- private async _deleteBatchTaskAsync(request: carriers.Batch_DeleteBatchTaskRequest, options?:base.WebApiRequestOptions) : Promise< void > {
636
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
637
- base.WebApiBase.SetPending(options);
638
- return new Promise< void >(async (resolve, reject) => {
639
- try {
640
- config.baseURL = this._options.baseUrl;
641
- const response = await this._axios.post("DeleteBatchTask", request , config);
642
- base.WebApiBase.SetCompleted(options, response);
643
- const res = response.data;
644
- resolve(res);
645
- }
646
- catch( err ) {
647
- base.WebApiBase.HandleError(options, config, err);
648
- reject(err);
649
- }
650
- });
651
- }
652
-
653
-
654
-
655
- /**
656
- * Delete a batch task from the database.
657
- * @param request - BatchTaskId
658
- * @returns
659
- */
660
- public async deleteBatchTaskAsync(request: carriers.Batch_DeleteBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
661
-
662
- /**
663
- * Delete a batch task from the database.
664
- * @param batchTaskId - The batchTask id to delete.
665
- * @returns
666
- */
667
- public async deleteBatchTaskAsync(batchTaskId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
668
-
669
- public async deleteBatchTaskAsync(batchTaskId:number|carriers.Batch_DeleteBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
670
- let _request : carriers.Batch_DeleteBatchTaskRequest = null;
671
- let _options : base.WebApiRequestOptions = null;
672
- const first : any = batchTaskId;
673
- if( typeof( first ) === "object" && first && ( typeof(first.batchTaskId)!='undefined' ) )
674
- {
675
- _request = batchTaskId as carriers.Batch_DeleteBatchTaskRequest;
676
- _options = webapi_options as base.WebApiRequestOptions;
677
- }
678
- else
679
- {
680
- _request = {
681
- batchTaskId: batchTaskId as number,
682
- };
683
- _options = webapi_options;
684
- }
685
- return this._deleteBatchTaskAsync( _request, _options );
686
- }
687
-
688
-
689
- private async _getAllBatchTaskInfosByNameAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
690
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
691
- base.WebApiBase.SetPending(options);
692
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
693
- try {
694
- config.baseURL = this._options.baseUrl;
695
- const response = await this._axios.post("GetAllBatchTaskInfosByName", request , config);
696
- base.WebApiBase.SetCompleted(options, response);
697
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
698
- resolve(res);
699
- }
700
- catch( err ) {
701
- base.WebApiBase.HandleError(options, config, err);
702
- reject(err);
703
- }
704
- });
705
- }
706
-
707
-
708
-
709
- /**
710
- * Get an array of system and user BatchTaskInfo for the provided task name.
711
- * @param request - TaskName
712
- * @returns Returns an array of user and system BatchTaskInfos.
713
- */
714
- public async getAllBatchTaskInfosByNameAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
715
-
716
- /**
717
- * Get an array of system and user BatchTaskInfo for the provided task name.
718
- * @param taskName - A task name, NULL or blank to get all tasks
719
- * @returns Returns an array of user and system BatchTaskInfos.
720
- */
721
- public async getAllBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
722
-
723
- public async getAllBatchTaskInfosByNameAsync(taskName:string|carriers.Batch_GetAllBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
724
- let _request : carriers.Batch_GetAllBatchTaskInfosByNameRequest = null;
725
- let _options : base.WebApiRequestOptions = null;
726
- const first : any = taskName;
727
- if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' ) )
728
- {
729
- _request = taskName as carriers.Batch_GetAllBatchTaskInfosByNameRequest;
730
- _options = webapi_options as base.WebApiRequestOptions;
731
- }
732
- else
733
- {
734
- _request = {
735
- taskName: taskName as string,
736
- };
737
- _options = webapi_options;
738
- }
739
- return this._getAllBatchTaskInfosByNameAsync( _request, _options );
740
- }
741
-
742
-
743
- private async _getAllBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
744
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
745
- base.WebApiBase.SetPending(options);
746
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
747
- try {
748
- config.baseURL = this._options.baseUrl;
749
- const response = await this._axios.post("GetAllBatchTaskInfosByNameAndState", request , config);
750
- base.WebApiBase.SetCompleted(options, response);
751
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
752
- resolve(res);
753
- }
754
- catch( err ) {
755
- base.WebApiBase.HandleError(options, config, err);
756
- reject(err);
757
- }
758
- });
759
- }
760
-
761
-
762
-
763
- /**
764
- * Get an array of system and user BatchTaskInfo for the provided task name and state.
765
- * @param request - TaskName, State
766
- * @returns Returns an array of user and system BatchTaskInfos.
767
- */
768
- public async getAllBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
769
-
770
- /**
771
- * Get an array of system and user BatchTaskInfo for the provided task name and state.
772
- * @param taskName - A task name, NULL or blank to get all tasks
773
- * @param state - The BatchTaskState to get batch tasks for.
774
- * @returns Returns an array of user and system BatchTaskInfos.
775
- */
776
- public async getAllBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
777
-
778
- public async getAllBatchTaskInfosByNameAndStateAsync(taskName:string|carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
779
- let _request : carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest = null;
780
- let _options : base.WebApiRequestOptions = null;
781
- const first : any = taskName;
782
- if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' || typeof(first.state)!='undefined' ) )
783
- {
784
- _request = taskName as carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest;
785
- _options = state as base.WebApiRequestOptions;
786
- }
787
- else
788
- {
789
- _request = {
790
- taskName: taskName as string,
791
- state: state as enums.BatchTaskState,
792
- };
793
- _options = webapi_options;
794
- }
795
- return this._getAllBatchTaskInfosByNameAndStateAsync( _request, _options );
796
- }
797
-
798
-
799
- private async _getSystemBatchTaskInfosByNameAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
800
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
801
- base.WebApiBase.SetPending(options);
802
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
803
- try {
804
- config.baseURL = this._options.baseUrl;
805
- const response = await this._axios.post("GetSystemBatchTaskInfosByName", request , config);
806
- base.WebApiBase.SetCompleted(options, response);
807
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
808
- resolve(res);
809
- }
810
- catch( err ) {
811
- base.WebApiBase.HandleError(options, config, err);
812
- reject(err);
813
- }
814
- });
815
- }
816
-
817
-
818
-
819
- /**
820
- * Get an array of system BatchTaskInfo for the provided task name.
821
- * @param request - TaskName
822
- * @returns Returns an array of system BatchTaskInfos.
823
- */
824
- public async getSystemBatchTaskInfosByNameAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
825
-
826
- /**
827
- * Get an array of system BatchTaskInfo for the provided task name.
828
- * @param taskName - A task name, NULL or blank to get all tasks
829
- * @returns Returns an array of system BatchTaskInfos.
830
- */
831
- public async getSystemBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
832
-
833
- public async getSystemBatchTaskInfosByNameAsync(taskName:string|carriers.Batch_GetSystemBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
834
- let _request : carriers.Batch_GetSystemBatchTaskInfosByNameRequest = null;
835
- let _options : base.WebApiRequestOptions = null;
836
- const first : any = taskName;
837
- if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' ) )
838
- {
839
- _request = taskName as carriers.Batch_GetSystemBatchTaskInfosByNameRequest;
840
- _options = webapi_options as base.WebApiRequestOptions;
841
- }
842
- else
843
- {
844
- _request = {
845
- taskName: taskName as string,
846
- };
847
- _options = webapi_options;
848
- }
849
- return this._getSystemBatchTaskInfosByNameAsync( _request, _options );
850
- }
851
-
852
-
853
- private async _getSystemBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
854
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
855
- base.WebApiBase.SetPending(options);
856
- return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
857
- try {
858
- config.baseURL = this._options.baseUrl;
859
- const response = await this._axios.post("GetSystemBatchTaskInfosByNameAndState", request , config);
860
- base.WebApiBase.SetCompleted(options, response);
861
- const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
862
- resolve(res);
863
- }
864
- catch( err ) {
865
- base.WebApiBase.HandleError(options, config, err);
866
- reject(err);
867
- }
868
- });
869
- }
870
-
871
-
872
-
873
- /**
874
- * Get an array of system BatchTaskInfo for the provided task name and state.
875
- * @param request - TaskName, State
876
- * @returns Returns an array of system BatchTaskInfos.
877
- */
878
- public async getSystemBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
879
-
880
- /**
881
- * Get an array of system BatchTaskInfo for the provided task name and state.
882
- * @param taskName - A task name, NULL or blank to get all tasks
883
- * @param state - The BatchTaskState to get batch tasks for.
884
- * @returns Returns an array of system BatchTaskInfos.
885
- */
886
- public async getSystemBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
887
-
888
- public async getSystemBatchTaskInfosByNameAndStateAsync(taskName:string|carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
889
- let _request : carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest = null;
890
- let _options : base.WebApiRequestOptions = null;
891
- const first : any = taskName;
892
- if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' || typeof(first.state)!='undefined' ) )
893
- {
894
- _request = taskName as carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest;
895
- _options = state as base.WebApiRequestOptions;
896
- }
897
- else
898
- {
899
- _request = {
900
- taskName: taskName as string,
901
- state: state as enums.BatchTaskState,
902
- };
903
- _options = webapi_options;
904
- }
905
- return this._getSystemBatchTaskInfosByNameAndStateAsync( _request, _options );
906
- }
907
-
908
- } // class v1BatchAgentController
909
-
910
-
1
+ // <auto-generated>
2
+ // SuperOffice Code Generator
3
+ // modelling\templates\servicestswebapi\tswebapiagents.tt
4
+ // </auto-generated>
5
+
6
+
7
+ /* tslint:disable */
8
+ //----------------------------------------------------------------------------
9
+ // G E N E R A T E D F I L E ! D O N O T E D I T !
10
+ //----------------------------------------------------------------------------
11
+ //
12
+ // File: WebApi/BatchAgent.ts
13
+ //
14
+ //----------------------------------------------------------------------------
15
+ // Copyright (C) SuperOffice AS
16
+ //----------------------------------------------------------------------------
17
+
18
+ import { AxiosRequestConfig } from 'axios';
19
+ import { Duration } from 'dayjs/plugin/duration';
20
+ import * as enums from './Enums';
21
+ import * as base from './WebApiBase';
22
+ import * as carriers from './Carriers';
23
+ import * as converters from './Converters';
24
+ import { FromBase64ToString, ToBase64 } from './Base64';
25
+
26
+ /**
27
+ * Start, stop and monitor predefined batch tasks
28
+ */
29
+ export interface IBatchAgent {
30
+ getBatchTaskInfoAsync(request: carriers.Batch_GetBatchTaskInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
31
+ getBatchTaskInfoAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
32
+ getBatchTaskInfosByAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
33
+ getBatchTaskInfosByAssociatesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
34
+ startBatchJobAsync(request: carriers.Batch_StartBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
35
+ startBatchJobAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
36
+ stopBatchJobAsync(request: carriers.Batch_StopBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
37
+ stopBatchJobAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
38
+ getBatchTaskInfosByStateAsync(request: carriers.Batch_GetBatchTaskInfosByStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
39
+ getBatchTaskInfosByStateAsync(state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
40
+ updateBatchTaskAsync(request: carriers.Batch_UpdateBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
41
+ updateBatchTaskAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
42
+ getBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
43
+ getBatchTaskInfosByNameAndStateAsync(name: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
44
+ getBatchTaskInfosByNameAndAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
45
+ getBatchTaskInfosByNameAndAssociatesAsync(name: string, associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
46
+ getBatchTaskInfosByAssociatesAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
47
+ getBatchTaskInfosByAssociatesAndStateAsync(associateIds: number[], state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
48
+ deleteBatchTasksAsync(request: carriers.Batch_DeleteBatchTasksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
49
+ deleteBatchTasksAsync(batchTaskIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
50
+ deleteBatchTaskAsync(request: carriers.Batch_DeleteBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
51
+ deleteBatchTaskAsync(batchTaskId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
52
+ getAllBatchTaskInfosByNameAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
53
+ getAllBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
54
+ getAllBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
55
+ getAllBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
56
+ getSystemBatchTaskInfosByNameAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
57
+ getSystemBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
58
+ getSystemBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
59
+ getSystemBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
60
+ } // interface IBatchAgent
61
+
62
+
63
+
64
+
65
+ /**
66
+ * Start, stop and monitor predefined batch tasks
67
+ */
68
+ export class BatchAgent extends base.WebApiBase implements IBatchAgent {
69
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
70
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
71
+ constructor(baseUrl: string, resourceManager:any);
72
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
73
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
74
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
75
+ constructor(options: base.WebApiOptions);
76
+
77
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
78
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
79
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
80
+ cultureCode?: string,
81
+ ) {
82
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
83
+ options.basePath = "v1/Agents/Batch/";
84
+ super(options);
85
+ }
86
+
87
+
88
+
89
+ private async _getBatchTaskInfoAsync(request: carriers.Batch_GetBatchTaskInfoRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
90
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
91
+ base.WebApiBase.SetPending(options);
92
+ return new Promise< carriers.BatchTaskInfo >(async (resolve, reject) => {
93
+ try {
94
+ config.baseURL = this._options.baseUrl;
95
+ const response = await this._axios.post("GetBatchTaskInfo", request , config);
96
+ base.WebApiBase.SetCompleted(options, response);
97
+ const res : carriers.BatchTaskInfo = converters.Create_BatchTaskInfo_From( response.data );
98
+ resolve(res);
99
+ }
100
+ catch( err ) {
101
+ base.WebApiBase.HandleError(options, config, err);
102
+ reject(err);
103
+ }
104
+ });
105
+ }
106
+
107
+
108
+
109
+ /**
110
+ * Get a single BatchTaskInfo based on Id.
111
+ * @param request - Id
112
+ * @returns Returns a BatchTaskInfo.
113
+ */
114
+ public async getBatchTaskInfoAsync(request: carriers.Batch_GetBatchTaskInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
115
+
116
+ /**
117
+ * Get a single BatchTaskInfo based on Id.
118
+ * @param id - Id of the BatchTaskInfo to get.
119
+ * @returns Returns a BatchTaskInfo.
120
+ */
121
+ public async getBatchTaskInfoAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
122
+
123
+ public async getBatchTaskInfoAsync(id:number|carriers.Batch_GetBatchTaskInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
124
+ let _request : carriers.Batch_GetBatchTaskInfoRequest = null;
125
+ let _options : base.WebApiRequestOptions = null;
126
+ const first : any = id;
127
+ if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
128
+ {
129
+ _request = id as carriers.Batch_GetBatchTaskInfoRequest;
130
+ _options = webapi_options as base.WebApiRequestOptions;
131
+ }
132
+ else
133
+ {
134
+ _request = {
135
+ id: id as number,
136
+ };
137
+ _options = webapi_options;
138
+ }
139
+ return this._getBatchTaskInfoAsync( _request, _options );
140
+ }
141
+
142
+
143
+ private async _getBatchTaskInfosByAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
144
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
145
+ base.WebApiBase.SetPending(options);
146
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
147
+ try {
148
+ config.baseURL = this._options.baseUrl;
149
+ const response = await this._axios.post("GetBatchTaskInfosByAssociates", request , config);
150
+ base.WebApiBase.SetCompleted(options, response);
151
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
152
+ resolve(res);
153
+ }
154
+ catch( err ) {
155
+ base.WebApiBase.HandleError(options, config, err);
156
+ reject(err);
157
+ }
158
+ });
159
+ }
160
+
161
+
162
+
163
+ /**
164
+ * Get an array of BatchTaskInfo for the provided associate id&apos;s.
165
+ * @param request - AssociateIds
166
+ * @returns Returns an array of user's BatchTaskInfo.
167
+ */
168
+ public async getBatchTaskInfosByAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
169
+
170
+ /**
171
+ * Get an array of BatchTaskInfo for the provided associate id&apos;s.
172
+ * @param associateIds - Array of associate id's. empty array = all tasks, 0 = system tasks, -1 = all user tasks.
173
+ * @returns Returns an array of user's BatchTaskInfo.
174
+ */
175
+ public async getBatchTaskInfosByAssociatesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
176
+
177
+ public async getBatchTaskInfosByAssociatesAsync(associateIds:number[]|carriers.Batch_GetBatchTaskInfosByAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
178
+ let _request : carriers.Batch_GetBatchTaskInfosByAssociatesRequest = null;
179
+ let _options : base.WebApiRequestOptions = null;
180
+ const first : any = associateIds;
181
+ if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' ) )
182
+ {
183
+ _request = associateIds as carriers.Batch_GetBatchTaskInfosByAssociatesRequest;
184
+ _options = webapi_options as base.WebApiRequestOptions;
185
+ }
186
+ else
187
+ {
188
+ _request = {
189
+ associateIds: associateIds as number[],
190
+ };
191
+ _options = webapi_options;
192
+ }
193
+ return this._getBatchTaskInfosByAssociatesAsync( _request, _options );
194
+ }
195
+
196
+
197
+ private async _startBatchJobAsync(request: carriers.Batch_StartBatchJobRequest, options?:base.WebApiRequestOptions) : Promise< number > {
198
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
199
+ base.WebApiBase.SetPending(options);
200
+ return new Promise< number >(async (resolve, reject) => {
201
+ try {
202
+ config.baseURL = this._options.baseUrl;
203
+ const response = await this._axios.post("StartBatchJob", request , config);
204
+ base.WebApiBase.SetCompleted(options, response);
205
+ const res : number = response.data as number;
206
+ resolve(res);
207
+ }
208
+ catch( err ) {
209
+ base.WebApiBase.HandleError(options, config, err);
210
+ reject(err);
211
+ }
212
+ });
213
+ }
214
+
215
+
216
+
217
+ /**
218
+ * Start a batch job based on BatchTaskInfo.
219
+ * @param request - BatchTaskInfo
220
+ * @returns Returns the id of the created batch job.
221
+ */
222
+ public async startBatchJobAsync(request: carriers.Batch_StartBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
223
+
224
+ /**
225
+ * Start a batch job based on BatchTaskInfo.
226
+ * @param batchTaskInfo - Use BatchTaskInfo to describe the new batch job.
227
+ * @returns Returns the id of the created batch job.
228
+ */
229
+ public async startBatchJobAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
230
+
231
+ public async startBatchJobAsync(batchTaskInfo:carriers.BatchTaskInfo|carriers.Batch_StartBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
232
+ let _request : carriers.Batch_StartBatchJobRequest = null;
233
+ let _options : base.WebApiRequestOptions = null;
234
+ const first : any = batchTaskInfo;
235
+ if( typeof( first ) === "object" && first && ( typeof(first.batchTaskInfo)!='undefined' ) )
236
+ {
237
+ _request = batchTaskInfo as carriers.Batch_StartBatchJobRequest;
238
+ _options = webapi_options as base.WebApiRequestOptions;
239
+ }
240
+ else
241
+ {
242
+ _request = {
243
+ batchTaskInfo: batchTaskInfo as carriers.BatchTaskInfo,
244
+ };
245
+ _options = webapi_options;
246
+ }
247
+ return this._startBatchJobAsync( _request, _options );
248
+ }
249
+
250
+
251
+ private async _stopBatchJobAsync(request: carriers.Batch_StopBatchJobRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
252
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
253
+ base.WebApiBase.SetPending(options);
254
+ return new Promise< boolean >(async (resolve, reject) => {
255
+ try {
256
+ config.baseURL = this._options.baseUrl;
257
+ const response = await this._axios.post("StopBatchJob", request , config);
258
+ base.WebApiBase.SetCompleted(options, response);
259
+ const res : boolean = response.data as boolean;
260
+ resolve(res);
261
+ }
262
+ catch( err ) {
263
+ base.WebApiBase.HandleError(options, config, err);
264
+ reject(err);
265
+ }
266
+ });
267
+ }
268
+
269
+
270
+
271
+ /**
272
+ * Stop a batch job based on Id.
273
+ * @param request - Id
274
+ * @returns Returns true if the job was stopped successfully.
275
+ */
276
+ public async stopBatchJobAsync(request: carriers.Batch_StopBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
277
+
278
+ /**
279
+ * Stop a batch job based on Id.
280
+ * @param id - Id of the batch job to stop.
281
+ * @returns Returns true if the job was stopped successfully.
282
+ */
283
+ public async stopBatchJobAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
284
+
285
+ public async stopBatchJobAsync(id:number|carriers.Batch_StopBatchJobRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
286
+ let _request : carriers.Batch_StopBatchJobRequest = null;
287
+ let _options : base.WebApiRequestOptions = null;
288
+ const first : any = id;
289
+ if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
290
+ {
291
+ _request = id as carriers.Batch_StopBatchJobRequest;
292
+ _options = webapi_options as base.WebApiRequestOptions;
293
+ }
294
+ else
295
+ {
296
+ _request = {
297
+ id: id as number,
298
+ };
299
+ _options = webapi_options;
300
+ }
301
+ return this._stopBatchJobAsync( _request, _options );
302
+ }
303
+
304
+
305
+ private async _getBatchTaskInfosByStateAsync(request: carriers.Batch_GetBatchTaskInfosByStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
306
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
307
+ base.WebApiBase.SetPending(options);
308
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
309
+ try {
310
+ config.baseURL = this._options.baseUrl;
311
+ const response = await this._axios.post("GetBatchTaskInfosByState", request , config);
312
+ base.WebApiBase.SetCompleted(options, response);
313
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
314
+ resolve(res);
315
+ }
316
+ catch( err ) {
317
+ base.WebApiBase.HandleError(options, config, err);
318
+ reject(err);
319
+ }
320
+ });
321
+ }
322
+
323
+
324
+
325
+ /**
326
+ * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState.
327
+ * @param request - State
328
+ * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
329
+ */
330
+ public async getBatchTaskInfosByStateAsync(request: carriers.Batch_GetBatchTaskInfosByStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
331
+
332
+ /**
333
+ * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState.
334
+ * @param state - The BatchTaskState to get batch tasks for.
335
+ * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
336
+ */
337
+ public async getBatchTaskInfosByStateAsync(state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
338
+
339
+ public async getBatchTaskInfosByStateAsync(state:enums.BatchTaskState|carriers.Batch_GetBatchTaskInfosByStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
340
+ let _request : carriers.Batch_GetBatchTaskInfosByStateRequest = null;
341
+ let _options : base.WebApiRequestOptions = null;
342
+ const first : any = state;
343
+ if( typeof( first ) === "object" && first && ( typeof(first.state)!='undefined' ) )
344
+ {
345
+ _request = state as carriers.Batch_GetBatchTaskInfosByStateRequest;
346
+ _options = webapi_options as base.WebApiRequestOptions;
347
+ }
348
+ else
349
+ {
350
+ _request = {
351
+ state: state as enums.BatchTaskState,
352
+ };
353
+ _options = webapi_options;
354
+ }
355
+ return this._getBatchTaskInfosByStateAsync( _request, _options );
356
+ }
357
+
358
+
359
+ private async _updateBatchTaskAsync(request: carriers.Batch_UpdateBatchTaskRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
360
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
361
+ base.WebApiBase.SetPending(options);
362
+ return new Promise< carriers.BatchTaskInfo >(async (resolve, reject) => {
363
+ try {
364
+ config.baseURL = this._options.baseUrl;
365
+ const response = await this._axios.post("UpdateBatchTask", request , config);
366
+ base.WebApiBase.SetCompleted(options, response);
367
+ const res : carriers.BatchTaskInfo = converters.Create_BatchTaskInfo_From( response.data );
368
+ resolve(res);
369
+ }
370
+ catch( err ) {
371
+ base.WebApiBase.HandleError(options, config, err);
372
+ reject(err);
373
+ }
374
+ });
375
+ }
376
+
377
+
378
+
379
+ /**
380
+ * Update information about a BatchTask. Only the following properties can be updated: State, Description, Response and Request.
381
+ * @param request - BatchTaskInfo
382
+ * @returns The updated BatchTaskInfo
383
+ */
384
+ public async updateBatchTaskAsync(request: carriers.Batch_UpdateBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
385
+
386
+ /**
387
+ * Update information about a BatchTask. Only the following properties can be updated: State, Description, Response and Request.
388
+ * @param batchTaskInfo - The updated information to save.
389
+ * @returns The updated BatchTaskInfo
390
+ */
391
+ public async updateBatchTaskAsync(batchTaskInfo: carriers.BatchTaskInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
392
+
393
+ public async updateBatchTaskAsync(batchTaskInfo:carriers.BatchTaskInfo|carriers.Batch_UpdateBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo > {
394
+ let _request : carriers.Batch_UpdateBatchTaskRequest = null;
395
+ let _options : base.WebApiRequestOptions = null;
396
+ const first : any = batchTaskInfo;
397
+ if( typeof( first ) === "object" && first && ( typeof(first.batchTaskInfo)!='undefined' ) )
398
+ {
399
+ _request = batchTaskInfo as carriers.Batch_UpdateBatchTaskRequest;
400
+ _options = webapi_options as base.WebApiRequestOptions;
401
+ }
402
+ else
403
+ {
404
+ _request = {
405
+ batchTaskInfo: batchTaskInfo as carriers.BatchTaskInfo,
406
+ };
407
+ _options = webapi_options;
408
+ }
409
+ return this._updateBatchTaskAsync( _request, _options );
410
+ }
411
+
412
+
413
+ private async _getBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
414
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
415
+ base.WebApiBase.SetPending(options);
416
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
417
+ try {
418
+ config.baseURL = this._options.baseUrl;
419
+ const response = await this._axios.post("GetBatchTaskInfosByNameAndState", request , config);
420
+ base.WebApiBase.SetCompleted(options, response);
421
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
422
+ resolve(res);
423
+ }
424
+ catch( err ) {
425
+ base.WebApiBase.HandleError(options, config, err);
426
+ reject(err);
427
+ }
428
+ });
429
+ }
430
+
431
+
432
+
433
+ /**
434
+ * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.
435
+ * @param request - Name, State
436
+ * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
437
+ */
438
+ public async getBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
439
+
440
+ /**
441
+ * Gets an array of user BatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.
442
+ * @param name - Batchtask definition name. Blank for all tasks.
443
+ * @param state - The BatchTaskState to get batch tasks for.
444
+ * @returns Returns an array of user BatchTaskInfo. System tasks are excluded.
445
+ */
446
+ public async getBatchTaskInfosByNameAndStateAsync(name: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
447
+
448
+ public async getBatchTaskInfosByNameAndStateAsync(name:string|carriers.Batch_GetBatchTaskInfosByNameAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
449
+ let _request : carriers.Batch_GetBatchTaskInfosByNameAndStateRequest = null;
450
+ let _options : base.WebApiRequestOptions = null;
451
+ const first : any = name;
452
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.state)!='undefined' ) )
453
+ {
454
+ _request = name as carriers.Batch_GetBatchTaskInfosByNameAndStateRequest;
455
+ _options = state as base.WebApiRequestOptions;
456
+ }
457
+ else
458
+ {
459
+ _request = {
460
+ name: name as string,
461
+ state: state as enums.BatchTaskState,
462
+ };
463
+ _options = webapi_options;
464
+ }
465
+ return this._getBatchTaskInfosByNameAndStateAsync( _request, _options );
466
+ }
467
+
468
+
469
+ private async _getBatchTaskInfosByNameAndAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
470
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
471
+ base.WebApiBase.SetPending(options);
472
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
473
+ try {
474
+ config.baseURL = this._options.baseUrl;
475
+ const response = await this._axios.post("GetBatchTaskInfosByNameAndAssociates", request , config);
476
+ base.WebApiBase.SetCompleted(options, response);
477
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
478
+ resolve(res);
479
+ }
480
+ catch( err ) {
481
+ base.WebApiBase.HandleError(options, config, err);
482
+ reject(err);
483
+ }
484
+ });
485
+ }
486
+
487
+
488
+
489
+ /**
490
+ * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task definition name.
491
+ * @param request - Name, AssociateIds
492
+ * @returns Returns an array of BatchTaskInfo.
493
+ */
494
+ public async getBatchTaskInfosByNameAndAssociatesAsync(request: carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
495
+
496
+ /**
497
+ * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task definition name.
498
+ * @param name - Batchtask definition name. Blank for all tasks.
499
+ * @param associateIds - Array of associate id's. Empty array for all. 0 for system tasks, -1 for all users, or specific user ids.
500
+ * @returns Returns an array of BatchTaskInfo.
501
+ */
502
+ public async getBatchTaskInfosByNameAndAssociatesAsync(name: string, associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
503
+
504
+ public async getBatchTaskInfosByNameAndAssociatesAsync(name:string|carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest, associateIds?:number[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
505
+ let _request : carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest = null;
506
+ let _options : base.WebApiRequestOptions = null;
507
+ const first : any = name;
508
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.associateIds)!='undefined' ) )
509
+ {
510
+ _request = name as carriers.Batch_GetBatchTaskInfosByNameAndAssociatesRequest;
511
+ _options = associateIds as base.WebApiRequestOptions;
512
+ }
513
+ else
514
+ {
515
+ _request = {
516
+ name: name as string,
517
+ associateIds: associateIds as number[],
518
+ };
519
+ _options = webapi_options;
520
+ }
521
+ return this._getBatchTaskInfosByNameAndAssociatesAsync( _request, _options );
522
+ }
523
+
524
+
525
+ private async _getBatchTaskInfosByAssociatesAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
526
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
527
+ base.WebApiBase.SetPending(options);
528
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
529
+ try {
530
+ config.baseURL = this._options.baseUrl;
531
+ const response = await this._axios.post("GetBatchTaskInfosByAssociatesAndState", request , config);
532
+ base.WebApiBase.SetCompleted(options, response);
533
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
534
+ resolve(res);
535
+ }
536
+ catch( err ) {
537
+ base.WebApiBase.HandleError(options, config, err);
538
+ reject(err);
539
+ }
540
+ });
541
+ }
542
+
543
+
544
+
545
+ /**
546
+ * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task state.
547
+ * @param request - AssociateIds, State
548
+ * @returns Returns an array of BatchTaskInfo.
549
+ */
550
+ public async getBatchTaskInfosByAssociatesAndStateAsync(request: carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
551
+
552
+ /**
553
+ * Get an array of BatchTaskInfo for the provided associate id&apos;s and batch task state.
554
+ * @param associateIds - Array of associate id's. Empty array for all. 0 for system tasks, -1 for all users, or specific user ids.
555
+ * @param state - The BatchTaskState to get batch tasks for.
556
+ * @returns Returns an array of BatchTaskInfo.
557
+ */
558
+ public async getBatchTaskInfosByAssociatesAndStateAsync(associateIds: number[], state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
559
+
560
+ public async getBatchTaskInfosByAssociatesAndStateAsync(associateIds:number[]|carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
561
+ let _request : carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest = null;
562
+ let _options : base.WebApiRequestOptions = null;
563
+ const first : any = associateIds;
564
+ if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' || typeof(first.state)!='undefined' ) )
565
+ {
566
+ _request = associateIds as carriers.Batch_GetBatchTaskInfosByAssociatesAndStateRequest;
567
+ _options = state as base.WebApiRequestOptions;
568
+ }
569
+ else
570
+ {
571
+ _request = {
572
+ associateIds: associateIds as number[],
573
+ state: state as enums.BatchTaskState,
574
+ };
575
+ _options = webapi_options;
576
+ }
577
+ return this._getBatchTaskInfosByAssociatesAndStateAsync( _request, _options );
578
+ }
579
+
580
+
581
+ private async _deleteBatchTasksAsync(request: carriers.Batch_DeleteBatchTasksRequest, options?:base.WebApiRequestOptions) : Promise< void > {
582
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
583
+ base.WebApiBase.SetPending(options);
584
+ return new Promise< void >(async (resolve, reject) => {
585
+ try {
586
+ config.baseURL = this._options.baseUrl;
587
+ const response = await this._axios.post("DeleteBatchTasks", request , config);
588
+ base.WebApiBase.SetCompleted(options, response);
589
+ const res = response.data;
590
+ resolve(res);
591
+ }
592
+ catch( err ) {
593
+ base.WebApiBase.HandleError(options, config, err);
594
+ reject(err);
595
+ }
596
+ });
597
+ }
598
+
599
+
600
+
601
+ /**
602
+ * Delete batch tasks from the database.
603
+ * @param request - BatchTaskIds
604
+ * @returns
605
+ */
606
+ public async deleteBatchTasksAsync(request: carriers.Batch_DeleteBatchTasksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
607
+
608
+ /**
609
+ * Delete batch tasks from the database.
610
+ * @param batchTaskIds - Array of batchTask ids to delete.
611
+ * @returns
612
+ */
613
+ public async deleteBatchTasksAsync(batchTaskIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
614
+
615
+ public async deleteBatchTasksAsync(batchTaskIds:number[]|carriers.Batch_DeleteBatchTasksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
616
+ let _request : carriers.Batch_DeleteBatchTasksRequest = null;
617
+ let _options : base.WebApiRequestOptions = null;
618
+ const first : any = batchTaskIds;
619
+ if( typeof( first ) === "object" && first && ( typeof(first.batchTaskIds)!='undefined' ) )
620
+ {
621
+ _request = batchTaskIds as carriers.Batch_DeleteBatchTasksRequest;
622
+ _options = webapi_options as base.WebApiRequestOptions;
623
+ }
624
+ else
625
+ {
626
+ _request = {
627
+ batchTaskIds: batchTaskIds as number[],
628
+ };
629
+ _options = webapi_options;
630
+ }
631
+ return this._deleteBatchTasksAsync( _request, _options );
632
+ }
633
+
634
+
635
+ private async _deleteBatchTaskAsync(request: carriers.Batch_DeleteBatchTaskRequest, options?:base.WebApiRequestOptions) : Promise< void > {
636
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
637
+ base.WebApiBase.SetPending(options);
638
+ return new Promise< void >(async (resolve, reject) => {
639
+ try {
640
+ config.baseURL = this._options.baseUrl;
641
+ const response = await this._axios.post("DeleteBatchTask", request , config);
642
+ base.WebApiBase.SetCompleted(options, response);
643
+ const res = response.data;
644
+ resolve(res);
645
+ }
646
+ catch( err ) {
647
+ base.WebApiBase.HandleError(options, config, err);
648
+ reject(err);
649
+ }
650
+ });
651
+ }
652
+
653
+
654
+
655
+ /**
656
+ * Delete a batch task from the database.
657
+ * @param request - BatchTaskId
658
+ * @returns
659
+ */
660
+ public async deleteBatchTaskAsync(request: carriers.Batch_DeleteBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
661
+
662
+ /**
663
+ * Delete a batch task from the database.
664
+ * @param batchTaskId - The batchTask id to delete.
665
+ * @returns
666
+ */
667
+ public async deleteBatchTaskAsync(batchTaskId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
668
+
669
+ public async deleteBatchTaskAsync(batchTaskId:number|carriers.Batch_DeleteBatchTaskRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
670
+ let _request : carriers.Batch_DeleteBatchTaskRequest = null;
671
+ let _options : base.WebApiRequestOptions = null;
672
+ const first : any = batchTaskId;
673
+ if( typeof( first ) === "object" && first && ( typeof(first.batchTaskId)!='undefined' ) )
674
+ {
675
+ _request = batchTaskId as carriers.Batch_DeleteBatchTaskRequest;
676
+ _options = webapi_options as base.WebApiRequestOptions;
677
+ }
678
+ else
679
+ {
680
+ _request = {
681
+ batchTaskId: batchTaskId as number,
682
+ };
683
+ _options = webapi_options;
684
+ }
685
+ return this._deleteBatchTaskAsync( _request, _options );
686
+ }
687
+
688
+
689
+ private async _getAllBatchTaskInfosByNameAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
690
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
691
+ base.WebApiBase.SetPending(options);
692
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
693
+ try {
694
+ config.baseURL = this._options.baseUrl;
695
+ const response = await this._axios.post("GetAllBatchTaskInfosByName", request , config);
696
+ base.WebApiBase.SetCompleted(options, response);
697
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
698
+ resolve(res);
699
+ }
700
+ catch( err ) {
701
+ base.WebApiBase.HandleError(options, config, err);
702
+ reject(err);
703
+ }
704
+ });
705
+ }
706
+
707
+
708
+
709
+ /**
710
+ * Get an array of system and user BatchTaskInfo for the provided task name.
711
+ * @param request - TaskName
712
+ * @returns Returns an array of user and system BatchTaskInfos.
713
+ */
714
+ public async getAllBatchTaskInfosByNameAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
715
+
716
+ /**
717
+ * Get an array of system and user BatchTaskInfo for the provided task name.
718
+ * @param taskName - A task name, NULL or blank to get all tasks
719
+ * @returns Returns an array of user and system BatchTaskInfos.
720
+ */
721
+ public async getAllBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
722
+
723
+ public async getAllBatchTaskInfosByNameAsync(taskName:string|carriers.Batch_GetAllBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
724
+ let _request : carriers.Batch_GetAllBatchTaskInfosByNameRequest = null;
725
+ let _options : base.WebApiRequestOptions = null;
726
+ const first : any = taskName;
727
+ if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' ) )
728
+ {
729
+ _request = taskName as carriers.Batch_GetAllBatchTaskInfosByNameRequest;
730
+ _options = webapi_options as base.WebApiRequestOptions;
731
+ }
732
+ else
733
+ {
734
+ _request = {
735
+ taskName: taskName as string,
736
+ };
737
+ _options = webapi_options;
738
+ }
739
+ return this._getAllBatchTaskInfosByNameAsync( _request, _options );
740
+ }
741
+
742
+
743
+ private async _getAllBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
744
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
745
+ base.WebApiBase.SetPending(options);
746
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
747
+ try {
748
+ config.baseURL = this._options.baseUrl;
749
+ const response = await this._axios.post("GetAllBatchTaskInfosByNameAndState", request , config);
750
+ base.WebApiBase.SetCompleted(options, response);
751
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
752
+ resolve(res);
753
+ }
754
+ catch( err ) {
755
+ base.WebApiBase.HandleError(options, config, err);
756
+ reject(err);
757
+ }
758
+ });
759
+ }
760
+
761
+
762
+
763
+ /**
764
+ * Get an array of system and user BatchTaskInfo for the provided task name and state.
765
+ * @param request - TaskName, State
766
+ * @returns Returns an array of user and system BatchTaskInfos.
767
+ */
768
+ public async getAllBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
769
+
770
+ /**
771
+ * Get an array of system and user BatchTaskInfo for the provided task name and state.
772
+ * @param taskName - A task name, NULL or blank to get all tasks
773
+ * @param state - The BatchTaskState to get batch tasks for.
774
+ * @returns Returns an array of user and system BatchTaskInfos.
775
+ */
776
+ public async getAllBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
777
+
778
+ public async getAllBatchTaskInfosByNameAndStateAsync(taskName:string|carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
779
+ let _request : carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest = null;
780
+ let _options : base.WebApiRequestOptions = null;
781
+ const first : any = taskName;
782
+ if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' || typeof(first.state)!='undefined' ) )
783
+ {
784
+ _request = taskName as carriers.Batch_GetAllBatchTaskInfosByNameAndStateRequest;
785
+ _options = state as base.WebApiRequestOptions;
786
+ }
787
+ else
788
+ {
789
+ _request = {
790
+ taskName: taskName as string,
791
+ state: state as enums.BatchTaskState,
792
+ };
793
+ _options = webapi_options;
794
+ }
795
+ return this._getAllBatchTaskInfosByNameAndStateAsync( _request, _options );
796
+ }
797
+
798
+
799
+ private async _getSystemBatchTaskInfosByNameAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
800
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
801
+ base.WebApiBase.SetPending(options);
802
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
803
+ try {
804
+ config.baseURL = this._options.baseUrl;
805
+ const response = await this._axios.post("GetSystemBatchTaskInfosByName", request , config);
806
+ base.WebApiBase.SetCompleted(options, response);
807
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
808
+ resolve(res);
809
+ }
810
+ catch( err ) {
811
+ base.WebApiBase.HandleError(options, config, err);
812
+ reject(err);
813
+ }
814
+ });
815
+ }
816
+
817
+
818
+
819
+ /**
820
+ * Get an array of system BatchTaskInfo for the provided task name.
821
+ * @param request - TaskName
822
+ * @returns Returns an array of system BatchTaskInfos.
823
+ */
824
+ public async getSystemBatchTaskInfosByNameAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
825
+
826
+ /**
827
+ * Get an array of system BatchTaskInfo for the provided task name.
828
+ * @param taskName - A task name, NULL or blank to get all tasks
829
+ * @returns Returns an array of system BatchTaskInfos.
830
+ */
831
+ public async getSystemBatchTaskInfosByNameAsync(taskName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
832
+
833
+ public async getSystemBatchTaskInfosByNameAsync(taskName:string|carriers.Batch_GetSystemBatchTaskInfosByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
834
+ let _request : carriers.Batch_GetSystemBatchTaskInfosByNameRequest = null;
835
+ let _options : base.WebApiRequestOptions = null;
836
+ const first : any = taskName;
837
+ if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' ) )
838
+ {
839
+ _request = taskName as carriers.Batch_GetSystemBatchTaskInfosByNameRequest;
840
+ _options = webapi_options as base.WebApiRequestOptions;
841
+ }
842
+ else
843
+ {
844
+ _request = {
845
+ taskName: taskName as string,
846
+ };
847
+ _options = webapi_options;
848
+ }
849
+ return this._getSystemBatchTaskInfosByNameAsync( _request, _options );
850
+ }
851
+
852
+
853
+ private async _getSystemBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
854
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
855
+ base.WebApiBase.SetPending(options);
856
+ return new Promise< carriers.BatchTaskInfo[] >(async (resolve, reject) => {
857
+ try {
858
+ config.baseURL = this._options.baseUrl;
859
+ const response = await this._axios.post("GetSystemBatchTaskInfosByNameAndState", request , config);
860
+ base.WebApiBase.SetCompleted(options, response);
861
+ const res : carriers.BatchTaskInfo[] = converters.Create_BatchTaskInfoArray_From( response.data );
862
+ resolve(res);
863
+ }
864
+ catch( err ) {
865
+ base.WebApiBase.HandleError(options, config, err);
866
+ reject(err);
867
+ }
868
+ });
869
+ }
870
+
871
+
872
+
873
+ /**
874
+ * Get an array of system BatchTaskInfo for the provided task name and state.
875
+ * @param request - TaskName, State
876
+ * @returns Returns an array of system BatchTaskInfos.
877
+ */
878
+ public async getSystemBatchTaskInfosByNameAndStateAsync(request: carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
879
+
880
+ /**
881
+ * Get an array of system BatchTaskInfo for the provided task name and state.
882
+ * @param taskName - A task name, NULL or blank to get all tasks
883
+ * @param state - The BatchTaskState to get batch tasks for.
884
+ * @returns Returns an array of system BatchTaskInfos.
885
+ */
886
+ public async getSystemBatchTaskInfosByNameAndStateAsync(taskName: string, state: enums.BatchTaskState, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] >;
887
+
888
+ public async getSystemBatchTaskInfosByNameAndStateAsync(taskName:string|carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest, state?:enums.BatchTaskState|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo[] > {
889
+ let _request : carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest = null;
890
+ let _options : base.WebApiRequestOptions = null;
891
+ const first : any = taskName;
892
+ if( typeof( first ) === "object" && first && ( typeof(first.taskName)!='undefined' || typeof(first.state)!='undefined' ) )
893
+ {
894
+ _request = taskName as carriers.Batch_GetSystemBatchTaskInfosByNameAndStateRequest;
895
+ _options = state as base.WebApiRequestOptions;
896
+ }
897
+ else
898
+ {
899
+ _request = {
900
+ taskName: taskName as string,
901
+ state: state as enums.BatchTaskState,
902
+ };
903
+ _options = webapi_options;
904
+ }
905
+ return this._getSystemBatchTaskInfosByNameAndStateAsync( _request, _options );
906
+ }
907
+
908
+ } // class v1BatchAgentController
909
+
910
+