@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
@@ -1,1710 +1,1710 @@
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/ForeignSystemAgent.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
- * Collection of all services that works with Foreign key data (Key/Value pairs)
28
- */
29
- export interface IForeignSystemAgent {
30
- createDefaultForeignAppEntityAsync(): Promise< carriers.ForeignAppEntity >;
31
- saveForeignAppEntityAsync(entity: carriers.ForeignAppEntity) : Promise< carriers.ForeignAppEntity >;
32
- deleteForeignAppEntityAsync(ForeignAppEntityId: number) : Promise<void>;
33
- getForeignAppEntityAsync(foreignAppEntityId: number) : Promise< carriers.ForeignAppEntity >;
34
- getAppByNameAsync(request: carriers.ForeignSystem_GetAppByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
35
- getAppByNameAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
36
- getApplicationDevicesAsync(request: carriers.ForeignSystem_GetApplicationDevicesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
37
- getApplicationDevicesAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
38
- getDeviceByNameAsync(request: carriers.ForeignSystem_GetDeviceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
39
- getDeviceByNameAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
40
- getDeviceByIdentifierAsync(request: carriers.ForeignSystem_GetDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
41
- getDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
42
- addDeviceByIdentifierAsync(request: carriers.ForeignSystem_AddDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
43
- addDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
44
- saveDeviceByIdentifierAsync(request: carriers.ForeignSystem_SaveDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
45
- saveDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, foreignDevice: carriers.ForeignDevice, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
46
- deleteDeviceByIdentifierAsync(request: carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
47
- deleteDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
48
- getKeyAsync(request: carriers.ForeignSystem_GetKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
49
- getKeyAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
50
- getKeyValueAsync(request: carriers.ForeignSystem_GetKeyValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
51
- getKeyValueAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
52
- getKeyOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
53
- getKeyOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
54
- getKeyValueOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
55
- getKeyValueOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
56
- addForeignKeyAsync(request: carriers.ForeignSystem_AddForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
57
- addForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
58
- saveForeignKeyAsync(request: carriers.ForeignSystem_SaveForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
59
- saveForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
60
- deleteForeignKeyOnNameAsync(request: carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
61
- deleteForeignKeyOnNameAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
62
- getKeyByValueAsync(request: carriers.ForeignSystem_GetKeyByValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
63
- getKeyByValueAsync(applicationName: string, deviceName: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
64
- getKeyByValueAndIdentifierAsync(request: carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
65
- getKeyByValueAndIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
66
- getAllForeignKeysOnEntityAsync(request: carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
67
- getAllForeignKeysOnEntityAsync(entityType: string, entityId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
68
- getForeignDeviceAsync(foreignDeviceId: number) : Promise< carriers.ForeignDevice >;
69
- saveForeignDeviceAsync(request: carriers.ForeignSystem_SaveForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
70
- saveForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
71
- deleteForeignDeviceAsync(request: carriers.ForeignSystem_DeleteForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
72
- deleteForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
73
- deleteForeignKeyAsync(request: carriers.ForeignSystem_DeleteForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
74
- deleteForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
75
- getDeviceKeysAsync(request: carriers.ForeignSystem_GetDeviceKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
76
- getDeviceKeysAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
77
- getApplicationKeysAsync(request: carriers.ForeignSystem_GetApplicationKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
78
- getApplicationKeysAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
79
- getDeviceKeysOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
80
- getDeviceKeysOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
81
- getDeviceKeysOnDeviceIdentifierTableAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
82
- getDeviceKeysOnDeviceIdentifierTableAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
83
- getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
84
- getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
85
- } // interface IForeignSystemAgent
86
-
87
-
88
-
89
-
90
- /**
91
- * Collection of all services that works with Foreign key data (Key/Value pairs)
92
- */
93
- export class ForeignSystemAgent extends base.WebApiBase implements IForeignSystemAgent {
94
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
95
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
96
- constructor(baseUrl: string, resourceManager:any);
97
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
98
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
99
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
100
- constructor(options: base.WebApiOptions);
101
-
102
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
103
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
104
- langOrResourceOrRM?:string|base.ResourceParsing|any,
105
- cultureCode?: string,
106
- ) {
107
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
108
- options.basePath = "v1/Agents/ForeignSystem/";
109
- super(options);
110
- }
111
-
112
-
113
-
114
- /**
115
- * Set default values into a new ForeignAppEntity.
116
- * NetServer calculates default values on the entity, which is required when creating/storing a new instance
117
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
118
- * @returns A blank entity.
119
- */
120
- public async createDefaultForeignAppEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
121
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
122
- base.WebApiBase.SetPending(options);
123
- return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
124
- try {
125
- const response = await this._axios.post("CreateDefaultForeignAppEntity", null, config);
126
- base.WebApiBase.SetCompleted(options, response);
127
- const res : carriers.ForeignAppEntity = converters.Create_ForeignAppEntity_From( response.data );
128
- resolve(res);
129
- }
130
- catch( err ) {
131
- base.WebApiBase.HandleError(options, config, err);
132
- reject(err);
133
- }
134
- });
135
- }
136
- /**
137
- * Replace the existing ForeignAppEntity or creates a new ForeignAppEntity if the id parameter is empty
138
- * @param entity - The ForeignAppEntity to be saved.
139
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
140
- * @returns New or updated ForeignAppEntity
141
- */
142
- public async saveForeignAppEntityAsync(entity: carriers.ForeignAppEntity, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
143
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
144
- base.WebApiBase.SetPending(options);
145
- return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
146
- try {
147
- const response = await this._axios.post("SaveForeignAppEntity", entity, config);
148
- base.WebApiBase.SetCompleted(options, response);
149
- const res : carriers.ForeignAppEntity = converters.Create_ForeignAppEntity_From( response.data );
150
- resolve(res);
151
- }
152
- catch( err ) {
153
- base.WebApiBase.HandleError(options, config, err);
154
- reject(err);
155
- }
156
- });
157
- }
158
-
159
- /**
160
- * Deletes the ForeignAppEntity
161
- * @param ForeignAppEntityId - The id of the ForeignAppEntity to be deleted.
162
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
163
- */
164
- public async deleteForeignAppEntityAsync(ForeignAppEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
165
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
166
- base.WebApiBase.SetPending(options);
167
- return new Promise< void >(async (resolve, reject) => {
168
- try {
169
- const response = await this._axios.post("DeleteForeignAppEntity?ForeignAppEntityId=" + ForeignAppEntityId, null, config );
170
- base.WebApiBase.SetCompleted(options, response);
171
- const res = response.data;
172
- resolve(res);
173
- }
174
- catch( err ) {
175
- base.WebApiBase.HandleError(options, config, err);
176
- reject(err);
177
- }
178
- });
179
- }
180
- /**
181
- * Gets a ForeignAppEntity object.
182
- * @param foreignAppEntityId - The primary key.
183
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
184
- * @returns A single ForeignAppEntity
185
- */
186
- public async getForeignAppEntityAsync(foreignAppEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
187
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
188
- base.WebApiBase.SetPending(options);
189
- return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
190
- try {
191
- const response = await this._axios.post("GetForeignAppEntity?foreignAppEntityId=" + foreignAppEntityId, null, config);
192
- base.WebApiBase.SetCompleted(options, response);
193
- const res = converters.Create_ForeignAppEntity_From( response.data );
194
- resolve(res);
195
- }
196
- catch( err ) {
197
- base.WebApiBase.HandleError(options, config, err);
198
- reject(err);
199
- }
200
- });
201
- }
202
-
203
-
204
- private async _getAppByNameAsync(request: carriers.ForeignSystem_GetAppByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
205
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
- base.WebApiBase.SetPending(options);
207
- return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
208
- try {
209
- config.baseURL = this._options.baseUrl;
210
- const response = await this._axios.post("GetAppByName", request , config);
211
- base.WebApiBase.SetCompleted(options, response);
212
- const res : carriers.ForeignAppEntity = converters.Create_ForeignAppEntity_From( response.data );
213
- resolve(res);
214
- }
215
- catch( err ) {
216
- base.WebApiBase.HandleError(options, config, err);
217
- reject(err);
218
- }
219
- });
220
- }
221
-
222
-
223
-
224
- /**
225
- * Gets the ForeignApp with the given name.
226
- * @param request - ApplicationName
227
- * @returns The ForeignApp that matches the name.
228
- */
229
- public async getAppByNameAsync(request: carriers.ForeignSystem_GetAppByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
230
-
231
- /**
232
- * Gets the ForeignApp with the given name.
233
- * @param applicationName - The name of the foreign application.
234
- * @returns The ForeignApp that matches the name.
235
- */
236
- public async getAppByNameAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
237
-
238
- public async getAppByNameAsync(applicationName:string|carriers.ForeignSystem_GetAppByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
239
- let _request : carriers.ForeignSystem_GetAppByNameRequest = null;
240
- let _options : base.WebApiRequestOptions = null;
241
- const first : any = applicationName;
242
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' ) )
243
- {
244
- _request = applicationName as carriers.ForeignSystem_GetAppByNameRequest;
245
- _options = webapi_options as base.WebApiRequestOptions;
246
- }
247
- else
248
- {
249
- _request = {
250
- applicationName: applicationName as string,
251
- };
252
- _options = webapi_options;
253
- }
254
- return this._getAppByNameAsync( _request, _options );
255
- }
256
-
257
-
258
- private async _getApplicationDevicesAsync(request: carriers.ForeignSystem_GetApplicationDevicesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] > {
259
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
260
- base.WebApiBase.SetPending(options);
261
- return new Promise< carriers.ForeignDevice[] >(async (resolve, reject) => {
262
- try {
263
- config.baseURL = this._options.baseUrl;
264
- const response = await this._axios.post("GetApplicationDevices", request , config);
265
- base.WebApiBase.SetCompleted(options, response);
266
- const res : carriers.ForeignDevice[] = converters.Create_ForeignDeviceArray_From( response.data );
267
- resolve(res);
268
- }
269
- catch( err ) {
270
- base.WebApiBase.HandleError(options, config, err);
271
- reject(err);
272
- }
273
- });
274
- }
275
-
276
-
277
-
278
- /**
279
- * Gets all devices that belong to a foreign application.
280
- * @param request - ApplicationName
281
- * @returns Array of ForeignDevices
282
- */
283
- public async getApplicationDevicesAsync(request: carriers.ForeignSystem_GetApplicationDevicesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
284
-
285
- /**
286
- * Gets all devices that belong to a foreign application.
287
- * @param applicationName - The foreign application name
288
- * @returns Array of ForeignDevices
289
- */
290
- public async getApplicationDevicesAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
291
-
292
- public async getApplicationDevicesAsync(applicationName:string|carriers.ForeignSystem_GetApplicationDevicesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] > {
293
- let _request : carriers.ForeignSystem_GetApplicationDevicesRequest = null;
294
- let _options : base.WebApiRequestOptions = null;
295
- const first : any = applicationName;
296
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' ) )
297
- {
298
- _request = applicationName as carriers.ForeignSystem_GetApplicationDevicesRequest;
299
- _options = webapi_options as base.WebApiRequestOptions;
300
- }
301
- else
302
- {
303
- _request = {
304
- applicationName: applicationName as string,
305
- };
306
- _options = webapi_options;
307
- }
308
- return this._getApplicationDevicesAsync( _request, _options );
309
- }
310
-
311
-
312
- private async _getDeviceByNameAsync(request: carriers.ForeignSystem_GetDeviceByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
313
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
314
- base.WebApiBase.SetPending(options);
315
- return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
316
- try {
317
- config.baseURL = this._options.baseUrl;
318
- const response = await this._axios.post("GetDeviceByName", request , config);
319
- base.WebApiBase.SetCompleted(options, response);
320
- const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
321
- resolve(res);
322
- }
323
- catch( err ) {
324
- base.WebApiBase.HandleError(options, config, err);
325
- reject(err);
326
- }
327
- });
328
- }
329
-
330
-
331
-
332
- /**
333
- * Gets a ForeignDevice with deviceName that belongs to the application with applicationName.
334
- * @param request - ApplicationName, DeviceName
335
- * @returns The ForeignDevice.
336
- */
337
- public async getDeviceByNameAsync(request: carriers.ForeignSystem_GetDeviceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
338
-
339
- /**
340
- * Gets a ForeignDevice with deviceName that belongs to the application with applicationName.
341
- * @param applicationName - The name of the foreign application.
342
- * @param deviceName - The name of the foreign device.
343
- * @returns The ForeignDevice.
344
- */
345
- public async getDeviceByNameAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
346
-
347
- public async getDeviceByNameAsync(applicationName:string|carriers.ForeignSystem_GetDeviceByNameRequest, deviceName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
348
- let _request : carriers.ForeignSystem_GetDeviceByNameRequest = null;
349
- let _options : base.WebApiRequestOptions = null;
350
- const first : any = applicationName;
351
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' ) )
352
- {
353
- _request = applicationName as carriers.ForeignSystem_GetDeviceByNameRequest;
354
- _options = deviceName as base.WebApiRequestOptions;
355
- }
356
- else
357
- {
358
- _request = {
359
- applicationName: applicationName as string,
360
- deviceName: deviceName as string,
361
- };
362
- _options = webapi_options;
363
- }
364
- return this._getDeviceByNameAsync( _request, _options );
365
- }
366
-
367
-
368
- private async _getDeviceByIdentifierAsync(request: carriers.ForeignSystem_GetDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
369
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
370
- base.WebApiBase.SetPending(options);
371
- return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
372
- try {
373
- config.baseURL = this._options.baseUrl;
374
- const response = await this._axios.post("GetDeviceByIdentifier", request , config);
375
- base.WebApiBase.SetCompleted(options, response);
376
- const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
377
- resolve(res);
378
- }
379
- catch( err ) {
380
- base.WebApiBase.HandleError(options, config, err);
381
- reject(err);
382
- }
383
- });
384
- }
385
-
386
-
387
-
388
- /**
389
- * Gets a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
390
- * @param request - ApplicationName, DeviceName, DeviceIdentifier
391
- * @returns The ForeignDevice.
392
- */
393
- public async getDeviceByIdentifierAsync(request: carriers.ForeignSystem_GetDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
394
-
395
- /**
396
- * Gets a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
397
- * @param applicationName - The name of the foreign application.
398
- * @param deviceName - The name of the foreign device.
399
- * @param deviceIdentifier - Optional unique id of device (Palm pilot device ID, version number, etc)
400
- * @returns The ForeignDevice.
401
- */
402
- public async getDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
403
-
404
- public async getDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
405
- let _request : carriers.ForeignSystem_GetDeviceByIdentifierRequest = null;
406
- let _options : base.WebApiRequestOptions = null;
407
- const first : any = applicationName;
408
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
409
- {
410
- _request = applicationName as carriers.ForeignSystem_GetDeviceByIdentifierRequest;
411
- _options = deviceName as base.WebApiRequestOptions;
412
- }
413
- else
414
- {
415
- _request = {
416
- applicationName: applicationName as string,
417
- deviceName: deviceName as string,
418
- deviceIdentifier: deviceIdentifier as string,
419
- };
420
- _options = webapi_options;
421
- }
422
- return this._getDeviceByIdentifierAsync( _request, _options );
423
- }
424
-
425
-
426
- private async _addDeviceByIdentifierAsync(request: carriers.ForeignSystem_AddDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
427
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
428
- base.WebApiBase.SetPending(options);
429
- return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
430
- try {
431
- config.baseURL = this._options.baseUrl;
432
- const response = await this._axios.post("AddDeviceByIdentifier", request , config);
433
- base.WebApiBase.SetCompleted(options, response);
434
- const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
435
- resolve(res);
436
- }
437
- catch( err ) {
438
- base.WebApiBase.HandleError(options, config, err);
439
- reject(err);
440
- }
441
- });
442
- }
443
-
444
-
445
-
446
- /**
447
- * Adds a new ForeignDevice with deviceName that belongs to the application with applicationName, with an optional device-specific identifier.
448
- * @param request - ApplicationName, DeviceName, DeviceIdentifier
449
- * @returns The ForeignDevice.
450
- */
451
- public async addDeviceByIdentifierAsync(request: carriers.ForeignSystem_AddDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
452
-
453
- /**
454
- * Adds a new ForeignDevice with deviceName that belongs to the application with applicationName, with an optional device-specific identifier.
455
- * @param applicationName - The name of the foreign application.
456
- * @param deviceName - The name of the foreign device.
457
- * @param deviceIdentifier - Unique id of device (Palm pilot device ID, version number, etc)
458
- * @returns The ForeignDevice.
459
- */
460
- public async addDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
461
-
462
- public async addDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_AddDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
463
- let _request : carriers.ForeignSystem_AddDeviceByIdentifierRequest = null;
464
- let _options : base.WebApiRequestOptions = null;
465
- const first : any = applicationName;
466
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
467
- {
468
- _request = applicationName as carriers.ForeignSystem_AddDeviceByIdentifierRequest;
469
- _options = deviceName as base.WebApiRequestOptions;
470
- }
471
- else
472
- {
473
- _request = {
474
- applicationName: applicationName as string,
475
- deviceName: deviceName as string,
476
- deviceIdentifier: deviceIdentifier as string,
477
- };
478
- _options = webapi_options;
479
- }
480
- return this._addDeviceByIdentifierAsync( _request, _options );
481
- }
482
-
483
-
484
- private async _saveDeviceByIdentifierAsync(request: carriers.ForeignSystem_SaveDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
485
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
486
- base.WebApiBase.SetPending(options);
487
- return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
488
- try {
489
- config.baseURL = this._options.baseUrl;
490
- const response = await this._axios.post("SaveDeviceByIdentifier", request , config);
491
- base.WebApiBase.SetCompleted(options, response);
492
- const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
493
- resolve(res);
494
- }
495
- catch( err ) {
496
- base.WebApiBase.HandleError(options, config, err);
497
- reject(err);
498
- }
499
- });
500
- }
501
-
502
-
503
-
504
- /**
505
- * Updates a ForeignDevice with deviceName that belongs to the application with applicationName.
506
- * @param request - ApplicationName, DeviceName, DeviceIdentifier, ForeignDevice
507
- * @returns The ForeignDevice.
508
- */
509
- public async saveDeviceByIdentifierAsync(request: carriers.ForeignSystem_SaveDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
510
-
511
- /**
512
- * Updates a ForeignDevice with deviceName that belongs to the application with applicationName.
513
- * @param applicationName - The name of the foreign application.
514
- * @param deviceName - The name of the foreign device.
515
- * @param deviceIdentifier - Unique id of device (Palm pilot device ID, version number, etc)
516
- * @param foreignDevice - Foreign device to save. Can be null if adding new device.
517
- * @returns The ForeignDevice.
518
- */
519
- public async saveDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, foreignDevice: carriers.ForeignDevice, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
520
-
521
- public async saveDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_SaveDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, foreignDevice?:carriers.ForeignDevice, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
522
- let _request : carriers.ForeignSystem_SaveDeviceByIdentifierRequest = null;
523
- let _options : base.WebApiRequestOptions = null;
524
- const first : any = applicationName;
525
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.foreignDevice)!='undefined' ) )
526
- {
527
- _request = applicationName as carriers.ForeignSystem_SaveDeviceByIdentifierRequest;
528
- _options = deviceName as base.WebApiRequestOptions;
529
- }
530
- else
531
- {
532
- _request = {
533
- applicationName: applicationName as string,
534
- deviceName: deviceName as string,
535
- deviceIdentifier: deviceIdentifier as string,
536
- foreignDevice: foreignDevice as carriers.ForeignDevice,
537
- };
538
- _options = webapi_options;
539
- }
540
- return this._saveDeviceByIdentifierAsync( _request, _options );
541
- }
542
-
543
-
544
- private async _deleteDeviceByIdentifierAsync(request: carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< void > {
545
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
546
- base.WebApiBase.SetPending(options);
547
- return new Promise< void >(async (resolve, reject) => {
548
- try {
549
- config.baseURL = this._options.baseUrl;
550
- const response = await this._axios.post("DeleteDeviceByIdentifier", request , config);
551
- base.WebApiBase.SetCompleted(options, response);
552
- const res = response.data;
553
- resolve(res);
554
- }
555
- catch( err ) {
556
- base.WebApiBase.HandleError(options, config, err);
557
- reject(err);
558
- }
559
- });
560
- }
561
-
562
-
563
-
564
- /**
565
- * Delete a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
566
- * @param request - ApplicationName, DeviceName, DeviceIdentifier
567
- * @returns This method has no return value
568
- */
569
- public async deleteDeviceByIdentifierAsync(request: carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
570
-
571
- /**
572
- * Delete a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
573
- * @param applicationName - The name of the foreign application.
574
- * @param deviceName - The name of the foreign device.
575
- * @param deviceIdentifier - Unique id of device (Palm pilot device ID, version number, etc)
576
- * @returns This method has no return value
577
- */
578
- public async deleteDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
579
-
580
- public async deleteDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
581
- let _request : carriers.ForeignSystem_DeleteDeviceByIdentifierRequest = null;
582
- let _options : base.WebApiRequestOptions = null;
583
- const first : any = applicationName;
584
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
585
- {
586
- _request = applicationName as carriers.ForeignSystem_DeleteDeviceByIdentifierRequest;
587
- _options = deviceName as base.WebApiRequestOptions;
588
- }
589
- else
590
- {
591
- _request = {
592
- applicationName: applicationName as string,
593
- deviceName: deviceName as string,
594
- deviceIdentifier: deviceIdentifier as string,
595
- };
596
- _options = webapi_options;
597
- }
598
- return this._deleteDeviceByIdentifierAsync( _request, _options );
599
- }
600
-
601
-
602
- private async _getKeyAsync(request: carriers.ForeignSystem_GetKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
603
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
604
- base.WebApiBase.SetPending(options);
605
- return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
606
- try {
607
- config.baseURL = this._options.baseUrl;
608
- const response = await this._axios.post("GetKey", request , config);
609
- base.WebApiBase.SetCompleted(options, response);
610
- const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
611
- resolve(res);
612
- }
613
- catch( err ) {
614
- base.WebApiBase.HandleError(options, config, err);
615
- reject(err);
616
- }
617
- });
618
- }
619
-
620
-
621
-
622
- /**
623
- * Returning a foreign key by its key name, that belongs to the specified device and application. A table name and record ID can also be specified.
624
- * @param request - ApplicationName, DeviceName, KeyName, TableName, RecordId
625
- * @returns The ForeignKey.
626
- */
627
- public async getKeyAsync(request: carriers.ForeignSystem_GetKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
628
-
629
- /**
630
- * Returning a foreign key by its key name, that belongs to the specified device and application. A table name and record ID can also be specified.
631
- * @param applicationName - The name of the foreign application.
632
- * @param deviceName - The name of the foreign device.
633
- * @param keyName - The name of the foreign key.
634
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
635
- * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
636
- * @returns The ForeignKey.
637
- */
638
- public async getKeyAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
639
-
640
- public async getKeyAsync(applicationName:string|carriers.ForeignSystem_GetKeyRequest, deviceName?:string|base.WebApiRequestOptions, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
641
- let _request : carriers.ForeignSystem_GetKeyRequest = null;
642
- let _options : base.WebApiRequestOptions = null;
643
- const first : any = applicationName;
644
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
645
- {
646
- _request = applicationName as carriers.ForeignSystem_GetKeyRequest;
647
- _options = deviceName as base.WebApiRequestOptions;
648
- }
649
- else
650
- {
651
- _request = {
652
- applicationName: applicationName as string,
653
- deviceName: deviceName as string,
654
- keyName: keyName as string,
655
- tableName: tableName as string,
656
- recordId: recordId as number,
657
- };
658
- _options = webapi_options;
659
- }
660
- return this._getKeyAsync( _request, _options );
661
- }
662
-
663
-
664
- private async _getKeyValueAsync(request: carriers.ForeignSystem_GetKeyValueRequest, options?:base.WebApiRequestOptions) : Promise< string > {
665
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
666
- base.WebApiBase.SetPending(options);
667
- return new Promise< string >(async (resolve, reject) => {
668
- try {
669
- config.baseURL = this._options.baseUrl;
670
- const response = await this._axios.post("GetKeyValue", request , config);
671
- base.WebApiBase.SetCompleted(options, response);
672
- const res : string = response.data as string;
673
- resolve(res);
674
- }
675
- catch( err ) {
676
- base.WebApiBase.HandleError(options, config, err);
677
- reject(err);
678
- }
679
- });
680
- }
681
-
682
-
683
-
684
- /**
685
- * Gets the string value of a ForeignKey, that belongs to the specified device and application. The table name and record ID must also be specified.
686
- * @param request - ApplicationName, DeviceName, KeyName, TableName, RecordId
687
- * @returns The ForeignKey value as string.
688
- */
689
- public async getKeyValueAsync(request: carriers.ForeignSystem_GetKeyValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
690
-
691
- /**
692
- * Gets the string value of a ForeignKey, that belongs to the specified device and application. The table name and record ID must also be specified.
693
- * @param applicationName - The name of the foreign application.
694
- * @param deviceName - The name of the foreign device.
695
- * @param keyName - The name of the foreign key.
696
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
697
- * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
698
- * @returns The ForeignKey value as string.
699
- */
700
- public async getKeyValueAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
701
-
702
- public async getKeyValueAsync(applicationName:string|carriers.ForeignSystem_GetKeyValueRequest, deviceName?:string|base.WebApiRequestOptions, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
703
- let _request : carriers.ForeignSystem_GetKeyValueRequest = null;
704
- let _options : base.WebApiRequestOptions = null;
705
- const first : any = applicationName;
706
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
707
- {
708
- _request = applicationName as carriers.ForeignSystem_GetKeyValueRequest;
709
- _options = deviceName as base.WebApiRequestOptions;
710
- }
711
- else
712
- {
713
- _request = {
714
- applicationName: applicationName as string,
715
- deviceName: deviceName as string,
716
- keyName: keyName as string,
717
- tableName: tableName as string,
718
- recordId: recordId as number,
719
- };
720
- _options = webapi_options;
721
- }
722
- return this._getKeyValueAsync( _request, _options );
723
- }
724
-
725
-
726
- private async _getKeyOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
727
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
728
- base.WebApiBase.SetPending(options);
729
- return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
730
- try {
731
- config.baseURL = this._options.baseUrl;
732
- const response = await this._axios.post("GetKeyOnDeviceIdentifier", request , config);
733
- base.WebApiBase.SetCompleted(options, response);
734
- const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
735
- resolve(res);
736
- }
737
- catch( err ) {
738
- base.WebApiBase.HandleError(options, config, err);
739
- reject(err);
740
- }
741
- });
742
- }
743
-
744
-
745
-
746
- /**
747
- * Returning a foreign key by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
748
- * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, TableName, RecordId
749
- * @returns The ForeignKey.
750
- */
751
- public async getKeyOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
752
-
753
- /**
754
- * Returning a foreign key by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
755
- * @param applicationName - The name of the foreign application.
756
- * @param deviceName - The name of the foreign device.
757
- * @param deviceIdentifier - The device identifier.
758
- * @param keyName - The name of the foreign key.
759
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
760
- * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
761
- * @returns The ForeignKey.
762
- */
763
- public async getKeyOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
764
-
765
- public async getKeyOnDeviceIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
766
- let _request : carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest = null;
767
- let _options : base.WebApiRequestOptions = null;
768
- const first : any = applicationName;
769
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
770
- {
771
- _request = applicationName as carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest;
772
- _options = deviceName as base.WebApiRequestOptions;
773
- }
774
- else
775
- {
776
- _request = {
777
- applicationName: applicationName as string,
778
- deviceName: deviceName as string,
779
- deviceIdentifier: deviceIdentifier as string,
780
- keyName: keyName as string,
781
- tableName: tableName as string,
782
- recordId: recordId as number,
783
- };
784
- _options = webapi_options;
785
- }
786
- return this._getKeyOnDeviceIdentifierAsync( _request, _options );
787
- }
788
-
789
-
790
- private async _getKeyValueOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< string > {
791
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
792
- base.WebApiBase.SetPending(options);
793
- return new Promise< string >(async (resolve, reject) => {
794
- try {
795
- config.baseURL = this._options.baseUrl;
796
- const response = await this._axios.post("GetKeyValueOnDeviceIdentifier", request , config);
797
- base.WebApiBase.SetCompleted(options, response);
798
- const res : string = response.data as string;
799
- resolve(res);
800
- }
801
- catch( err ) {
802
- base.WebApiBase.HandleError(options, config, err);
803
- reject(err);
804
- }
805
- });
806
- }
807
-
808
-
809
-
810
- /**
811
- * Returning a foreign key string value by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
812
- * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, TableName, RecordId
813
- * @returns The ForeignKey's string value.
814
- */
815
- public async getKeyValueOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
816
-
817
- /**
818
- * Returning a foreign key string value by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
819
- * @param applicationName - The name of the foreign application.
820
- * @param deviceName - The name of the foreign device.
821
- * @param deviceIdentifier - The device identifier.
822
- * @param keyName - The name of the foreign key.
823
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
824
- * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
825
- * @returns The ForeignKey's string value.
826
- */
827
- public async getKeyValueOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
828
-
829
- public async getKeyValueOnDeviceIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
830
- let _request : carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest = null;
831
- let _options : base.WebApiRequestOptions = null;
832
- const first : any = applicationName;
833
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
834
- {
835
- _request = applicationName as carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest;
836
- _options = deviceName as base.WebApiRequestOptions;
837
- }
838
- else
839
- {
840
- _request = {
841
- applicationName: applicationName as string,
842
- deviceName: deviceName as string,
843
- deviceIdentifier: deviceIdentifier as string,
844
- keyName: keyName as string,
845
- tableName: tableName as string,
846
- recordId: recordId as number,
847
- };
848
- _options = webapi_options;
849
- }
850
- return this._getKeyValueOnDeviceIdentifierAsync( _request, _options );
851
- }
852
-
853
-
854
- private async _addForeignKeyAsync(request: carriers.ForeignSystem_AddForeignKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
855
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
856
- base.WebApiBase.SetPending(options);
857
- return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
858
- try {
859
- config.baseURL = this._options.baseUrl;
860
- const response = await this._axios.post("AddForeignKey", request , config);
861
- base.WebApiBase.SetCompleted(options, response);
862
- const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
863
- resolve(res);
864
- }
865
- catch( err ) {
866
- base.WebApiBase.HandleError(options, config, err);
867
- reject(err);
868
- }
869
- });
870
- }
871
-
872
-
873
-
874
- /**
875
- * Add a new key belonging to the ForeignApp and ForeignDevice specified.
876
- * @param request - ForeignKey, ApplicationName, DeviceName, DeviceIdentifier
877
- * @returns The new or updated ForeignKey
878
- */
879
- public async addForeignKeyAsync(request: carriers.ForeignSystem_AddForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
880
-
881
- /**
882
- * Add a new key belonging to the ForeignApp and ForeignDevice specified.
883
- * @param foreignKey - Foreign key to save
884
- * @param applicationName - The name of the foreign application.
885
- * @param deviceName - The name of the foreign device.
886
- * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
887
- * @returns The new or updated ForeignKey
888
- */
889
- public async addForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
890
-
891
- public async addForeignKeyAsync(foreignKey:carriers.ForeignKey|carriers.ForeignSystem_AddForeignKeyRequest, applicationName?:string|base.WebApiRequestOptions, deviceName?:string, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
892
- let _request : carriers.ForeignSystem_AddForeignKeyRequest = null;
893
- let _options : base.WebApiRequestOptions = null;
894
- const first : any = foreignKey;
895
- if( typeof( first ) === "object" && first && ( typeof(first.foreignKey)!='undefined' || typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
896
- {
897
- _request = foreignKey as carriers.ForeignSystem_AddForeignKeyRequest;
898
- _options = applicationName as base.WebApiRequestOptions;
899
- }
900
- else
901
- {
902
- _request = {
903
- foreignKey: foreignKey as carriers.ForeignKey,
904
- applicationName: applicationName as string,
905
- deviceName: deviceName as string,
906
- deviceIdentifier: deviceIdentifier as string,
907
- };
908
- _options = webapi_options;
909
- }
910
- return this._addForeignKeyAsync( _request, _options );
911
- }
912
-
913
-
914
- private async _saveForeignKeyAsync(request: carriers.ForeignSystem_SaveForeignKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
915
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
916
- base.WebApiBase.SetPending(options);
917
- return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
918
- try {
919
- config.baseURL = this._options.baseUrl;
920
- const response = await this._axios.post("SaveForeignKey", request , config);
921
- base.WebApiBase.SetCompleted(options, response);
922
- const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
923
- resolve(res);
924
- }
925
- catch( err ) {
926
- base.WebApiBase.HandleError(options, config, err);
927
- reject(err);
928
- }
929
- });
930
- }
931
-
932
-
933
-
934
- /**
935
- * Saves a key belonging to the ForeignApp and ForeignDevice specified.
936
- * @param request - ForeignKey, ApplicationName, DeviceName, DeviceIdentifier
937
- * @returns The new or updated ForeignKey
938
- */
939
- public async saveForeignKeyAsync(request: carriers.ForeignSystem_SaveForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
940
-
941
- /**
942
- * Saves a key belonging to the ForeignApp and ForeignDevice specified.
943
- * @param foreignKey - Foreign key to save
944
- * @param applicationName - The name of the foreign application.
945
- * @param deviceName - The name of the foreign device.
946
- * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
947
- * @returns The new or updated ForeignKey
948
- */
949
- public async saveForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
950
-
951
- public async saveForeignKeyAsync(foreignKey:carriers.ForeignKey|carriers.ForeignSystem_SaveForeignKeyRequest, applicationName?:string|base.WebApiRequestOptions, deviceName?:string, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
952
- let _request : carriers.ForeignSystem_SaveForeignKeyRequest = null;
953
- let _options : base.WebApiRequestOptions = null;
954
- const first : any = foreignKey;
955
- if( typeof( first ) === "object" && first && ( typeof(first.foreignKey)!='undefined' || typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
956
- {
957
- _request = foreignKey as carriers.ForeignSystem_SaveForeignKeyRequest;
958
- _options = applicationName as base.WebApiRequestOptions;
959
- }
960
- else
961
- {
962
- _request = {
963
- foreignKey: foreignKey as carriers.ForeignKey,
964
- applicationName: applicationName as string,
965
- deviceName: deviceName as string,
966
- deviceIdentifier: deviceIdentifier as string,
967
- };
968
- _options = webapi_options;
969
- }
970
- return this._saveForeignKeyAsync( _request, _options );
971
- }
972
-
973
-
974
- private async _deleteForeignKeyOnNameAsync(request: carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, options?:base.WebApiRequestOptions) : Promise< void > {
975
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
976
- base.WebApiBase.SetPending(options);
977
- return new Promise< void >(async (resolve, reject) => {
978
- try {
979
- config.baseURL = this._options.baseUrl;
980
- const response = await this._axios.post("DeleteForeignKeyOnName", request , config);
981
- base.WebApiBase.SetCompleted(options, response);
982
- const res = response.data;
983
- resolve(res);
984
- }
985
- catch( err ) {
986
- base.WebApiBase.HandleError(options, config, err);
987
- reject(err);
988
- }
989
- });
990
- }
991
-
992
-
993
-
994
- /**
995
- * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
996
- * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, TableName, RecordId
997
- * @returns This method has no return value
998
- */
999
- public async deleteForeignKeyOnNameAsync(request: carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1000
-
1001
- /**
1002
- * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
1003
- * @param applicationName - The name of the foreign application.
1004
- * @param deviceName - The name of the foreign device.
1005
- * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
1006
- * @param keyName - The name of the foreign key to delete.
1007
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to delete ALL keys that otherwise match; this may be dangerous and can take a long time if there are many items to delete.
1008
- * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.<p/>Specifying a zero recordId will remove the recordId restriction and delete all keys that otherwise match.
1009
- * @returns This method has no return value
1010
- */
1011
- public async deleteForeignKeyOnNameAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1012
-
1013
- public async deleteForeignKeyOnNameAsync(applicationName:string|carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1014
- let _request : carriers.ForeignSystem_DeleteForeignKeyOnNameRequest = null;
1015
- let _options : base.WebApiRequestOptions = null;
1016
- const first : any = applicationName;
1017
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
1018
- {
1019
- _request = applicationName as carriers.ForeignSystem_DeleteForeignKeyOnNameRequest;
1020
- _options = deviceName as base.WebApiRequestOptions;
1021
- }
1022
- else
1023
- {
1024
- _request = {
1025
- applicationName: applicationName as string,
1026
- deviceName: deviceName as string,
1027
- deviceIdentifier: deviceIdentifier as string,
1028
- keyName: keyName as string,
1029
- tableName: tableName as string,
1030
- recordId: recordId as number,
1031
- };
1032
- _options = webapi_options;
1033
- }
1034
- return this._deleteForeignKeyOnNameAsync( _request, _options );
1035
- }
1036
-
1037
-
1038
- private async _getKeyByValueAsync(request: carriers.ForeignSystem_GetKeyByValueRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1039
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1040
- base.WebApiBase.SetPending(options);
1041
- return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
1042
- try {
1043
- config.baseURL = this._options.baseUrl;
1044
- const response = await this._axios.post("GetKeyByValue", request , config);
1045
- base.WebApiBase.SetCompleted(options, response);
1046
- const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
1047
- resolve(res);
1048
- }
1049
- catch( err ) {
1050
- base.WebApiBase.HandleError(options, config, err);
1051
- reject(err);
1052
- }
1053
- });
1054
- }
1055
-
1056
-
1057
-
1058
- /**
1059
- * Get a foreignkey based on its name and value, that belongs to the specified device and application.
1060
- * @param request - ApplicationName, DeviceName, KeyName, KeyValue, TableName
1061
- * @returns The ForeignKey.
1062
- */
1063
- public async getKeyByValueAsync(request: carriers.ForeignSystem_GetKeyByValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1064
-
1065
- /**
1066
- * Get a foreignkey based on its name and value, that belongs to the specified device and application.
1067
- * @param applicationName - The name of the foreign application.
1068
- * @param deviceName - The name of the foreign device.
1069
- * @param keyName - The name of the foreign key.
1070
- * @param keyValue - Foreignkey value
1071
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1072
- * @returns The ForeignKey.
1073
- */
1074
- public async getKeyByValueAsync(applicationName: string, deviceName: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1075
-
1076
- public async getKeyByValueAsync(applicationName:string|carriers.ForeignSystem_GetKeyByValueRequest, deviceName?:string|base.WebApiRequestOptions, keyName?:string, keyValue?:string, tableName?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1077
- let _request : carriers.ForeignSystem_GetKeyByValueRequest = null;
1078
- let _options : base.WebApiRequestOptions = null;
1079
- const first : any = applicationName;
1080
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.keyValue)!='undefined' || typeof(first.tableName)!='undefined' ) )
1081
- {
1082
- _request = applicationName as carriers.ForeignSystem_GetKeyByValueRequest;
1083
- _options = deviceName as base.WebApiRequestOptions;
1084
- }
1085
- else
1086
- {
1087
- _request = {
1088
- applicationName: applicationName as string,
1089
- deviceName: deviceName as string,
1090
- keyName: keyName as string,
1091
- keyValue: keyValue as string,
1092
- tableName: tableName as string,
1093
- };
1094
- _options = webapi_options;
1095
- }
1096
- return this._getKeyByValueAsync( _request, _options );
1097
- }
1098
-
1099
-
1100
- private async _getKeyByValueAndIdentifierAsync(request: carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1101
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1102
- base.WebApiBase.SetPending(options);
1103
- return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
1104
- try {
1105
- config.baseURL = this._options.baseUrl;
1106
- const response = await this._axios.post("GetKeyByValueAndIdentifier", request , config);
1107
- base.WebApiBase.SetCompleted(options, response);
1108
- const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
1109
- resolve(res);
1110
- }
1111
- catch( err ) {
1112
- base.WebApiBase.HandleError(options, config, err);
1113
- reject(err);
1114
- }
1115
- });
1116
- }
1117
-
1118
-
1119
-
1120
- /**
1121
- * Get a foreignkey based on its name and value, that belongs to the specified deviceId, device, and application.
1122
- * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, KeyValue, TableName
1123
- * @returns The ForeignKey.
1124
- */
1125
- public async getKeyByValueAndIdentifierAsync(request: carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1126
-
1127
- /**
1128
- * Get a foreignkey based on its name and value, that belongs to the specified deviceId, device, and application.
1129
- * @param applicationName - The name of the foreign application.
1130
- * @param deviceName - The name of the foreign device.
1131
- * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
1132
- * @param keyName - The name of the foreign key.
1133
- * @param keyValue - Foreignkey value
1134
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1135
- * @returns The ForeignKey.
1136
- */
1137
- public async getKeyByValueAndIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1138
-
1139
- public async getKeyByValueAndIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, keyValue?:string, tableName?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1140
- let _request : carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest = null;
1141
- let _options : base.WebApiRequestOptions = null;
1142
- const first : any = applicationName;
1143
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.keyValue)!='undefined' || typeof(first.tableName)!='undefined' ) )
1144
- {
1145
- _request = applicationName as carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest;
1146
- _options = deviceName as base.WebApiRequestOptions;
1147
- }
1148
- else
1149
- {
1150
- _request = {
1151
- applicationName: applicationName as string,
1152
- deviceName: deviceName as string,
1153
- deviceIdentifier: deviceIdentifier as string,
1154
- keyName: keyName as string,
1155
- keyValue: keyValue as string,
1156
- tableName: tableName as string,
1157
- };
1158
- _options = webapi_options;
1159
- }
1160
- return this._getKeyByValueAndIdentifierAsync( _request, _options );
1161
- }
1162
-
1163
-
1164
- private async _getAllForeignKeysOnEntityAsync(request: carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
1165
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1166
- base.WebApiBase.SetPending(options);
1167
- return new Promise< carriers.StringDictionary >(async (resolve, reject) => {
1168
- try {
1169
- config.baseURL = this._options.baseUrl;
1170
- const response = await this._axios.post("GetAllForeignKeysOnEntity", request , config);
1171
- base.WebApiBase.SetCompleted(options, response);
1172
- const res : carriers.StringDictionary = converters.Create_StringDictionary_From( response.data );
1173
- resolve(res);
1174
- }
1175
- catch( err ) {
1176
- base.WebApiBase.HandleError(options, config, err);
1177
- reject(err);
1178
- }
1179
- });
1180
- }
1181
-
1182
-
1183
-
1184
- /**
1185
- * Get a list of foreignkeys (&apos;app.device.key&apos;) and their values (&apos;123&apos;) that belong to the specified entity.
1186
- * @param request - EntityType, EntityId
1187
- * @returns Dictionary of 'appname.deviceid.keyname' = '123' key values
1188
- */
1189
- public async getAllForeignKeysOnEntityAsync(request: carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
1190
-
1191
- /**
1192
- * Get a list of foreignkeys (&apos;app.device.key&apos;) and their values (&apos;123&apos;) that belong to the specified entity.
1193
- * @param entityType - Entity type (table name): 'contact', 'project' etc.
1194
- * @param entityId - Primary key of Entity
1195
- * @returns Dictionary of 'appname.deviceid.keyname' = '123' key values
1196
- */
1197
- public async getAllForeignKeysOnEntityAsync(entityType: string, entityId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
1198
-
1199
- public async getAllForeignKeysOnEntityAsync(entityType:string|carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, entityId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
1200
- let _request : carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest = null;
1201
- let _options : base.WebApiRequestOptions = null;
1202
- const first : any = entityType;
1203
- if( typeof( first ) === "object" && first && ( typeof(first.entityType)!='undefined' || typeof(first.entityId)!='undefined' ) )
1204
- {
1205
- _request = entityType as carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest;
1206
- _options = entityId as base.WebApiRequestOptions;
1207
- }
1208
- else
1209
- {
1210
- _request = {
1211
- entityType: entityType as string,
1212
- entityId: entityId as number,
1213
- };
1214
- _options = webapi_options;
1215
- }
1216
- return this._getAllForeignKeysOnEntityAsync( _request, _options );
1217
- }
1218
-
1219
- /**
1220
- * Gets a ForeignDevice object.
1221
- * @param foreignDeviceId - The primary key.
1222
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
1223
- * @returns A single ForeignDevice
1224
- */
1225
- public async getForeignDeviceAsync(foreignDeviceId: number, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
1226
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1227
- base.WebApiBase.SetPending(options);
1228
- return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
1229
- try {
1230
- const response = await this._axios.post("GetForeignDevice?foreignDeviceId=" + foreignDeviceId, null, config);
1231
- base.WebApiBase.SetCompleted(options, response);
1232
- const res = converters.Create_ForeignDevice_From( response.data );
1233
- resolve(res);
1234
- }
1235
- catch( err ) {
1236
- base.WebApiBase.HandleError(options, config, err);
1237
- reject(err);
1238
- }
1239
- });
1240
- }
1241
-
1242
-
1243
- private async _saveForeignDeviceAsync(request: carriers.ForeignSystem_SaveForeignDeviceRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
1244
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1245
- base.WebApiBase.SetPending(options);
1246
- return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
1247
- try {
1248
- config.baseURL = this._options.baseUrl;
1249
- const response = await this._axios.post("SaveForeignDevice", request , config);
1250
- base.WebApiBase.SetCompleted(options, response);
1251
- const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
1252
- resolve(res);
1253
- }
1254
- catch( err ) {
1255
- base.WebApiBase.HandleError(options, config, err);
1256
- reject(err);
1257
- }
1258
- });
1259
- }
1260
-
1261
-
1262
-
1263
- /**
1264
- * Saves a foreign device for an foreign application
1265
- * @param request - ForeignDevice, ApplicationName
1266
- * @returns Returns the saved foreign device
1267
- */
1268
- public async saveForeignDeviceAsync(request: carriers.ForeignSystem_SaveForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
1269
-
1270
- /**
1271
- * Saves a foreign device for an foreign application
1272
- * @param foreignDevice - Foreign device to save
1273
- * @param applicationName - The name of the foreign application.
1274
- * @returns Returns the saved foreign device
1275
- */
1276
- public async saveForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
1277
-
1278
- public async saveForeignDeviceAsync(foreignDevice:carriers.ForeignDevice|carriers.ForeignSystem_SaveForeignDeviceRequest, applicationName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
1279
- let _request : carriers.ForeignSystem_SaveForeignDeviceRequest = null;
1280
- let _options : base.WebApiRequestOptions = null;
1281
- const first : any = foreignDevice;
1282
- if( typeof( first ) === "object" && first && ( typeof(first.foreignDevice)!='undefined' || typeof(first.applicationName)!='undefined' ) )
1283
- {
1284
- _request = foreignDevice as carriers.ForeignSystem_SaveForeignDeviceRequest;
1285
- _options = applicationName as base.WebApiRequestOptions;
1286
- }
1287
- else
1288
- {
1289
- _request = {
1290
- foreignDevice: foreignDevice as carriers.ForeignDevice,
1291
- applicationName: applicationName as string,
1292
- };
1293
- _options = webapi_options;
1294
- }
1295
- return this._saveForeignDeviceAsync( _request, _options );
1296
- }
1297
-
1298
-
1299
- private async _deleteForeignDeviceAsync(request: carriers.ForeignSystem_DeleteForeignDeviceRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1300
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1301
- base.WebApiBase.SetPending(options);
1302
- return new Promise< void >(async (resolve, reject) => {
1303
- try {
1304
- config.baseURL = this._options.baseUrl;
1305
- const response = await this._axios.post("DeleteForeignDevice", request , config);
1306
- base.WebApiBase.SetCompleted(options, response);
1307
- const res = response.data;
1308
- resolve(res);
1309
- }
1310
- catch( err ) {
1311
- base.WebApiBase.HandleError(options, config, err);
1312
- reject(err);
1313
- }
1314
- });
1315
- }
1316
-
1317
-
1318
-
1319
- /**
1320
- * Deletes a foreign device from an application
1321
- * @param request - ForeignDevice, ApplicationName
1322
- * @returns
1323
- */
1324
- public async deleteForeignDeviceAsync(request: carriers.ForeignSystem_DeleteForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1325
-
1326
- /**
1327
- * Deletes a foreign device from an application
1328
- * @param foreignDevice - foreign device to delete
1329
- * @param applicationName - Name of application to delete from
1330
- * @returns
1331
- */
1332
- public async deleteForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1333
-
1334
- public async deleteForeignDeviceAsync(foreignDevice:carriers.ForeignDevice|carriers.ForeignSystem_DeleteForeignDeviceRequest, applicationName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1335
- let _request : carriers.ForeignSystem_DeleteForeignDeviceRequest = null;
1336
- let _options : base.WebApiRequestOptions = null;
1337
- const first : any = foreignDevice;
1338
- if( typeof( first ) === "object" && first && ( typeof(first.foreignDevice)!='undefined' || typeof(first.applicationName)!='undefined' ) )
1339
- {
1340
- _request = foreignDevice as carriers.ForeignSystem_DeleteForeignDeviceRequest;
1341
- _options = applicationName as base.WebApiRequestOptions;
1342
- }
1343
- else
1344
- {
1345
- _request = {
1346
- foreignDevice: foreignDevice as carriers.ForeignDevice,
1347
- applicationName: applicationName as string,
1348
- };
1349
- _options = webapi_options;
1350
- }
1351
- return this._deleteForeignDeviceAsync( _request, _options );
1352
- }
1353
-
1354
-
1355
- private async _deleteForeignKeyAsync(request: carriers.ForeignSystem_DeleteForeignKeyRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1356
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1357
- base.WebApiBase.SetPending(options);
1358
- return new Promise< void >(async (resolve, reject) => {
1359
- try {
1360
- config.baseURL = this._options.baseUrl;
1361
- const response = await this._axios.post("DeleteForeignKey", request , config);
1362
- base.WebApiBase.SetCompleted(options, response);
1363
- const res = response.data;
1364
- resolve(res);
1365
- }
1366
- catch( err ) {
1367
- base.WebApiBase.HandleError(options, config, err);
1368
- reject(err);
1369
- }
1370
- });
1371
- }
1372
-
1373
-
1374
-
1375
- /**
1376
- * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
1377
- * @param request - ForeignKey, ApplicationName, DeviceName, DeviceIdentifier, TableName, RecordId
1378
- * @returns This method has no return value
1379
- */
1380
- public async deleteForeignKeyAsync(request: carriers.ForeignSystem_DeleteForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1381
-
1382
- /**
1383
- * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
1384
- * @param foreignKey - Key name to delete.
1385
- * @param applicationName - The name of the foreign application.
1386
- * @param deviceName - The name of the foreign device.
1387
- * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
1388
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to delete ALL keys that otherwise match; this may be dangerous and can take a long time if there are many items to delete.
1389
- * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.<p/>Specifying a zero recordId will remove the recordId restriction and delete all keys that otherwise match.
1390
- * @returns This method has no return value
1391
- */
1392
- public async deleteForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1393
-
1394
- public async deleteForeignKeyAsync(foreignKey:carriers.ForeignKey|carriers.ForeignSystem_DeleteForeignKeyRequest, applicationName?:string|base.WebApiRequestOptions, deviceName?:string, deviceIdentifier?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1395
- let _request : carriers.ForeignSystem_DeleteForeignKeyRequest = null;
1396
- let _options : base.WebApiRequestOptions = null;
1397
- const first : any = foreignKey;
1398
- if( typeof( first ) === "object" && first && ( typeof(first.foreignKey)!='undefined' || typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
1399
- {
1400
- _request = foreignKey as carriers.ForeignSystem_DeleteForeignKeyRequest;
1401
- _options = applicationName as base.WebApiRequestOptions;
1402
- }
1403
- else
1404
- {
1405
- _request = {
1406
- foreignKey: foreignKey as carriers.ForeignKey,
1407
- applicationName: applicationName as string,
1408
- deviceName: deviceName as string,
1409
- deviceIdentifier: deviceIdentifier as string,
1410
- tableName: tableName as string,
1411
- recordId: recordId as number,
1412
- };
1413
- _options = webapi_options;
1414
- }
1415
- return this._deleteForeignKeyAsync( _request, _options );
1416
- }
1417
-
1418
-
1419
- private async _getDeviceKeysAsync(request: carriers.ForeignSystem_GetDeviceKeysRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1420
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1421
- base.WebApiBase.SetPending(options);
1422
- return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1423
- try {
1424
- config.baseURL = this._options.baseUrl;
1425
- const response = await this._axios.post("GetDeviceKeys", request , config);
1426
- base.WebApiBase.SetCompleted(options, response);
1427
- const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1428
- resolve(res);
1429
- }
1430
- catch( err ) {
1431
- base.WebApiBase.HandleError(options, config, err);
1432
- reject(err);
1433
- }
1434
- });
1435
- }
1436
-
1437
-
1438
-
1439
- /**
1440
- * Returns all ForeignKeys that belong to a device.
1441
- * @param request - ApplicationName, DeviceName
1442
- * @returns Array of all ForeignKeys in the ForeignDevice.
1443
- */
1444
- public async getDeviceKeysAsync(request: carriers.ForeignSystem_GetDeviceKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1445
-
1446
- /**
1447
- * Returns all ForeignKeys that belong to a device.
1448
- * @param applicationName - The name of the foreign application.
1449
- * @param deviceName - The name of the foreign device.
1450
- * @returns Array of all ForeignKeys in the ForeignDevice.
1451
- */
1452
- public async getDeviceKeysAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1453
-
1454
- public async getDeviceKeysAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysRequest, deviceName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1455
- let _request : carriers.ForeignSystem_GetDeviceKeysRequest = null;
1456
- let _options : base.WebApiRequestOptions = null;
1457
- const first : any = applicationName;
1458
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' ) )
1459
- {
1460
- _request = applicationName as carriers.ForeignSystem_GetDeviceKeysRequest;
1461
- _options = deviceName as base.WebApiRequestOptions;
1462
- }
1463
- else
1464
- {
1465
- _request = {
1466
- applicationName: applicationName as string,
1467
- deviceName: deviceName as string,
1468
- };
1469
- _options = webapi_options;
1470
- }
1471
- return this._getDeviceKeysAsync( _request, _options );
1472
- }
1473
-
1474
-
1475
- private async _getApplicationKeysAsync(request: carriers.ForeignSystem_GetApplicationKeysRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1476
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1477
- base.WebApiBase.SetPending(options);
1478
- return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1479
- try {
1480
- config.baseURL = this._options.baseUrl;
1481
- const response = await this._axios.post("GetApplicationKeys", request , config);
1482
- base.WebApiBase.SetCompleted(options, response);
1483
- const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1484
- resolve(res);
1485
- }
1486
- catch( err ) {
1487
- base.WebApiBase.HandleError(options, config, err);
1488
- reject(err);
1489
- }
1490
- });
1491
- }
1492
-
1493
-
1494
-
1495
- /**
1496
- * Returns all ForeignKeys that belong to an application.
1497
- * @param request - ApplicationName
1498
- * @returns Array of all ForeignKeys in the ForeignApp.
1499
- */
1500
- public async getApplicationKeysAsync(request: carriers.ForeignSystem_GetApplicationKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1501
-
1502
- /**
1503
- * Returns all ForeignKeys that belong to an application.
1504
- * @param applicationName - The name of the foreign application.
1505
- * @returns Array of all ForeignKeys in the ForeignApp.
1506
- */
1507
- public async getApplicationKeysAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1508
-
1509
- public async getApplicationKeysAsync(applicationName:string|carriers.ForeignSystem_GetApplicationKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1510
- let _request : carriers.ForeignSystem_GetApplicationKeysRequest = null;
1511
- let _options : base.WebApiRequestOptions = null;
1512
- const first : any = applicationName;
1513
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' ) )
1514
- {
1515
- _request = applicationName as carriers.ForeignSystem_GetApplicationKeysRequest;
1516
- _options = webapi_options as base.WebApiRequestOptions;
1517
- }
1518
- else
1519
- {
1520
- _request = {
1521
- applicationName: applicationName as string,
1522
- };
1523
- _options = webapi_options;
1524
- }
1525
- return this._getApplicationKeysAsync( _request, _options );
1526
- }
1527
-
1528
-
1529
- private async _getDeviceKeysOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1530
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1531
- base.WebApiBase.SetPending(options);
1532
- return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1533
- try {
1534
- config.baseURL = this._options.baseUrl;
1535
- const response = await this._axios.post("GetDeviceKeysOnDeviceIdentifier", request , config);
1536
- base.WebApiBase.SetCompleted(options, response);
1537
- const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1538
- resolve(res);
1539
- }
1540
- catch( err ) {
1541
- base.WebApiBase.HandleError(options, config, err);
1542
- reject(err);
1543
- }
1544
- });
1545
- }
1546
-
1547
-
1548
-
1549
- /**
1550
- * Returns all ForeignKeys that belong to a device with a given deviceIdentifier.
1551
- * @param request - ApplicationName, DeviceName, DeviceIdentifier
1552
- * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1553
- */
1554
- public async getDeviceKeysOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1555
-
1556
- /**
1557
- * Returns all ForeignKeys that belong to a device with a given deviceIdentifier.
1558
- * @param applicationName - The name of the foreign application.
1559
- * @param deviceName - The name of the foreign device.
1560
- * @param deviceIdentifier - Identifier for a unique grouping of keys within a device.
1561
- * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1562
- */
1563
- public async getDeviceKeysOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1564
-
1565
- public async getDeviceKeysOnDeviceIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1566
- let _request : carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest = null;
1567
- let _options : base.WebApiRequestOptions = null;
1568
- const first : any = applicationName;
1569
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
1570
- {
1571
- _request = applicationName as carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest;
1572
- _options = deviceName as base.WebApiRequestOptions;
1573
- }
1574
- else
1575
- {
1576
- _request = {
1577
- applicationName: applicationName as string,
1578
- deviceName: deviceName as string,
1579
- deviceIdentifier: deviceIdentifier as string,
1580
- };
1581
- _options = webapi_options;
1582
- }
1583
- return this._getDeviceKeysOnDeviceIdentifierAsync( _request, _options );
1584
- }
1585
-
1586
-
1587
- private async _getDeviceKeysOnDeviceIdentifierTableAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1588
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1589
- base.WebApiBase.SetPending(options);
1590
- return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1591
- try {
1592
- config.baseURL = this._options.baseUrl;
1593
- const response = await this._axios.post("GetDeviceKeysOnDeviceIdentifierTable", request , config);
1594
- base.WebApiBase.SetCompleted(options, response);
1595
- const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1596
- resolve(res);
1597
- }
1598
- catch( err ) {
1599
- base.WebApiBase.HandleError(options, config, err);
1600
- reject(err);
1601
- }
1602
- });
1603
- }
1604
-
1605
-
1606
-
1607
- /**
1608
- * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name.
1609
- * @param request - ApplicationName, DeviceName, DeviceIdentifier, TableName
1610
- * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1611
- */
1612
- public async getDeviceKeysOnDeviceIdentifierTableAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1613
-
1614
- /**
1615
- * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name.
1616
- * @param applicationName - The name of the foreign application.
1617
- * @param deviceName - The name of the foreign device.
1618
- * @param deviceIdentifier - Identifier for a unique grouping of keys within a device.
1619
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1620
- * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1621
- */
1622
- public async getDeviceKeysOnDeviceIdentifierTableAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1623
-
1624
- public async getDeviceKeysOnDeviceIdentifierTableAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, tableName?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1625
- let _request : carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest = null;
1626
- let _options : base.WebApiRequestOptions = null;
1627
- const first : any = applicationName;
1628
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.tableName)!='undefined' ) )
1629
- {
1630
- _request = applicationName as carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest;
1631
- _options = deviceName as base.WebApiRequestOptions;
1632
- }
1633
- else
1634
- {
1635
- _request = {
1636
- applicationName: applicationName as string,
1637
- deviceName: deviceName as string,
1638
- deviceIdentifier: deviceIdentifier as string,
1639
- tableName: tableName as string,
1640
- };
1641
- _options = webapi_options;
1642
- }
1643
- return this._getDeviceKeysOnDeviceIdentifierTableAsync( _request, _options );
1644
- }
1645
-
1646
-
1647
- private async _getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1648
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1649
- base.WebApiBase.SetPending(options);
1650
- return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1651
- try {
1652
- config.baseURL = this._options.baseUrl;
1653
- const response = await this._axios.post("GetDeviceKeysOnDeviceIdentifierTableRecordId", request , config);
1654
- base.WebApiBase.SetCompleted(options, response);
1655
- const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1656
- resolve(res);
1657
- }
1658
- catch( err ) {
1659
- base.WebApiBase.HandleError(options, config, err);
1660
- reject(err);
1661
- }
1662
- });
1663
- }
1664
-
1665
-
1666
-
1667
- /**
1668
- * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name, as well as record id.
1669
- * @param request - ApplicationName, DeviceName, DeviceIdentifier, TableName, RecordId
1670
- * @returns Array of all ForeignKeys in the ForeignDevice that match the criteria
1671
- */
1672
- public async getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1673
-
1674
- /**
1675
- * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name, as well as record id.
1676
- * @param applicationName - The name of the foreign application.
1677
- * @param deviceName - The name of the foreign device.
1678
- * @param deviceIdentifier - Identifier for a unique grouping of keys within a device.
1679
- * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1680
- * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
1681
- * @returns Array of all ForeignKeys in the ForeignDevice that match the criteria
1682
- */
1683
- public async getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1684
-
1685
- public async getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1686
- let _request : carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest = null;
1687
- let _options : base.WebApiRequestOptions = null;
1688
- const first : any = applicationName;
1689
- if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
1690
- {
1691
- _request = applicationName as carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest;
1692
- _options = deviceName as base.WebApiRequestOptions;
1693
- }
1694
- else
1695
- {
1696
- _request = {
1697
- applicationName: applicationName as string,
1698
- deviceName: deviceName as string,
1699
- deviceIdentifier: deviceIdentifier as string,
1700
- tableName: tableName as string,
1701
- recordId: recordId as number,
1702
- };
1703
- _options = webapi_options;
1704
- }
1705
- return this._getDeviceKeysOnDeviceIdentifierTableRecordIdAsync( _request, _options );
1706
- }
1707
-
1708
- } // class v1ForeignSystemAgentController
1709
-
1710
-
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/ForeignSystemAgent.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
+ * Collection of all services that works with Foreign key data (Key/Value pairs)
28
+ */
29
+ export interface IForeignSystemAgent {
30
+ createDefaultForeignAppEntityAsync(): Promise< carriers.ForeignAppEntity >;
31
+ saveForeignAppEntityAsync(entity: carriers.ForeignAppEntity) : Promise< carriers.ForeignAppEntity >;
32
+ deleteForeignAppEntityAsync(ForeignAppEntityId: number) : Promise<void>;
33
+ getForeignAppEntityAsync(foreignAppEntityId: number) : Promise< carriers.ForeignAppEntity >;
34
+ getAppByNameAsync(request: carriers.ForeignSystem_GetAppByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
35
+ getAppByNameAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
36
+ getApplicationDevicesAsync(request: carriers.ForeignSystem_GetApplicationDevicesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
37
+ getApplicationDevicesAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
38
+ getDeviceByNameAsync(request: carriers.ForeignSystem_GetDeviceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
39
+ getDeviceByNameAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
40
+ getDeviceByIdentifierAsync(request: carriers.ForeignSystem_GetDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
41
+ getDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
42
+ addDeviceByIdentifierAsync(request: carriers.ForeignSystem_AddDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
43
+ addDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
44
+ saveDeviceByIdentifierAsync(request: carriers.ForeignSystem_SaveDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
45
+ saveDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, foreignDevice: carriers.ForeignDevice, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
46
+ deleteDeviceByIdentifierAsync(request: carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
47
+ deleteDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
48
+ getKeyAsync(request: carriers.ForeignSystem_GetKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
49
+ getKeyAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
50
+ getKeyValueAsync(request: carriers.ForeignSystem_GetKeyValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
51
+ getKeyValueAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
52
+ getKeyOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
53
+ getKeyOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
54
+ getKeyValueOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
55
+ getKeyValueOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
56
+ addForeignKeyAsync(request: carriers.ForeignSystem_AddForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
57
+ addForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
58
+ saveForeignKeyAsync(request: carriers.ForeignSystem_SaveForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
59
+ saveForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
60
+ deleteForeignKeyOnNameAsync(request: carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
61
+ deleteForeignKeyOnNameAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
62
+ getKeyByValueAsync(request: carriers.ForeignSystem_GetKeyByValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
63
+ getKeyByValueAsync(applicationName: string, deviceName: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
64
+ getKeyByValueAndIdentifierAsync(request: carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
65
+ getKeyByValueAndIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
66
+ getAllForeignKeysOnEntityAsync(request: carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
67
+ getAllForeignKeysOnEntityAsync(entityType: string, entityId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
68
+ getForeignDeviceAsync(foreignDeviceId: number) : Promise< carriers.ForeignDevice >;
69
+ saveForeignDeviceAsync(request: carriers.ForeignSystem_SaveForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
70
+ saveForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
71
+ deleteForeignDeviceAsync(request: carriers.ForeignSystem_DeleteForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
72
+ deleteForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
73
+ deleteForeignKeyAsync(request: carriers.ForeignSystem_DeleteForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
74
+ deleteForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
75
+ getDeviceKeysAsync(request: carriers.ForeignSystem_GetDeviceKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
76
+ getDeviceKeysAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
77
+ getApplicationKeysAsync(request: carriers.ForeignSystem_GetApplicationKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
78
+ getApplicationKeysAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
79
+ getDeviceKeysOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
80
+ getDeviceKeysOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
81
+ getDeviceKeysOnDeviceIdentifierTableAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
82
+ getDeviceKeysOnDeviceIdentifierTableAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
83
+ getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
84
+ getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
85
+ } // interface IForeignSystemAgent
86
+
87
+
88
+
89
+
90
+ /**
91
+ * Collection of all services that works with Foreign key data (Key/Value pairs)
92
+ */
93
+ export class ForeignSystemAgent extends base.WebApiBase implements IForeignSystemAgent {
94
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
95
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
96
+ constructor(baseUrl: string, resourceManager:any);
97
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
98
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
99
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
100
+ constructor(options: base.WebApiOptions);
101
+
102
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
103
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
104
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
105
+ cultureCode?: string,
106
+ ) {
107
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
108
+ options.basePath = "v1/Agents/ForeignSystem/";
109
+ super(options);
110
+ }
111
+
112
+
113
+
114
+ /**
115
+ * Set default values into a new ForeignAppEntity.
116
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
117
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
118
+ * @returns A blank entity.
119
+ */
120
+ public async createDefaultForeignAppEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
121
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
122
+ base.WebApiBase.SetPending(options);
123
+ return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
124
+ try {
125
+ const response = await this._axios.post("CreateDefaultForeignAppEntity", null, config);
126
+ base.WebApiBase.SetCompleted(options, response);
127
+ const res : carriers.ForeignAppEntity = converters.Create_ForeignAppEntity_From( response.data );
128
+ resolve(res);
129
+ }
130
+ catch( err ) {
131
+ base.WebApiBase.HandleError(options, config, err);
132
+ reject(err);
133
+ }
134
+ });
135
+ }
136
+ /**
137
+ * Replace the existing ForeignAppEntity or creates a new ForeignAppEntity if the id parameter is empty
138
+ * @param entity - The ForeignAppEntity to be saved.
139
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
140
+ * @returns New or updated ForeignAppEntity
141
+ */
142
+ public async saveForeignAppEntityAsync(entity: carriers.ForeignAppEntity, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
143
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
144
+ base.WebApiBase.SetPending(options);
145
+ return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
146
+ try {
147
+ const response = await this._axios.post("SaveForeignAppEntity", entity, config);
148
+ base.WebApiBase.SetCompleted(options, response);
149
+ const res : carriers.ForeignAppEntity = converters.Create_ForeignAppEntity_From( response.data );
150
+ resolve(res);
151
+ }
152
+ catch( err ) {
153
+ base.WebApiBase.HandleError(options, config, err);
154
+ reject(err);
155
+ }
156
+ });
157
+ }
158
+
159
+ /**
160
+ * Deletes the ForeignAppEntity
161
+ * @param ForeignAppEntityId - The id of the ForeignAppEntity to be deleted.
162
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
163
+ */
164
+ public async deleteForeignAppEntityAsync(ForeignAppEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
165
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
166
+ base.WebApiBase.SetPending(options);
167
+ return new Promise< void >(async (resolve, reject) => {
168
+ try {
169
+ const response = await this._axios.post("DeleteForeignAppEntity?ForeignAppEntityId=" + ForeignAppEntityId, null, config );
170
+ base.WebApiBase.SetCompleted(options, response);
171
+ const res = response.data;
172
+ resolve(res);
173
+ }
174
+ catch( err ) {
175
+ base.WebApiBase.HandleError(options, config, err);
176
+ reject(err);
177
+ }
178
+ });
179
+ }
180
+ /**
181
+ * Gets a ForeignAppEntity object.
182
+ * @param foreignAppEntityId - The primary key.
183
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
184
+ * @returns A single ForeignAppEntity
185
+ */
186
+ public async getForeignAppEntityAsync(foreignAppEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
187
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
188
+ base.WebApiBase.SetPending(options);
189
+ return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
190
+ try {
191
+ const response = await this._axios.post("GetForeignAppEntity?foreignAppEntityId=" + foreignAppEntityId, null, config);
192
+ base.WebApiBase.SetCompleted(options, response);
193
+ const res = converters.Create_ForeignAppEntity_From( response.data );
194
+ resolve(res);
195
+ }
196
+ catch( err ) {
197
+ base.WebApiBase.HandleError(options, config, err);
198
+ reject(err);
199
+ }
200
+ });
201
+ }
202
+
203
+
204
+ private async _getAppByNameAsync(request: carriers.ForeignSystem_GetAppByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
205
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
+ base.WebApiBase.SetPending(options);
207
+ return new Promise< carriers.ForeignAppEntity >(async (resolve, reject) => {
208
+ try {
209
+ config.baseURL = this._options.baseUrl;
210
+ const response = await this._axios.post("GetAppByName", request , config);
211
+ base.WebApiBase.SetCompleted(options, response);
212
+ const res : carriers.ForeignAppEntity = converters.Create_ForeignAppEntity_From( response.data );
213
+ resolve(res);
214
+ }
215
+ catch( err ) {
216
+ base.WebApiBase.HandleError(options, config, err);
217
+ reject(err);
218
+ }
219
+ });
220
+ }
221
+
222
+
223
+
224
+ /**
225
+ * Gets the ForeignApp with the given name.
226
+ * @param request - ApplicationName
227
+ * @returns The ForeignApp that matches the name.
228
+ */
229
+ public async getAppByNameAsync(request: carriers.ForeignSystem_GetAppByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
230
+
231
+ /**
232
+ * Gets the ForeignApp with the given name.
233
+ * @param applicationName - The name of the foreign application.
234
+ * @returns The ForeignApp that matches the name.
235
+ */
236
+ public async getAppByNameAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity >;
237
+
238
+ public async getAppByNameAsync(applicationName:string|carriers.ForeignSystem_GetAppByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignAppEntity > {
239
+ let _request : carriers.ForeignSystem_GetAppByNameRequest = null;
240
+ let _options : base.WebApiRequestOptions = null;
241
+ const first : any = applicationName;
242
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' ) )
243
+ {
244
+ _request = applicationName as carriers.ForeignSystem_GetAppByNameRequest;
245
+ _options = webapi_options as base.WebApiRequestOptions;
246
+ }
247
+ else
248
+ {
249
+ _request = {
250
+ applicationName: applicationName as string,
251
+ };
252
+ _options = webapi_options;
253
+ }
254
+ return this._getAppByNameAsync( _request, _options );
255
+ }
256
+
257
+
258
+ private async _getApplicationDevicesAsync(request: carriers.ForeignSystem_GetApplicationDevicesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] > {
259
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
260
+ base.WebApiBase.SetPending(options);
261
+ return new Promise< carriers.ForeignDevice[] >(async (resolve, reject) => {
262
+ try {
263
+ config.baseURL = this._options.baseUrl;
264
+ const response = await this._axios.post("GetApplicationDevices", request , config);
265
+ base.WebApiBase.SetCompleted(options, response);
266
+ const res : carriers.ForeignDevice[] = converters.Create_ForeignDeviceArray_From( response.data );
267
+ resolve(res);
268
+ }
269
+ catch( err ) {
270
+ base.WebApiBase.HandleError(options, config, err);
271
+ reject(err);
272
+ }
273
+ });
274
+ }
275
+
276
+
277
+
278
+ /**
279
+ * Gets all devices that belong to a foreign application.
280
+ * @param request - ApplicationName
281
+ * @returns Array of ForeignDevices
282
+ */
283
+ public async getApplicationDevicesAsync(request: carriers.ForeignSystem_GetApplicationDevicesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
284
+
285
+ /**
286
+ * Gets all devices that belong to a foreign application.
287
+ * @param applicationName - The foreign application name
288
+ * @returns Array of ForeignDevices
289
+ */
290
+ public async getApplicationDevicesAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] >;
291
+
292
+ public async getApplicationDevicesAsync(applicationName:string|carriers.ForeignSystem_GetApplicationDevicesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice[] > {
293
+ let _request : carriers.ForeignSystem_GetApplicationDevicesRequest = null;
294
+ let _options : base.WebApiRequestOptions = null;
295
+ const first : any = applicationName;
296
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' ) )
297
+ {
298
+ _request = applicationName as carriers.ForeignSystem_GetApplicationDevicesRequest;
299
+ _options = webapi_options as base.WebApiRequestOptions;
300
+ }
301
+ else
302
+ {
303
+ _request = {
304
+ applicationName: applicationName as string,
305
+ };
306
+ _options = webapi_options;
307
+ }
308
+ return this._getApplicationDevicesAsync( _request, _options );
309
+ }
310
+
311
+
312
+ private async _getDeviceByNameAsync(request: carriers.ForeignSystem_GetDeviceByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
313
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
314
+ base.WebApiBase.SetPending(options);
315
+ return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
316
+ try {
317
+ config.baseURL = this._options.baseUrl;
318
+ const response = await this._axios.post("GetDeviceByName", request , config);
319
+ base.WebApiBase.SetCompleted(options, response);
320
+ const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
321
+ resolve(res);
322
+ }
323
+ catch( err ) {
324
+ base.WebApiBase.HandleError(options, config, err);
325
+ reject(err);
326
+ }
327
+ });
328
+ }
329
+
330
+
331
+
332
+ /**
333
+ * Gets a ForeignDevice with deviceName that belongs to the application with applicationName.
334
+ * @param request - ApplicationName, DeviceName
335
+ * @returns The ForeignDevice.
336
+ */
337
+ public async getDeviceByNameAsync(request: carriers.ForeignSystem_GetDeviceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
338
+
339
+ /**
340
+ * Gets a ForeignDevice with deviceName that belongs to the application with applicationName.
341
+ * @param applicationName - The name of the foreign application.
342
+ * @param deviceName - The name of the foreign device.
343
+ * @returns The ForeignDevice.
344
+ */
345
+ public async getDeviceByNameAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
346
+
347
+ public async getDeviceByNameAsync(applicationName:string|carriers.ForeignSystem_GetDeviceByNameRequest, deviceName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
348
+ let _request : carriers.ForeignSystem_GetDeviceByNameRequest = null;
349
+ let _options : base.WebApiRequestOptions = null;
350
+ const first : any = applicationName;
351
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' ) )
352
+ {
353
+ _request = applicationName as carriers.ForeignSystem_GetDeviceByNameRequest;
354
+ _options = deviceName as base.WebApiRequestOptions;
355
+ }
356
+ else
357
+ {
358
+ _request = {
359
+ applicationName: applicationName as string,
360
+ deviceName: deviceName as string,
361
+ };
362
+ _options = webapi_options;
363
+ }
364
+ return this._getDeviceByNameAsync( _request, _options );
365
+ }
366
+
367
+
368
+ private async _getDeviceByIdentifierAsync(request: carriers.ForeignSystem_GetDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
369
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
370
+ base.WebApiBase.SetPending(options);
371
+ return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
372
+ try {
373
+ config.baseURL = this._options.baseUrl;
374
+ const response = await this._axios.post("GetDeviceByIdentifier", request , config);
375
+ base.WebApiBase.SetCompleted(options, response);
376
+ const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
377
+ resolve(res);
378
+ }
379
+ catch( err ) {
380
+ base.WebApiBase.HandleError(options, config, err);
381
+ reject(err);
382
+ }
383
+ });
384
+ }
385
+
386
+
387
+
388
+ /**
389
+ * Gets a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
390
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier
391
+ * @returns The ForeignDevice.
392
+ */
393
+ public async getDeviceByIdentifierAsync(request: carriers.ForeignSystem_GetDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
394
+
395
+ /**
396
+ * Gets a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
397
+ * @param applicationName - The name of the foreign application.
398
+ * @param deviceName - The name of the foreign device.
399
+ * @param deviceIdentifier - Optional unique id of device (Palm pilot device ID, version number, etc)
400
+ * @returns The ForeignDevice.
401
+ */
402
+ public async getDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
403
+
404
+ public async getDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
405
+ let _request : carriers.ForeignSystem_GetDeviceByIdentifierRequest = null;
406
+ let _options : base.WebApiRequestOptions = null;
407
+ const first : any = applicationName;
408
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
409
+ {
410
+ _request = applicationName as carriers.ForeignSystem_GetDeviceByIdentifierRequest;
411
+ _options = deviceName as base.WebApiRequestOptions;
412
+ }
413
+ else
414
+ {
415
+ _request = {
416
+ applicationName: applicationName as string,
417
+ deviceName: deviceName as string,
418
+ deviceIdentifier: deviceIdentifier as string,
419
+ };
420
+ _options = webapi_options;
421
+ }
422
+ return this._getDeviceByIdentifierAsync( _request, _options );
423
+ }
424
+
425
+
426
+ private async _addDeviceByIdentifierAsync(request: carriers.ForeignSystem_AddDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
427
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
428
+ base.WebApiBase.SetPending(options);
429
+ return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
430
+ try {
431
+ config.baseURL = this._options.baseUrl;
432
+ const response = await this._axios.post("AddDeviceByIdentifier", request , config);
433
+ base.WebApiBase.SetCompleted(options, response);
434
+ const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
435
+ resolve(res);
436
+ }
437
+ catch( err ) {
438
+ base.WebApiBase.HandleError(options, config, err);
439
+ reject(err);
440
+ }
441
+ });
442
+ }
443
+
444
+
445
+
446
+ /**
447
+ * Adds a new ForeignDevice with deviceName that belongs to the application with applicationName, with an optional device-specific identifier.
448
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier
449
+ * @returns The ForeignDevice.
450
+ */
451
+ public async addDeviceByIdentifierAsync(request: carriers.ForeignSystem_AddDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
452
+
453
+ /**
454
+ * Adds a new ForeignDevice with deviceName that belongs to the application with applicationName, with an optional device-specific identifier.
455
+ * @param applicationName - The name of the foreign application.
456
+ * @param deviceName - The name of the foreign device.
457
+ * @param deviceIdentifier - Unique id of device (Palm pilot device ID, version number, etc)
458
+ * @returns The ForeignDevice.
459
+ */
460
+ public async addDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
461
+
462
+ public async addDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_AddDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
463
+ let _request : carriers.ForeignSystem_AddDeviceByIdentifierRequest = null;
464
+ let _options : base.WebApiRequestOptions = null;
465
+ const first : any = applicationName;
466
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
467
+ {
468
+ _request = applicationName as carriers.ForeignSystem_AddDeviceByIdentifierRequest;
469
+ _options = deviceName as base.WebApiRequestOptions;
470
+ }
471
+ else
472
+ {
473
+ _request = {
474
+ applicationName: applicationName as string,
475
+ deviceName: deviceName as string,
476
+ deviceIdentifier: deviceIdentifier as string,
477
+ };
478
+ _options = webapi_options;
479
+ }
480
+ return this._addDeviceByIdentifierAsync( _request, _options );
481
+ }
482
+
483
+
484
+ private async _saveDeviceByIdentifierAsync(request: carriers.ForeignSystem_SaveDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
485
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
486
+ base.WebApiBase.SetPending(options);
487
+ return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
488
+ try {
489
+ config.baseURL = this._options.baseUrl;
490
+ const response = await this._axios.post("SaveDeviceByIdentifier", request , config);
491
+ base.WebApiBase.SetCompleted(options, response);
492
+ const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
493
+ resolve(res);
494
+ }
495
+ catch( err ) {
496
+ base.WebApiBase.HandleError(options, config, err);
497
+ reject(err);
498
+ }
499
+ });
500
+ }
501
+
502
+
503
+
504
+ /**
505
+ * Updates a ForeignDevice with deviceName that belongs to the application with applicationName.
506
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier, ForeignDevice
507
+ * @returns The ForeignDevice.
508
+ */
509
+ public async saveDeviceByIdentifierAsync(request: carriers.ForeignSystem_SaveDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
510
+
511
+ /**
512
+ * Updates a ForeignDevice with deviceName that belongs to the application with applicationName.
513
+ * @param applicationName - The name of the foreign application.
514
+ * @param deviceName - The name of the foreign device.
515
+ * @param deviceIdentifier - Unique id of device (Palm pilot device ID, version number, etc)
516
+ * @param foreignDevice - Foreign device to save. Can be null if adding new device.
517
+ * @returns The ForeignDevice.
518
+ */
519
+ public async saveDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, foreignDevice: carriers.ForeignDevice, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
520
+
521
+ public async saveDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_SaveDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, foreignDevice?:carriers.ForeignDevice, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
522
+ let _request : carriers.ForeignSystem_SaveDeviceByIdentifierRequest = null;
523
+ let _options : base.WebApiRequestOptions = null;
524
+ const first : any = applicationName;
525
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.foreignDevice)!='undefined' ) )
526
+ {
527
+ _request = applicationName as carriers.ForeignSystem_SaveDeviceByIdentifierRequest;
528
+ _options = deviceName as base.WebApiRequestOptions;
529
+ }
530
+ else
531
+ {
532
+ _request = {
533
+ applicationName: applicationName as string,
534
+ deviceName: deviceName as string,
535
+ deviceIdentifier: deviceIdentifier as string,
536
+ foreignDevice: foreignDevice as carriers.ForeignDevice,
537
+ };
538
+ _options = webapi_options;
539
+ }
540
+ return this._saveDeviceByIdentifierAsync( _request, _options );
541
+ }
542
+
543
+
544
+ private async _deleteDeviceByIdentifierAsync(request: carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< void > {
545
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
546
+ base.WebApiBase.SetPending(options);
547
+ return new Promise< void >(async (resolve, reject) => {
548
+ try {
549
+ config.baseURL = this._options.baseUrl;
550
+ const response = await this._axios.post("DeleteDeviceByIdentifier", request , config);
551
+ base.WebApiBase.SetCompleted(options, response);
552
+ const res = response.data;
553
+ resolve(res);
554
+ }
555
+ catch( err ) {
556
+ base.WebApiBase.HandleError(options, config, err);
557
+ reject(err);
558
+ }
559
+ });
560
+ }
561
+
562
+
563
+
564
+ /**
565
+ * Delete a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
566
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier
567
+ * @returns This method has no return value
568
+ */
569
+ public async deleteDeviceByIdentifierAsync(request: carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
570
+
571
+ /**
572
+ * Delete a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
573
+ * @param applicationName - The name of the foreign application.
574
+ * @param deviceName - The name of the foreign device.
575
+ * @param deviceIdentifier - Unique id of device (Palm pilot device ID, version number, etc)
576
+ * @returns This method has no return value
577
+ */
578
+ public async deleteDeviceByIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
579
+
580
+ public async deleteDeviceByIdentifierAsync(applicationName:string|carriers.ForeignSystem_DeleteDeviceByIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
581
+ let _request : carriers.ForeignSystem_DeleteDeviceByIdentifierRequest = null;
582
+ let _options : base.WebApiRequestOptions = null;
583
+ const first : any = applicationName;
584
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
585
+ {
586
+ _request = applicationName as carriers.ForeignSystem_DeleteDeviceByIdentifierRequest;
587
+ _options = deviceName as base.WebApiRequestOptions;
588
+ }
589
+ else
590
+ {
591
+ _request = {
592
+ applicationName: applicationName as string,
593
+ deviceName: deviceName as string,
594
+ deviceIdentifier: deviceIdentifier as string,
595
+ };
596
+ _options = webapi_options;
597
+ }
598
+ return this._deleteDeviceByIdentifierAsync( _request, _options );
599
+ }
600
+
601
+
602
+ private async _getKeyAsync(request: carriers.ForeignSystem_GetKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
603
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
604
+ base.WebApiBase.SetPending(options);
605
+ return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
606
+ try {
607
+ config.baseURL = this._options.baseUrl;
608
+ const response = await this._axios.post("GetKey", request , config);
609
+ base.WebApiBase.SetCompleted(options, response);
610
+ const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
611
+ resolve(res);
612
+ }
613
+ catch( err ) {
614
+ base.WebApiBase.HandleError(options, config, err);
615
+ reject(err);
616
+ }
617
+ });
618
+ }
619
+
620
+
621
+
622
+ /**
623
+ * Returning a foreign key by its key name, that belongs to the specified device and application. A table name and record ID can also be specified.
624
+ * @param request - ApplicationName, DeviceName, KeyName, TableName, RecordId
625
+ * @returns The ForeignKey.
626
+ */
627
+ public async getKeyAsync(request: carriers.ForeignSystem_GetKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
628
+
629
+ /**
630
+ * Returning a foreign key by its key name, that belongs to the specified device and application. A table name and record ID can also be specified.
631
+ * @param applicationName - The name of the foreign application.
632
+ * @param deviceName - The name of the foreign device.
633
+ * @param keyName - The name of the foreign key.
634
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
635
+ * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
636
+ * @returns The ForeignKey.
637
+ */
638
+ public async getKeyAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
639
+
640
+ public async getKeyAsync(applicationName:string|carriers.ForeignSystem_GetKeyRequest, deviceName?:string|base.WebApiRequestOptions, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
641
+ let _request : carriers.ForeignSystem_GetKeyRequest = null;
642
+ let _options : base.WebApiRequestOptions = null;
643
+ const first : any = applicationName;
644
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
645
+ {
646
+ _request = applicationName as carriers.ForeignSystem_GetKeyRequest;
647
+ _options = deviceName as base.WebApiRequestOptions;
648
+ }
649
+ else
650
+ {
651
+ _request = {
652
+ applicationName: applicationName as string,
653
+ deviceName: deviceName as string,
654
+ keyName: keyName as string,
655
+ tableName: tableName as string,
656
+ recordId: recordId as number,
657
+ };
658
+ _options = webapi_options;
659
+ }
660
+ return this._getKeyAsync( _request, _options );
661
+ }
662
+
663
+
664
+ private async _getKeyValueAsync(request: carriers.ForeignSystem_GetKeyValueRequest, options?:base.WebApiRequestOptions) : Promise< string > {
665
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
666
+ base.WebApiBase.SetPending(options);
667
+ return new Promise< string >(async (resolve, reject) => {
668
+ try {
669
+ config.baseURL = this._options.baseUrl;
670
+ const response = await this._axios.post("GetKeyValue", request , config);
671
+ base.WebApiBase.SetCompleted(options, response);
672
+ const res : string = response.data as string;
673
+ resolve(res);
674
+ }
675
+ catch( err ) {
676
+ base.WebApiBase.HandleError(options, config, err);
677
+ reject(err);
678
+ }
679
+ });
680
+ }
681
+
682
+
683
+
684
+ /**
685
+ * Gets the string value of a ForeignKey, that belongs to the specified device and application. The table name and record ID must also be specified.
686
+ * @param request - ApplicationName, DeviceName, KeyName, TableName, RecordId
687
+ * @returns The ForeignKey value as string.
688
+ */
689
+ public async getKeyValueAsync(request: carriers.ForeignSystem_GetKeyValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
690
+
691
+ /**
692
+ * Gets the string value of a ForeignKey, that belongs to the specified device and application. The table name and record ID must also be specified.
693
+ * @param applicationName - The name of the foreign application.
694
+ * @param deviceName - The name of the foreign device.
695
+ * @param keyName - The name of the foreign key.
696
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
697
+ * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
698
+ * @returns The ForeignKey value as string.
699
+ */
700
+ public async getKeyValueAsync(applicationName: string, deviceName: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
701
+
702
+ public async getKeyValueAsync(applicationName:string|carriers.ForeignSystem_GetKeyValueRequest, deviceName?:string|base.WebApiRequestOptions, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
703
+ let _request : carriers.ForeignSystem_GetKeyValueRequest = null;
704
+ let _options : base.WebApiRequestOptions = null;
705
+ const first : any = applicationName;
706
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
707
+ {
708
+ _request = applicationName as carriers.ForeignSystem_GetKeyValueRequest;
709
+ _options = deviceName as base.WebApiRequestOptions;
710
+ }
711
+ else
712
+ {
713
+ _request = {
714
+ applicationName: applicationName as string,
715
+ deviceName: deviceName as string,
716
+ keyName: keyName as string,
717
+ tableName: tableName as string,
718
+ recordId: recordId as number,
719
+ };
720
+ _options = webapi_options;
721
+ }
722
+ return this._getKeyValueAsync( _request, _options );
723
+ }
724
+
725
+
726
+ private async _getKeyOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
727
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
728
+ base.WebApiBase.SetPending(options);
729
+ return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
730
+ try {
731
+ config.baseURL = this._options.baseUrl;
732
+ const response = await this._axios.post("GetKeyOnDeviceIdentifier", request , config);
733
+ base.WebApiBase.SetCompleted(options, response);
734
+ const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
735
+ resolve(res);
736
+ }
737
+ catch( err ) {
738
+ base.WebApiBase.HandleError(options, config, err);
739
+ reject(err);
740
+ }
741
+ });
742
+ }
743
+
744
+
745
+
746
+ /**
747
+ * Returning a foreign key by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
748
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, TableName, RecordId
749
+ * @returns The ForeignKey.
750
+ */
751
+ public async getKeyOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
752
+
753
+ /**
754
+ * Returning a foreign key by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
755
+ * @param applicationName - The name of the foreign application.
756
+ * @param deviceName - The name of the foreign device.
757
+ * @param deviceIdentifier - The device identifier.
758
+ * @param keyName - The name of the foreign key.
759
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
760
+ * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
761
+ * @returns The ForeignKey.
762
+ */
763
+ public async getKeyOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
764
+
765
+ public async getKeyOnDeviceIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
766
+ let _request : carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest = null;
767
+ let _options : base.WebApiRequestOptions = null;
768
+ const first : any = applicationName;
769
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
770
+ {
771
+ _request = applicationName as carriers.ForeignSystem_GetKeyOnDeviceIdentifierRequest;
772
+ _options = deviceName as base.WebApiRequestOptions;
773
+ }
774
+ else
775
+ {
776
+ _request = {
777
+ applicationName: applicationName as string,
778
+ deviceName: deviceName as string,
779
+ deviceIdentifier: deviceIdentifier as string,
780
+ keyName: keyName as string,
781
+ tableName: tableName as string,
782
+ recordId: recordId as number,
783
+ };
784
+ _options = webapi_options;
785
+ }
786
+ return this._getKeyOnDeviceIdentifierAsync( _request, _options );
787
+ }
788
+
789
+
790
+ private async _getKeyValueOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< string > {
791
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
792
+ base.WebApiBase.SetPending(options);
793
+ return new Promise< string >(async (resolve, reject) => {
794
+ try {
795
+ config.baseURL = this._options.baseUrl;
796
+ const response = await this._axios.post("GetKeyValueOnDeviceIdentifier", request , config);
797
+ base.WebApiBase.SetCompleted(options, response);
798
+ const res : string = response.data as string;
799
+ resolve(res);
800
+ }
801
+ catch( err ) {
802
+ base.WebApiBase.HandleError(options, config, err);
803
+ reject(err);
804
+ }
805
+ });
806
+ }
807
+
808
+
809
+
810
+ /**
811
+ * Returning a foreign key string value by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
812
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, TableName, RecordId
813
+ * @returns The ForeignKey's string value.
814
+ */
815
+ public async getKeyValueOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
816
+
817
+ /**
818
+ * Returning a foreign key string value by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
819
+ * @param applicationName - The name of the foreign application.
820
+ * @param deviceName - The name of the foreign device.
821
+ * @param deviceIdentifier - The device identifier.
822
+ * @param keyName - The name of the foreign key.
823
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
824
+ * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
825
+ * @returns The ForeignKey's string value.
826
+ */
827
+ public async getKeyValueOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
828
+
829
+ public async getKeyValueOnDeviceIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
830
+ let _request : carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest = null;
831
+ let _options : base.WebApiRequestOptions = null;
832
+ const first : any = applicationName;
833
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
834
+ {
835
+ _request = applicationName as carriers.ForeignSystem_GetKeyValueOnDeviceIdentifierRequest;
836
+ _options = deviceName as base.WebApiRequestOptions;
837
+ }
838
+ else
839
+ {
840
+ _request = {
841
+ applicationName: applicationName as string,
842
+ deviceName: deviceName as string,
843
+ deviceIdentifier: deviceIdentifier as string,
844
+ keyName: keyName as string,
845
+ tableName: tableName as string,
846
+ recordId: recordId as number,
847
+ };
848
+ _options = webapi_options;
849
+ }
850
+ return this._getKeyValueOnDeviceIdentifierAsync( _request, _options );
851
+ }
852
+
853
+
854
+ private async _addForeignKeyAsync(request: carriers.ForeignSystem_AddForeignKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
855
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
856
+ base.WebApiBase.SetPending(options);
857
+ return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
858
+ try {
859
+ config.baseURL = this._options.baseUrl;
860
+ const response = await this._axios.post("AddForeignKey", request , config);
861
+ base.WebApiBase.SetCompleted(options, response);
862
+ const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
863
+ resolve(res);
864
+ }
865
+ catch( err ) {
866
+ base.WebApiBase.HandleError(options, config, err);
867
+ reject(err);
868
+ }
869
+ });
870
+ }
871
+
872
+
873
+
874
+ /**
875
+ * Add a new key belonging to the ForeignApp and ForeignDevice specified.
876
+ * @param request - ForeignKey, ApplicationName, DeviceName, DeviceIdentifier
877
+ * @returns The new or updated ForeignKey
878
+ */
879
+ public async addForeignKeyAsync(request: carriers.ForeignSystem_AddForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
880
+
881
+ /**
882
+ * Add a new key belonging to the ForeignApp and ForeignDevice specified.
883
+ * @param foreignKey - Foreign key to save
884
+ * @param applicationName - The name of the foreign application.
885
+ * @param deviceName - The name of the foreign device.
886
+ * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
887
+ * @returns The new or updated ForeignKey
888
+ */
889
+ public async addForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
890
+
891
+ public async addForeignKeyAsync(foreignKey:carriers.ForeignKey|carriers.ForeignSystem_AddForeignKeyRequest, applicationName?:string|base.WebApiRequestOptions, deviceName?:string, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
892
+ let _request : carriers.ForeignSystem_AddForeignKeyRequest = null;
893
+ let _options : base.WebApiRequestOptions = null;
894
+ const first : any = foreignKey;
895
+ if( typeof( first ) === "object" && first && ( typeof(first.foreignKey)!='undefined' || typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
896
+ {
897
+ _request = foreignKey as carriers.ForeignSystem_AddForeignKeyRequest;
898
+ _options = applicationName as base.WebApiRequestOptions;
899
+ }
900
+ else
901
+ {
902
+ _request = {
903
+ foreignKey: foreignKey as carriers.ForeignKey,
904
+ applicationName: applicationName as string,
905
+ deviceName: deviceName as string,
906
+ deviceIdentifier: deviceIdentifier as string,
907
+ };
908
+ _options = webapi_options;
909
+ }
910
+ return this._addForeignKeyAsync( _request, _options );
911
+ }
912
+
913
+
914
+ private async _saveForeignKeyAsync(request: carriers.ForeignSystem_SaveForeignKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
915
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
916
+ base.WebApiBase.SetPending(options);
917
+ return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
918
+ try {
919
+ config.baseURL = this._options.baseUrl;
920
+ const response = await this._axios.post("SaveForeignKey", request , config);
921
+ base.WebApiBase.SetCompleted(options, response);
922
+ const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
923
+ resolve(res);
924
+ }
925
+ catch( err ) {
926
+ base.WebApiBase.HandleError(options, config, err);
927
+ reject(err);
928
+ }
929
+ });
930
+ }
931
+
932
+
933
+
934
+ /**
935
+ * Saves a key belonging to the ForeignApp and ForeignDevice specified.
936
+ * @param request - ForeignKey, ApplicationName, DeviceName, DeviceIdentifier
937
+ * @returns The new or updated ForeignKey
938
+ */
939
+ public async saveForeignKeyAsync(request: carriers.ForeignSystem_SaveForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
940
+
941
+ /**
942
+ * Saves a key belonging to the ForeignApp and ForeignDevice specified.
943
+ * @param foreignKey - Foreign key to save
944
+ * @param applicationName - The name of the foreign application.
945
+ * @param deviceName - The name of the foreign device.
946
+ * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
947
+ * @returns The new or updated ForeignKey
948
+ */
949
+ public async saveForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
950
+
951
+ public async saveForeignKeyAsync(foreignKey:carriers.ForeignKey|carriers.ForeignSystem_SaveForeignKeyRequest, applicationName?:string|base.WebApiRequestOptions, deviceName?:string, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
952
+ let _request : carriers.ForeignSystem_SaveForeignKeyRequest = null;
953
+ let _options : base.WebApiRequestOptions = null;
954
+ const first : any = foreignKey;
955
+ if( typeof( first ) === "object" && first && ( typeof(first.foreignKey)!='undefined' || typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
956
+ {
957
+ _request = foreignKey as carriers.ForeignSystem_SaveForeignKeyRequest;
958
+ _options = applicationName as base.WebApiRequestOptions;
959
+ }
960
+ else
961
+ {
962
+ _request = {
963
+ foreignKey: foreignKey as carriers.ForeignKey,
964
+ applicationName: applicationName as string,
965
+ deviceName: deviceName as string,
966
+ deviceIdentifier: deviceIdentifier as string,
967
+ };
968
+ _options = webapi_options;
969
+ }
970
+ return this._saveForeignKeyAsync( _request, _options );
971
+ }
972
+
973
+
974
+ private async _deleteForeignKeyOnNameAsync(request: carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, options?:base.WebApiRequestOptions) : Promise< void > {
975
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
976
+ base.WebApiBase.SetPending(options);
977
+ return new Promise< void >(async (resolve, reject) => {
978
+ try {
979
+ config.baseURL = this._options.baseUrl;
980
+ const response = await this._axios.post("DeleteForeignKeyOnName", request , config);
981
+ base.WebApiBase.SetCompleted(options, response);
982
+ const res = response.data;
983
+ resolve(res);
984
+ }
985
+ catch( err ) {
986
+ base.WebApiBase.HandleError(options, config, err);
987
+ reject(err);
988
+ }
989
+ });
990
+ }
991
+
992
+
993
+
994
+ /**
995
+ * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
996
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, TableName, RecordId
997
+ * @returns This method has no return value
998
+ */
999
+ public async deleteForeignKeyOnNameAsync(request: carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1000
+
1001
+ /**
1002
+ * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
1003
+ * @param applicationName - The name of the foreign application.
1004
+ * @param deviceName - The name of the foreign device.
1005
+ * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
1006
+ * @param keyName - The name of the foreign key to delete.
1007
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to delete ALL keys that otherwise match; this may be dangerous and can take a long time if there are many items to delete.
1008
+ * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.<p/>Specifying a zero recordId will remove the recordId restriction and delete all keys that otherwise match.
1009
+ * @returns This method has no return value
1010
+ */
1011
+ public async deleteForeignKeyOnNameAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1012
+
1013
+ public async deleteForeignKeyOnNameAsync(applicationName:string|carriers.ForeignSystem_DeleteForeignKeyOnNameRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1014
+ let _request : carriers.ForeignSystem_DeleteForeignKeyOnNameRequest = null;
1015
+ let _options : base.WebApiRequestOptions = null;
1016
+ const first : any = applicationName;
1017
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
1018
+ {
1019
+ _request = applicationName as carriers.ForeignSystem_DeleteForeignKeyOnNameRequest;
1020
+ _options = deviceName as base.WebApiRequestOptions;
1021
+ }
1022
+ else
1023
+ {
1024
+ _request = {
1025
+ applicationName: applicationName as string,
1026
+ deviceName: deviceName as string,
1027
+ deviceIdentifier: deviceIdentifier as string,
1028
+ keyName: keyName as string,
1029
+ tableName: tableName as string,
1030
+ recordId: recordId as number,
1031
+ };
1032
+ _options = webapi_options;
1033
+ }
1034
+ return this._deleteForeignKeyOnNameAsync( _request, _options );
1035
+ }
1036
+
1037
+
1038
+ private async _getKeyByValueAsync(request: carriers.ForeignSystem_GetKeyByValueRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1039
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1040
+ base.WebApiBase.SetPending(options);
1041
+ return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
1042
+ try {
1043
+ config.baseURL = this._options.baseUrl;
1044
+ const response = await this._axios.post("GetKeyByValue", request , config);
1045
+ base.WebApiBase.SetCompleted(options, response);
1046
+ const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
1047
+ resolve(res);
1048
+ }
1049
+ catch( err ) {
1050
+ base.WebApiBase.HandleError(options, config, err);
1051
+ reject(err);
1052
+ }
1053
+ });
1054
+ }
1055
+
1056
+
1057
+
1058
+ /**
1059
+ * Get a foreignkey based on its name and value, that belongs to the specified device and application.
1060
+ * @param request - ApplicationName, DeviceName, KeyName, KeyValue, TableName
1061
+ * @returns The ForeignKey.
1062
+ */
1063
+ public async getKeyByValueAsync(request: carriers.ForeignSystem_GetKeyByValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1064
+
1065
+ /**
1066
+ * Get a foreignkey based on its name and value, that belongs to the specified device and application.
1067
+ * @param applicationName - The name of the foreign application.
1068
+ * @param deviceName - The name of the foreign device.
1069
+ * @param keyName - The name of the foreign key.
1070
+ * @param keyValue - Foreignkey value
1071
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1072
+ * @returns The ForeignKey.
1073
+ */
1074
+ public async getKeyByValueAsync(applicationName: string, deviceName: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1075
+
1076
+ public async getKeyByValueAsync(applicationName:string|carriers.ForeignSystem_GetKeyByValueRequest, deviceName?:string|base.WebApiRequestOptions, keyName?:string, keyValue?:string, tableName?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1077
+ let _request : carriers.ForeignSystem_GetKeyByValueRequest = null;
1078
+ let _options : base.WebApiRequestOptions = null;
1079
+ const first : any = applicationName;
1080
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.keyValue)!='undefined' || typeof(first.tableName)!='undefined' ) )
1081
+ {
1082
+ _request = applicationName as carriers.ForeignSystem_GetKeyByValueRequest;
1083
+ _options = deviceName as base.WebApiRequestOptions;
1084
+ }
1085
+ else
1086
+ {
1087
+ _request = {
1088
+ applicationName: applicationName as string,
1089
+ deviceName: deviceName as string,
1090
+ keyName: keyName as string,
1091
+ keyValue: keyValue as string,
1092
+ tableName: tableName as string,
1093
+ };
1094
+ _options = webapi_options;
1095
+ }
1096
+ return this._getKeyByValueAsync( _request, _options );
1097
+ }
1098
+
1099
+
1100
+ private async _getKeyByValueAndIdentifierAsync(request: carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1101
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1102
+ base.WebApiBase.SetPending(options);
1103
+ return new Promise< carriers.ForeignKey >(async (resolve, reject) => {
1104
+ try {
1105
+ config.baseURL = this._options.baseUrl;
1106
+ const response = await this._axios.post("GetKeyByValueAndIdentifier", request , config);
1107
+ base.WebApiBase.SetCompleted(options, response);
1108
+ const res : carriers.ForeignKey = converters.Create_ForeignKey_From( response.data );
1109
+ resolve(res);
1110
+ }
1111
+ catch( err ) {
1112
+ base.WebApiBase.HandleError(options, config, err);
1113
+ reject(err);
1114
+ }
1115
+ });
1116
+ }
1117
+
1118
+
1119
+
1120
+ /**
1121
+ * Get a foreignkey based on its name and value, that belongs to the specified deviceId, device, and application.
1122
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier, KeyName, KeyValue, TableName
1123
+ * @returns The ForeignKey.
1124
+ */
1125
+ public async getKeyByValueAndIdentifierAsync(request: carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1126
+
1127
+ /**
1128
+ * Get a foreignkey based on its name and value, that belongs to the specified deviceId, device, and application.
1129
+ * @param applicationName - The name of the foreign application.
1130
+ * @param deviceName - The name of the foreign device.
1131
+ * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
1132
+ * @param keyName - The name of the foreign key.
1133
+ * @param keyValue - Foreignkey value
1134
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1135
+ * @returns The ForeignKey.
1136
+ */
1137
+ public async getKeyByValueAndIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, keyName: string, keyValue: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey >;
1138
+
1139
+ public async getKeyByValueAndIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, keyName?:string, keyValue?:string, tableName?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey > {
1140
+ let _request : carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest = null;
1141
+ let _options : base.WebApiRequestOptions = null;
1142
+ const first : any = applicationName;
1143
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.keyName)!='undefined' || typeof(first.keyValue)!='undefined' || typeof(first.tableName)!='undefined' ) )
1144
+ {
1145
+ _request = applicationName as carriers.ForeignSystem_GetKeyByValueAndIdentifierRequest;
1146
+ _options = deviceName as base.WebApiRequestOptions;
1147
+ }
1148
+ else
1149
+ {
1150
+ _request = {
1151
+ applicationName: applicationName as string,
1152
+ deviceName: deviceName as string,
1153
+ deviceIdentifier: deviceIdentifier as string,
1154
+ keyName: keyName as string,
1155
+ keyValue: keyValue as string,
1156
+ tableName: tableName as string,
1157
+ };
1158
+ _options = webapi_options;
1159
+ }
1160
+ return this._getKeyByValueAndIdentifierAsync( _request, _options );
1161
+ }
1162
+
1163
+
1164
+ private async _getAllForeignKeysOnEntityAsync(request: carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
1165
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1166
+ base.WebApiBase.SetPending(options);
1167
+ return new Promise< carriers.StringDictionary >(async (resolve, reject) => {
1168
+ try {
1169
+ config.baseURL = this._options.baseUrl;
1170
+ const response = await this._axios.post("GetAllForeignKeysOnEntity", request , config);
1171
+ base.WebApiBase.SetCompleted(options, response);
1172
+ const res : carriers.StringDictionary = converters.Create_StringDictionary_From( response.data );
1173
+ resolve(res);
1174
+ }
1175
+ catch( err ) {
1176
+ base.WebApiBase.HandleError(options, config, err);
1177
+ reject(err);
1178
+ }
1179
+ });
1180
+ }
1181
+
1182
+
1183
+
1184
+ /**
1185
+ * Get a list of foreignkeys (&apos;app.device.key&apos;) and their values (&apos;123&apos;) that belong to the specified entity.
1186
+ * @param request - EntityType, EntityId
1187
+ * @returns Dictionary of 'appname.deviceid.keyname' = '123' key values
1188
+ */
1189
+ public async getAllForeignKeysOnEntityAsync(request: carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
1190
+
1191
+ /**
1192
+ * Get a list of foreignkeys (&apos;app.device.key&apos;) and their values (&apos;123&apos;) that belong to the specified entity.
1193
+ * @param entityType - Entity type (table name): 'contact', 'project' etc.
1194
+ * @param entityId - Primary key of Entity
1195
+ * @returns Dictionary of 'appname.deviceid.keyname' = '123' key values
1196
+ */
1197
+ public async getAllForeignKeysOnEntityAsync(entityType: string, entityId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
1198
+
1199
+ public async getAllForeignKeysOnEntityAsync(entityType:string|carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest, entityId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
1200
+ let _request : carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest = null;
1201
+ let _options : base.WebApiRequestOptions = null;
1202
+ const first : any = entityType;
1203
+ if( typeof( first ) === "object" && first && ( typeof(first.entityType)!='undefined' || typeof(first.entityId)!='undefined' ) )
1204
+ {
1205
+ _request = entityType as carriers.ForeignSystem_GetAllForeignKeysOnEntityRequest;
1206
+ _options = entityId as base.WebApiRequestOptions;
1207
+ }
1208
+ else
1209
+ {
1210
+ _request = {
1211
+ entityType: entityType as string,
1212
+ entityId: entityId as number,
1213
+ };
1214
+ _options = webapi_options;
1215
+ }
1216
+ return this._getAllForeignKeysOnEntityAsync( _request, _options );
1217
+ }
1218
+
1219
+ /**
1220
+ * Gets a ForeignDevice object.
1221
+ * @param foreignDeviceId - The primary key.
1222
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
1223
+ * @returns A single ForeignDevice
1224
+ */
1225
+ public async getForeignDeviceAsync(foreignDeviceId: number, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
1226
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1227
+ base.WebApiBase.SetPending(options);
1228
+ return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
1229
+ try {
1230
+ const response = await this._axios.post("GetForeignDevice?foreignDeviceId=" + foreignDeviceId, null, config);
1231
+ base.WebApiBase.SetCompleted(options, response);
1232
+ const res = converters.Create_ForeignDevice_From( response.data );
1233
+ resolve(res);
1234
+ }
1235
+ catch( err ) {
1236
+ base.WebApiBase.HandleError(options, config, err);
1237
+ reject(err);
1238
+ }
1239
+ });
1240
+ }
1241
+
1242
+
1243
+ private async _saveForeignDeviceAsync(request: carriers.ForeignSystem_SaveForeignDeviceRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
1244
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1245
+ base.WebApiBase.SetPending(options);
1246
+ return new Promise< carriers.ForeignDevice >(async (resolve, reject) => {
1247
+ try {
1248
+ config.baseURL = this._options.baseUrl;
1249
+ const response = await this._axios.post("SaveForeignDevice", request , config);
1250
+ base.WebApiBase.SetCompleted(options, response);
1251
+ const res : carriers.ForeignDevice = converters.Create_ForeignDevice_From( response.data );
1252
+ resolve(res);
1253
+ }
1254
+ catch( err ) {
1255
+ base.WebApiBase.HandleError(options, config, err);
1256
+ reject(err);
1257
+ }
1258
+ });
1259
+ }
1260
+
1261
+
1262
+
1263
+ /**
1264
+ * Saves a foreign device for an foreign application
1265
+ * @param request - ForeignDevice, ApplicationName
1266
+ * @returns Returns the saved foreign device
1267
+ */
1268
+ public async saveForeignDeviceAsync(request: carriers.ForeignSystem_SaveForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
1269
+
1270
+ /**
1271
+ * Saves a foreign device for an foreign application
1272
+ * @param foreignDevice - Foreign device to save
1273
+ * @param applicationName - The name of the foreign application.
1274
+ * @returns Returns the saved foreign device
1275
+ */
1276
+ public async saveForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice >;
1277
+
1278
+ public async saveForeignDeviceAsync(foreignDevice:carriers.ForeignDevice|carriers.ForeignSystem_SaveForeignDeviceRequest, applicationName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignDevice > {
1279
+ let _request : carriers.ForeignSystem_SaveForeignDeviceRequest = null;
1280
+ let _options : base.WebApiRequestOptions = null;
1281
+ const first : any = foreignDevice;
1282
+ if( typeof( first ) === "object" && first && ( typeof(first.foreignDevice)!='undefined' || typeof(first.applicationName)!='undefined' ) )
1283
+ {
1284
+ _request = foreignDevice as carriers.ForeignSystem_SaveForeignDeviceRequest;
1285
+ _options = applicationName as base.WebApiRequestOptions;
1286
+ }
1287
+ else
1288
+ {
1289
+ _request = {
1290
+ foreignDevice: foreignDevice as carriers.ForeignDevice,
1291
+ applicationName: applicationName as string,
1292
+ };
1293
+ _options = webapi_options;
1294
+ }
1295
+ return this._saveForeignDeviceAsync( _request, _options );
1296
+ }
1297
+
1298
+
1299
+ private async _deleteForeignDeviceAsync(request: carriers.ForeignSystem_DeleteForeignDeviceRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1300
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1301
+ base.WebApiBase.SetPending(options);
1302
+ return new Promise< void >(async (resolve, reject) => {
1303
+ try {
1304
+ config.baseURL = this._options.baseUrl;
1305
+ const response = await this._axios.post("DeleteForeignDevice", request , config);
1306
+ base.WebApiBase.SetCompleted(options, response);
1307
+ const res = response.data;
1308
+ resolve(res);
1309
+ }
1310
+ catch( err ) {
1311
+ base.WebApiBase.HandleError(options, config, err);
1312
+ reject(err);
1313
+ }
1314
+ });
1315
+ }
1316
+
1317
+
1318
+
1319
+ /**
1320
+ * Deletes a foreign device from an application
1321
+ * @param request - ForeignDevice, ApplicationName
1322
+ * @returns
1323
+ */
1324
+ public async deleteForeignDeviceAsync(request: carriers.ForeignSystem_DeleteForeignDeviceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1325
+
1326
+ /**
1327
+ * Deletes a foreign device from an application
1328
+ * @param foreignDevice - foreign device to delete
1329
+ * @param applicationName - Name of application to delete from
1330
+ * @returns
1331
+ */
1332
+ public async deleteForeignDeviceAsync(foreignDevice: carriers.ForeignDevice, applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1333
+
1334
+ public async deleteForeignDeviceAsync(foreignDevice:carriers.ForeignDevice|carriers.ForeignSystem_DeleteForeignDeviceRequest, applicationName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1335
+ let _request : carriers.ForeignSystem_DeleteForeignDeviceRequest = null;
1336
+ let _options : base.WebApiRequestOptions = null;
1337
+ const first : any = foreignDevice;
1338
+ if( typeof( first ) === "object" && first && ( typeof(first.foreignDevice)!='undefined' || typeof(first.applicationName)!='undefined' ) )
1339
+ {
1340
+ _request = foreignDevice as carriers.ForeignSystem_DeleteForeignDeviceRequest;
1341
+ _options = applicationName as base.WebApiRequestOptions;
1342
+ }
1343
+ else
1344
+ {
1345
+ _request = {
1346
+ foreignDevice: foreignDevice as carriers.ForeignDevice,
1347
+ applicationName: applicationName as string,
1348
+ };
1349
+ _options = webapi_options;
1350
+ }
1351
+ return this._deleteForeignDeviceAsync( _request, _options );
1352
+ }
1353
+
1354
+
1355
+ private async _deleteForeignKeyAsync(request: carriers.ForeignSystem_DeleteForeignKeyRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1356
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1357
+ base.WebApiBase.SetPending(options);
1358
+ return new Promise< void >(async (resolve, reject) => {
1359
+ try {
1360
+ config.baseURL = this._options.baseUrl;
1361
+ const response = await this._axios.post("DeleteForeignKey", request , config);
1362
+ base.WebApiBase.SetCompleted(options, response);
1363
+ const res = response.data;
1364
+ resolve(res);
1365
+ }
1366
+ catch( err ) {
1367
+ base.WebApiBase.HandleError(options, config, err);
1368
+ reject(err);
1369
+ }
1370
+ });
1371
+ }
1372
+
1373
+
1374
+
1375
+ /**
1376
+ * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
1377
+ * @param request - ForeignKey, ApplicationName, DeviceName, DeviceIdentifier, TableName, RecordId
1378
+ * @returns This method has no return value
1379
+ */
1380
+ public async deleteForeignKeyAsync(request: carriers.ForeignSystem_DeleteForeignKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1381
+
1382
+ /**
1383
+ * Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
1384
+ * @param foreignKey - Key name to delete.
1385
+ * @param applicationName - The name of the foreign application.
1386
+ * @param deviceName - The name of the foreign device.
1387
+ * @param deviceIdentifier - The device identifier. Optional if device identifier is not used.
1388
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to delete ALL keys that otherwise match; this may be dangerous and can take a long time if there are many items to delete.
1389
+ * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.<p/>Specifying a zero recordId will remove the recordId restriction and delete all keys that otherwise match.
1390
+ * @returns This method has no return value
1391
+ */
1392
+ public async deleteForeignKeyAsync(foreignKey: carriers.ForeignKey, applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1393
+
1394
+ public async deleteForeignKeyAsync(foreignKey:carriers.ForeignKey|carriers.ForeignSystem_DeleteForeignKeyRequest, applicationName?:string|base.WebApiRequestOptions, deviceName?:string, deviceIdentifier?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1395
+ let _request : carriers.ForeignSystem_DeleteForeignKeyRequest = null;
1396
+ let _options : base.WebApiRequestOptions = null;
1397
+ const first : any = foreignKey;
1398
+ if( typeof( first ) === "object" && first && ( typeof(first.foreignKey)!='undefined' || typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
1399
+ {
1400
+ _request = foreignKey as carriers.ForeignSystem_DeleteForeignKeyRequest;
1401
+ _options = applicationName as base.WebApiRequestOptions;
1402
+ }
1403
+ else
1404
+ {
1405
+ _request = {
1406
+ foreignKey: foreignKey as carriers.ForeignKey,
1407
+ applicationName: applicationName as string,
1408
+ deviceName: deviceName as string,
1409
+ deviceIdentifier: deviceIdentifier as string,
1410
+ tableName: tableName as string,
1411
+ recordId: recordId as number,
1412
+ };
1413
+ _options = webapi_options;
1414
+ }
1415
+ return this._deleteForeignKeyAsync( _request, _options );
1416
+ }
1417
+
1418
+
1419
+ private async _getDeviceKeysAsync(request: carriers.ForeignSystem_GetDeviceKeysRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1420
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1421
+ base.WebApiBase.SetPending(options);
1422
+ return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1423
+ try {
1424
+ config.baseURL = this._options.baseUrl;
1425
+ const response = await this._axios.post("GetDeviceKeys", request , config);
1426
+ base.WebApiBase.SetCompleted(options, response);
1427
+ const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1428
+ resolve(res);
1429
+ }
1430
+ catch( err ) {
1431
+ base.WebApiBase.HandleError(options, config, err);
1432
+ reject(err);
1433
+ }
1434
+ });
1435
+ }
1436
+
1437
+
1438
+
1439
+ /**
1440
+ * Returns all ForeignKeys that belong to a device.
1441
+ * @param request - ApplicationName, DeviceName
1442
+ * @returns Array of all ForeignKeys in the ForeignDevice.
1443
+ */
1444
+ public async getDeviceKeysAsync(request: carriers.ForeignSystem_GetDeviceKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1445
+
1446
+ /**
1447
+ * Returns all ForeignKeys that belong to a device.
1448
+ * @param applicationName - The name of the foreign application.
1449
+ * @param deviceName - The name of the foreign device.
1450
+ * @returns Array of all ForeignKeys in the ForeignDevice.
1451
+ */
1452
+ public async getDeviceKeysAsync(applicationName: string, deviceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1453
+
1454
+ public async getDeviceKeysAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysRequest, deviceName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1455
+ let _request : carriers.ForeignSystem_GetDeviceKeysRequest = null;
1456
+ let _options : base.WebApiRequestOptions = null;
1457
+ const first : any = applicationName;
1458
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' ) )
1459
+ {
1460
+ _request = applicationName as carriers.ForeignSystem_GetDeviceKeysRequest;
1461
+ _options = deviceName as base.WebApiRequestOptions;
1462
+ }
1463
+ else
1464
+ {
1465
+ _request = {
1466
+ applicationName: applicationName as string,
1467
+ deviceName: deviceName as string,
1468
+ };
1469
+ _options = webapi_options;
1470
+ }
1471
+ return this._getDeviceKeysAsync( _request, _options );
1472
+ }
1473
+
1474
+
1475
+ private async _getApplicationKeysAsync(request: carriers.ForeignSystem_GetApplicationKeysRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1476
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1477
+ base.WebApiBase.SetPending(options);
1478
+ return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1479
+ try {
1480
+ config.baseURL = this._options.baseUrl;
1481
+ const response = await this._axios.post("GetApplicationKeys", request , config);
1482
+ base.WebApiBase.SetCompleted(options, response);
1483
+ const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1484
+ resolve(res);
1485
+ }
1486
+ catch( err ) {
1487
+ base.WebApiBase.HandleError(options, config, err);
1488
+ reject(err);
1489
+ }
1490
+ });
1491
+ }
1492
+
1493
+
1494
+
1495
+ /**
1496
+ * Returns all ForeignKeys that belong to an application.
1497
+ * @param request - ApplicationName
1498
+ * @returns Array of all ForeignKeys in the ForeignApp.
1499
+ */
1500
+ public async getApplicationKeysAsync(request: carriers.ForeignSystem_GetApplicationKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1501
+
1502
+ /**
1503
+ * Returns all ForeignKeys that belong to an application.
1504
+ * @param applicationName - The name of the foreign application.
1505
+ * @returns Array of all ForeignKeys in the ForeignApp.
1506
+ */
1507
+ public async getApplicationKeysAsync(applicationName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1508
+
1509
+ public async getApplicationKeysAsync(applicationName:string|carriers.ForeignSystem_GetApplicationKeysRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1510
+ let _request : carriers.ForeignSystem_GetApplicationKeysRequest = null;
1511
+ let _options : base.WebApiRequestOptions = null;
1512
+ const first : any = applicationName;
1513
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' ) )
1514
+ {
1515
+ _request = applicationName as carriers.ForeignSystem_GetApplicationKeysRequest;
1516
+ _options = webapi_options as base.WebApiRequestOptions;
1517
+ }
1518
+ else
1519
+ {
1520
+ _request = {
1521
+ applicationName: applicationName as string,
1522
+ };
1523
+ _options = webapi_options;
1524
+ }
1525
+ return this._getApplicationKeysAsync( _request, _options );
1526
+ }
1527
+
1528
+
1529
+ private async _getDeviceKeysOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1530
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1531
+ base.WebApiBase.SetPending(options);
1532
+ return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1533
+ try {
1534
+ config.baseURL = this._options.baseUrl;
1535
+ const response = await this._axios.post("GetDeviceKeysOnDeviceIdentifier", request , config);
1536
+ base.WebApiBase.SetCompleted(options, response);
1537
+ const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1538
+ resolve(res);
1539
+ }
1540
+ catch( err ) {
1541
+ base.WebApiBase.HandleError(options, config, err);
1542
+ reject(err);
1543
+ }
1544
+ });
1545
+ }
1546
+
1547
+
1548
+
1549
+ /**
1550
+ * Returns all ForeignKeys that belong to a device with a given deviceIdentifier.
1551
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier
1552
+ * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1553
+ */
1554
+ public async getDeviceKeysOnDeviceIdentifierAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1555
+
1556
+ /**
1557
+ * Returns all ForeignKeys that belong to a device with a given deviceIdentifier.
1558
+ * @param applicationName - The name of the foreign application.
1559
+ * @param deviceName - The name of the foreign device.
1560
+ * @param deviceIdentifier - Identifier for a unique grouping of keys within a device.
1561
+ * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1562
+ */
1563
+ public async getDeviceKeysOnDeviceIdentifierAsync(applicationName: string, deviceName: string, deviceIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1564
+
1565
+ public async getDeviceKeysOnDeviceIdentifierAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1566
+ let _request : carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest = null;
1567
+ let _options : base.WebApiRequestOptions = null;
1568
+ const first : any = applicationName;
1569
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' ) )
1570
+ {
1571
+ _request = applicationName as carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierRequest;
1572
+ _options = deviceName as base.WebApiRequestOptions;
1573
+ }
1574
+ else
1575
+ {
1576
+ _request = {
1577
+ applicationName: applicationName as string,
1578
+ deviceName: deviceName as string,
1579
+ deviceIdentifier: deviceIdentifier as string,
1580
+ };
1581
+ _options = webapi_options;
1582
+ }
1583
+ return this._getDeviceKeysOnDeviceIdentifierAsync( _request, _options );
1584
+ }
1585
+
1586
+
1587
+ private async _getDeviceKeysOnDeviceIdentifierTableAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1588
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1589
+ base.WebApiBase.SetPending(options);
1590
+ return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1591
+ try {
1592
+ config.baseURL = this._options.baseUrl;
1593
+ const response = await this._axios.post("GetDeviceKeysOnDeviceIdentifierTable", request , config);
1594
+ base.WebApiBase.SetCompleted(options, response);
1595
+ const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1596
+ resolve(res);
1597
+ }
1598
+ catch( err ) {
1599
+ base.WebApiBase.HandleError(options, config, err);
1600
+ reject(err);
1601
+ }
1602
+ });
1603
+ }
1604
+
1605
+
1606
+
1607
+ /**
1608
+ * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name.
1609
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier, TableName
1610
+ * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1611
+ */
1612
+ public async getDeviceKeysOnDeviceIdentifierTableAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1613
+
1614
+ /**
1615
+ * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name.
1616
+ * @param applicationName - The name of the foreign application.
1617
+ * @param deviceName - The name of the foreign device.
1618
+ * @param deviceIdentifier - Identifier for a unique grouping of keys within a device.
1619
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1620
+ * @returns Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.
1621
+ */
1622
+ public async getDeviceKeysOnDeviceIdentifierTableAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1623
+
1624
+ public async getDeviceKeysOnDeviceIdentifierTableAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, tableName?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1625
+ let _request : carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest = null;
1626
+ let _options : base.WebApiRequestOptions = null;
1627
+ const first : any = applicationName;
1628
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.tableName)!='undefined' ) )
1629
+ {
1630
+ _request = applicationName as carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRequest;
1631
+ _options = deviceName as base.WebApiRequestOptions;
1632
+ }
1633
+ else
1634
+ {
1635
+ _request = {
1636
+ applicationName: applicationName as string,
1637
+ deviceName: deviceName as string,
1638
+ deviceIdentifier: deviceIdentifier as string,
1639
+ tableName: tableName as string,
1640
+ };
1641
+ _options = webapi_options;
1642
+ }
1643
+ return this._getDeviceKeysOnDeviceIdentifierTableAsync( _request, _options );
1644
+ }
1645
+
1646
+
1647
+ private async _getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1648
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1649
+ base.WebApiBase.SetPending(options);
1650
+ return new Promise< carriers.ForeignKey[] >(async (resolve, reject) => {
1651
+ try {
1652
+ config.baseURL = this._options.baseUrl;
1653
+ const response = await this._axios.post("GetDeviceKeysOnDeviceIdentifierTableRecordId", request , config);
1654
+ base.WebApiBase.SetCompleted(options, response);
1655
+ const res : carriers.ForeignKey[] = converters.Create_ForeignKeyArray_From( response.data );
1656
+ resolve(res);
1657
+ }
1658
+ catch( err ) {
1659
+ base.WebApiBase.HandleError(options, config, err);
1660
+ reject(err);
1661
+ }
1662
+ });
1663
+ }
1664
+
1665
+
1666
+
1667
+ /**
1668
+ * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name, as well as record id.
1669
+ * @param request - ApplicationName, DeviceName, DeviceIdentifier, TableName, RecordId
1670
+ * @returns Array of all ForeignKeys in the ForeignDevice that match the criteria
1671
+ */
1672
+ public async getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(request: carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1673
+
1674
+ /**
1675
+ * Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name, as well as record id.
1676
+ * @param applicationName - The name of the foreign application.
1677
+ * @param deviceName - The name of the foreign device.
1678
+ * @param deviceIdentifier - Identifier for a unique grouping of keys within a device.
1679
+ * @param tableName - Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table.
1680
+ * @param recordId - Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.
1681
+ * @returns Array of all ForeignKeys in the ForeignDevice that match the criteria
1682
+ */
1683
+ public async getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(applicationName: string, deviceName: string, deviceIdentifier: string, tableName: string, recordId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] >;
1684
+
1685
+ public async getDeviceKeysOnDeviceIdentifierTableRecordIdAsync(applicationName:string|carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest, deviceName?:string|base.WebApiRequestOptions, deviceIdentifier?:string, tableName?:string, recordId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ForeignKey[] > {
1686
+ let _request : carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest = null;
1687
+ let _options : base.WebApiRequestOptions = null;
1688
+ const first : any = applicationName;
1689
+ if( typeof( first ) === "object" && first && ( typeof(first.applicationName)!='undefined' || typeof(first.deviceName)!='undefined' || typeof(first.deviceIdentifier)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.recordId)!='undefined' ) )
1690
+ {
1691
+ _request = applicationName as carriers.ForeignSystem_GetDeviceKeysOnDeviceIdentifierTableRecordIdRequest;
1692
+ _options = deviceName as base.WebApiRequestOptions;
1693
+ }
1694
+ else
1695
+ {
1696
+ _request = {
1697
+ applicationName: applicationName as string,
1698
+ deviceName: deviceName as string,
1699
+ deviceIdentifier: deviceIdentifier as string,
1700
+ tableName: tableName as string,
1701
+ recordId: recordId as number,
1702
+ };
1703
+ _options = webapi_options;
1704
+ }
1705
+ return this._getDeviceKeysOnDeviceIdentifierTableRecordIdAsync( _request, _options );
1706
+ }
1707
+
1708
+ } // class v1ForeignSystemAgentController
1709
+
1710
+