wallet 1.1.3 → 1.1.6

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 (319) hide show
  1. package/.openapi-generator/FILES +309 -309
  2. package/.openapi-generator-ignore +23 -23
  3. package/README.md +13 -1
  4. package/api/advertisementCreditsApi.ts +589 -589
  5. package/api/analyticsApi.ts +5953 -5953
  6. package/api/apis.ts +86 -86
  7. package/api/appleWalletSubscribersApi.ts +235 -235
  8. package/api/billingApi.ts +680 -680
  9. package/api/clubMembersPointsApi.ts +798 -798
  10. package/api/configurationApi.ts +225 -225
  11. package/api/countriesApi.ts +155 -155
  12. package/api/customerApi.ts +737 -737
  13. package/api/dashboardApi.ts +1553 -1553
  14. package/api/dynamicVouchersApi.ts +603 -603
  15. package/api/employeeAccessApi.ts +165 -165
  16. package/api/employeesApi.ts +2933 -2933
  17. package/api/industriesApi.ts +155 -155
  18. package/api/infoGenesisReportsApi.ts +2023 -2023
  19. package/api/integratedTerminalsApi.ts +447 -447
  20. package/api/interactionsApi.ts +678 -678
  21. package/api/linkBookApi.ts +447 -447
  22. package/api/linkBookSectionApi.ts +447 -447
  23. package/api/loginAndLogoutApi.ts +296 -296
  24. package/api/membershipTiersApi.ts +729 -729
  25. package/api/merchantApi.ts +1534 -1534
  26. package/api/merchantCreditsApi.ts +798 -798
  27. package/api/merchantURLsApi.ts +586 -586
  28. package/api/mobileTerminalApi.ts +323 -323
  29. package/api/newsApi.ts +447 -447
  30. package/api/paymentDesignsApi.ts +519 -519
  31. package/api/performancesApi.ts +447 -447
  32. package/api/promoCodesApi.ts +447 -447
  33. package/api/sMSApi.ts +1999 -1999
  34. package/api/settingsApi.ts +220 -220
  35. package/api/staticVoucherCampaignGroupsApi.ts +165 -165
  36. package/api/staticVoucherCampaignsApi.ts +1484 -1484
  37. package/api/staticVouchersApi.ts +535 -535
  38. package/api/systemApi.ts +604 -604
  39. package/api/transactionLedgerApi.ts +203 -203
  40. package/api/utilitiesApi.ts +157 -157
  41. package/api/webTerminalApi.ts +309 -309
  42. package/api.ts +2 -2
  43. package/examples/advertisementcredits.example.ts +50 -50
  44. package/examples/clubmembers.example.ts +50 -50
  45. package/examples/linkbook.example.ts +50 -50
  46. package/examples/membershiptiers.example.ts +49 -49
  47. package/examples/merchanturls.example.ts +47 -47
  48. package/examples/news.example.ts +51 -51
  49. package/examples/paymentdesigns.example.ts +56 -56
  50. package/git_push.sh +57 -57
  51. package/model/advertisementCredit.ts +103 -103
  52. package/model/advertisementCreditBroadcast.ts +154 -154
  53. package/model/advertisementCreditScan.ts +170 -170
  54. package/model/agreement.ts +133 -133
  55. package/model/alert.ts +79 -79
  56. package/model/announcement.ts +67 -67
  57. package/model/applicableTerminals.ts +30 -30
  58. package/model/applicableTerminalsAnyOf.ts +17 -17
  59. package/model/applicableTerminalsAnyOf1.ts +17 -17
  60. package/model/applicableTerminalsAnyOf2.ts +17 -17
  61. package/model/applicableTerminalsAnyOf3.ts +17 -17
  62. package/model/authError.ts +55 -55
  63. package/model/availablePhoneNumbersRequest.ts +43 -43
  64. package/model/clickFunnelAmount.ts +37 -37
  65. package/model/clickFunnelContact.ts +248 -248
  66. package/model/clickFunnelContactProfile.ts +235 -235
  67. package/model/clickFunnelEvent.ts +38 -38
  68. package/model/clickFunnelOriginalAmount.ts +37 -37
  69. package/model/clickFunnelProduct.ts +194 -194
  70. package/model/clickFunnelPurchase.ts +178 -178
  71. package/model/createStaticVoucherCampaign.ts +109 -109
  72. package/model/createStaticVoucherCampaignWithVoucher.ts +109 -109
  73. package/model/createStaticVoucherCampaignWithVoucherWithCSV.ts +109 -109
  74. package/model/dashboardWidget.ts +115 -115
  75. package/model/duplicateRowFound.ts +55 -55
  76. package/model/dynamicVoucher.ts +224 -224
  77. package/model/dynamicVoucherBroadcast.ts +154 -154
  78. package/model/employee.ts +109 -109
  79. package/model/employeeActivityLog.ts +67 -67
  80. package/model/employeeAlert.ts +79 -79
  81. package/model/exportDataFile.ts +85 -85
  82. package/model/falsumError.ts +41 -41
  83. package/model/falsumField.ts +55 -55
  84. package/model/feature.ts +79 -79
  85. package/model/forbiddenRequest.ts +55 -55
  86. package/model/foreignKeyDoesNotExist.ts +55 -55
  87. package/model/helpDeskRequest.ts +85 -85
  88. package/model/importedList.ts +73 -73
  89. package/model/importedListRecipient.ts +73 -73
  90. package/model/inlineObject.ts +31 -31
  91. package/model/inlineObject1.ts +31 -31
  92. package/model/inlineObject10.ts +37 -37
  93. package/model/inlineObject11.ts +37 -37
  94. package/model/inlineObject12.ts +37 -37
  95. package/model/inlineObject13.ts +37 -37
  96. package/model/inlineObject14.ts +37 -37
  97. package/model/inlineObject15.ts +67 -67
  98. package/model/inlineObject16.ts +61 -61
  99. package/model/inlineObject17.ts +55 -55
  100. package/model/inlineObject18.ts +61 -61
  101. package/model/inlineObject19.ts +55 -55
  102. package/model/inlineObject2.ts +31 -31
  103. package/model/inlineObject20.ts +61 -61
  104. package/model/inlineObject21.ts +73 -73
  105. package/model/inlineObject22.ts +31 -31
  106. package/model/inlineObject23.ts +31 -31
  107. package/model/inlineObject24.ts +43 -43
  108. package/model/inlineObject25.ts +55 -55
  109. package/model/inlineObject26.ts +31 -31
  110. package/model/inlineObject27.ts +31 -31
  111. package/model/inlineObject28.ts +43 -43
  112. package/model/inlineObject29.ts +49 -49
  113. package/model/inlineObject3.ts +31 -31
  114. package/model/inlineObject30.ts +43 -43
  115. package/model/inlineObject31.ts +31 -31
  116. package/model/inlineObject32.ts +31 -31
  117. package/model/inlineObject33.ts +31 -31
  118. package/model/inlineObject34.ts +43 -43
  119. package/model/inlineObject35.ts +43 -43
  120. package/model/inlineObject36.ts +43 -43
  121. package/model/inlineObject37.ts +43 -43
  122. package/model/inlineObject38.ts +43 -43
  123. package/model/inlineObject39.ts +43 -43
  124. package/model/inlineObject4.ts +37 -37
  125. package/model/inlineObject40.ts +43 -43
  126. package/model/inlineObject41.ts +43 -43
  127. package/model/inlineObject42.ts +43 -43
  128. package/model/inlineObject43.ts +43 -43
  129. package/model/inlineObject44.ts +43 -43
  130. package/model/inlineObject45.ts +43 -43
  131. package/model/inlineObject46.ts +43 -43
  132. package/model/inlineObject47.ts +43 -43
  133. package/model/inlineObject48.ts +43 -43
  134. package/model/inlineObject49.ts +43 -43
  135. package/model/inlineObject5.ts +31 -31
  136. package/model/inlineObject50.ts +43 -43
  137. package/model/inlineObject51.ts +97 -97
  138. package/model/inlineObject52.ts +31 -31
  139. package/model/inlineObject53.ts +97 -97
  140. package/model/inlineObject54.ts +97 -97
  141. package/model/inlineObject55.ts +91 -91
  142. package/model/inlineObject56.ts +37 -37
  143. package/model/inlineObject57.ts +37 -37
  144. package/model/inlineObject58.ts +37 -37
  145. package/model/inlineObject59.ts +43 -43
  146. package/model/inlineObject6.ts +31 -31
  147. package/model/inlineObject60.ts +43 -43
  148. package/model/inlineObject61.ts +43 -43
  149. package/model/inlineObject62.ts +37 -37
  150. package/model/inlineObject63.ts +37 -37
  151. package/model/inlineObject64.ts +37 -37
  152. package/model/inlineObject65.ts +205 -205
  153. package/model/inlineObject66.ts +49 -49
  154. package/model/inlineObject67.ts +49 -49
  155. package/model/inlineObject68.ts +37 -37
  156. package/model/inlineObject69.ts +121 -121
  157. package/model/inlineObject7.ts +31 -31
  158. package/model/inlineObject8.ts +43 -43
  159. package/model/inlineObject9.ts +37 -37
  160. package/model/inlineResponse200.ts +37 -37
  161. package/model/inlineResponse2001.ts +56 -56
  162. package/model/inlineResponse20010.ts +109 -109
  163. package/model/inlineResponse20011.ts +43 -43
  164. package/model/inlineResponse2002.ts +31 -31
  165. package/model/inlineResponse2003.ts +31 -31
  166. package/model/inlineResponse2004.ts +43 -43
  167. package/model/inlineResponse2005.ts +38 -38
  168. package/model/inlineResponse2006.ts +97 -97
  169. package/model/inlineResponse2007.ts +44 -44
  170. package/model/inlineResponse2008.ts +31 -31
  171. package/model/inlineResponse2009.ts +98 -98
  172. package/model/internalServerError.ts +55 -55
  173. package/model/ledgerEntry.ts +176 -176
  174. package/model/linkBook.ts +85 -85
  175. package/model/linkBookSection.ts +61 -61
  176. package/model/mSMemberHistory.ts +112 -112
  177. package/model/mSMemberHistoryPagination.ts +53 -53
  178. package/model/mSMemberRedemption.ts +109 -109
  179. package/model/mSMemberRedemptionPagination.ts +53 -53
  180. package/model/mSMembershipTierHistory.ts +106 -106
  181. package/model/mSMembershipTierHistoryPagination.ts +53 -53
  182. package/model/mSMembershipTierRedemption.ts +121 -121
  183. package/model/mSMembershipTierRedemptionPagination.ts +53 -53
  184. package/model/mSMerchantCreditHistory.ts +88 -88
  185. package/model/mSMerchantCreditHistoryPagination.ts +53 -53
  186. package/model/mSMerchantCreditRedemption.ts +109 -109
  187. package/model/mSMerchantCreditRedemptionPagination.ts +53 -53
  188. package/model/mediaFile.ts +85 -85
  189. package/model/member.ts +118 -118
  190. package/model/memberSearch.ts +61 -61
  191. package/model/merchant.ts +133 -133
  192. package/model/merchantCreditSearch.ts +61 -61
  193. package/model/merchantNotInitialized.ts +55 -55
  194. package/model/merchantURL.ts +67 -67
  195. package/model/message.ts +74 -74
  196. package/model/models.ts +1015 -1015
  197. package/model/moduleError.ts +157 -157
  198. package/model/newsArticle.ts +85 -85
  199. package/model/optInList.ts +121 -121
  200. package/model/optInListSource.ts +73 -73
  201. package/model/optInListSubscriber.ts +104 -104
  202. package/model/outboundSMS.ts +157 -157
  203. package/model/paginatedWTMembers.ts +53 -53
  204. package/model/paginatedWTMerchantCredits.ts +53 -53
  205. package/model/paginationRequestWithSortOptions.ts +75 -75
  206. package/model/paymentDesign.ts +139 -139
  207. package/model/performance.ts +100 -100
  208. package/model/phoneNumber.ts +157 -157
  209. package/model/pickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.ts +106 -106
  210. package/model/pickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.ts +67 -67
  211. package/model/pickMSMemberExcludeKeyofMSMemberMemberIdentifier.ts +106 -106
  212. package/model/pickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.ts +43 -43
  213. package/model/pickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.ts +82 -82
  214. package/model/pickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.ts +46 -46
  215. package/model/pickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.ts +52 -52
  216. package/model/pickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.ts +100 -100
  217. package/model/pickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeID.ts +94 -94
  218. package/model/pickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.ts +100 -100
  219. package/model/pickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.ts +46 -46
  220. package/model/pickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.ts +154 -154
  221. package/model/pickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.ts +137 -137
  222. package/model/pickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.ts +58 -58
  223. package/model/pickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.ts +106 -106
  224. package/model/pickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.ts +142 -142
  225. package/model/pickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsBackgroundImageURLOrCompanyLogoURLOrEmployeeID.ts +94 -94
  226. package/model/pickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.ts +106 -106
  227. package/model/pickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.ts +167 -167
  228. package/model/pickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID.ts +58 -58
  229. package/model/pickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.ts +58 -58
  230. package/model/pickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.ts +76 -76
  231. package/model/pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.ts +52 -52
  232. package/model/pickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.ts +40 -40
  233. package/model/pickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.ts +58 -58
  234. package/model/pickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.ts +138 -138
  235. package/model/pickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.ts +112 -112
  236. package/model/pickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.ts +46 -46
  237. package/model/plan.ts +62 -62
  238. package/model/portalPage.ts +67 -67
  239. package/model/presignedPost.ts +41 -41
  240. package/model/presignedPostFields.ts +43 -43
  241. package/model/product.ts +74 -74
  242. package/model/promoCode.ts +97 -97
  243. package/model/reachPerformanceStats.ts +70 -70
  244. package/model/request.ts +349 -349
  245. package/model/response.ts +67 -67
  246. package/model/role.ts +117 -117
  247. package/model/roleAuditLog.ts +97 -97
  248. package/model/sSOptInSource.ts +73 -73
  249. package/model/simpleSMSBroadcast.ts +147 -147
  250. package/model/staticVoucher.ts +224 -224
  251. package/model/staticVoucherCampaign.ts +175 -175
  252. package/model/staticVoucherCampaignBroadcast.ts +142 -142
  253. package/model/staticVoucherCampaignGroup.ts +85 -85
  254. package/model/staticVoucherCampaignUpdate.ts +85 -85
  255. package/model/status.ts +30 -30
  256. package/model/statusAnyOf.ts +17 -17
  257. package/model/statusAnyOf1.ts +17 -17
  258. package/model/statusAnyOf2.ts +17 -17
  259. package/model/statusAnyOf3.ts +17 -17
  260. package/model/subscriptionFeature.ts +79 -79
  261. package/model/subscriptionPlan.ts +69 -69
  262. package/model/subscriptionProduct.ts +81 -81
  263. package/model/tcpa.ts +67 -67
  264. package/model/updateStaticVoucherCampaignWithVoucher.ts +109 -109
  265. package/model/vSCampaignGeneratedMessage.ts +43 -43
  266. package/model/vSCampaignGeneratedMessagePagination.ts +53 -53
  267. package/model/vSDynamicVoucherStatus.ts +28 -28
  268. package/model/wTAdvertisementCredit.ts +103 -103
  269. package/model/wTAdvertisementCreditScan.ts +170 -170
  270. package/model/wTAdvertisementCreditUpdateParams.ts +55 -55
  271. package/model/wTDynamicVoucher.ts +224 -224
  272. package/model/wTDynamicVoucherCreateParams.ts +103 -103
  273. package/model/wTDynamicVoucherRedemption.ts +164 -164
  274. package/model/wTDynamicVoucherSummary.ts +169 -169
  275. package/model/wTDynamicVoucherUpdateParams.ts +103 -103
  276. package/model/wTEmployee.ts +109 -109
  277. package/model/wTEmployeeCreate.ts +61 -61
  278. package/model/wTEmployeeUpdate.ts +55 -55
  279. package/model/wTImportedList.ts +73 -73
  280. package/model/wTLinkBookCreateParams.ts +55 -55
  281. package/model/wTLinkBookSectionCreateParams.ts +31 -31
  282. package/model/wTLinkBookSectionUpdateParams.ts +31 -31
  283. package/model/wTLinkBookUpdateParams.ts +55 -55
  284. package/model/wTMember.ts +118 -118
  285. package/model/wTMemberCreationParams.ts +73 -73
  286. package/model/wTMembershipTier.ts +106 -106
  287. package/model/wTMembershipTierCreationParams.ts +64 -64
  288. package/model/wTMembershipTierUpdateParams.ts +64 -64
  289. package/model/wTMembershipTierWithMemberCount.ts +115 -115
  290. package/model/wTMerchantCredit.ts +106 -106
  291. package/model/wTMerchantCreditCreationParams.ts +49 -49
  292. package/model/wTMerchantURLCreate.ts +37 -37
  293. package/model/wTMerchantURLUpdate.ts +37 -37
  294. package/model/wTNewsArticleCreateParams.ts +55 -55
  295. package/model/wTNewsArticleUpdateParams.ts +55 -55
  296. package/model/wTOptInList.ts +121 -121
  297. package/model/wTOptInListCreationParams.ts +91 -91
  298. package/model/wTPaymentDesign.ts +139 -139
  299. package/model/wTPaymentDesignCreateParams.ts +115 -115
  300. package/model/wTPaymentDesignUpdateParams.ts +115 -115
  301. package/model/wTPerformanceCreateParams.ts +70 -70
  302. package/model/wTPerformanceUpdateParams.ts +70 -70
  303. package/model/wTPosMachine.ts +88 -88
  304. package/model/wTPosMachineCreateParams.ts +58 -58
  305. package/model/wTPosMachineUpdateParams.ts +58 -58
  306. package/model/wTPromoCodeCreateParams.ts +67 -67
  307. package/model/wTPromoCodeUpdateParams.ts +67 -67
  308. package/model/wTRole.ts +116 -116
  309. package/model/wTStaticVoucher.ts +224 -224
  310. package/model/wTStaticVoucherCampaign.ts +175 -175
  311. package/model/wTStaticVoucherCreateParams.ts +49 -49
  312. package/model/wTStaticVoucherUpdateParams.ts +43 -43
  313. package/model/wTWalletPageView.ts +251 -251
  314. package/model/wTWalletPageViewGeoPoint.ts +37 -37
  315. package/model/walletPageView.ts +251 -251
  316. package/model/webpage.ts +85 -85
  317. package/package.json +1 -26
  318. package/readme-generator.py +54 -42
  319. package/tsconfig.json +25 -25
@@ -1,589 +1,589 @@
1
- /**
2
- * wallet-api
3
- * API
4
- *
5
- * The version of the OpenAPI document: 1.1.3
6
- * Contact: development@wallet.inc
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
-
13
-
14
- import localVarRequest from 'request';
15
- import http from 'http';
16
-
17
- /* tslint:disable:no-unused-locals */
18
- import { AuthError } from '../model/authError';
19
- import { DuplicateRowFound } from '../model/duplicateRowFound';
20
- import { FalsumError } from '../model/falsumError';
21
- import { ForeignKeyDoesNotExist } from '../model/foreignKeyDoesNotExist';
22
- import { InternalServerError } from '../model/internalServerError';
23
- import { MerchantNotInitialized } from '../model/merchantNotInitialized';
24
- import { PickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID } from '../model/pickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID';
25
- import { WTAdvertisementCredit } from '../model/wTAdvertisementCredit';
26
- import { WTAdvertisementCreditScan } from '../model/wTAdvertisementCreditScan';
27
- import { WTAdvertisementCreditUpdateParams } from '../model/wTAdvertisementCreditUpdateParams';
28
-
29
- import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
30
- import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
31
-
32
- import { HttpError, RequestFile } from './apis';
33
-
34
- let defaultBasePath = 'https://api.wall.et';
35
-
36
- // ===============================================
37
- // This file is autogenerated - Please do not edit
38
- // ===============================================
39
-
40
- export enum AdvertisementCreditsApiApiKeys {
41
- api_key,
42
- }
43
-
44
- export class AdvertisementCreditsApi {
45
- protected _basePath = defaultBasePath;
46
- protected _defaultHeaders : any = {};
47
- protected _useQuerystring : boolean = false;
48
-
49
- protected authentications = {
50
- 'default': <Authentication>new VoidAuth(),
51
- 'api_key': new ApiKeyAuth('header', 'access-token'),
52
- }
53
-
54
- protected interceptors: Interceptor[] = [];
55
-
56
- constructor(basePath?: string);
57
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
58
- if (password) {
59
- if (basePath) {
60
- this.basePath = basePath;
61
- }
62
- } else {
63
- if (basePathOrUsername) {
64
- this.basePath = basePathOrUsername
65
- }
66
- }
67
- }
68
-
69
- set useQuerystring(value: boolean) {
70
- this._useQuerystring = value;
71
- }
72
-
73
- set basePath(basePath: string) {
74
- this._basePath = basePath;
75
- }
76
-
77
- set defaultHeaders(defaultHeaders: any) {
78
- this._defaultHeaders = defaultHeaders;
79
- }
80
-
81
- get defaultHeaders() {
82
- return this._defaultHeaders;
83
- }
84
-
85
- get basePath() {
86
- return this._basePath;
87
- }
88
-
89
- public setDefaultAuthentication(auth: Authentication) {
90
- this.authentications.default = auth;
91
- }
92
-
93
- public setApiKey(key: AdvertisementCreditsApiApiKeys, value: string) {
94
- (this.authentications as any)[AdvertisementCreditsApiApiKeys[key]].apiKey = value;
95
- }
96
-
97
- public addInterceptor(interceptor: Interceptor) {
98
- this.interceptors.push(interceptor);
99
- }
100
-
101
- /**
102
- *
103
- * @summary Archive ad credit
104
- * @param id
105
- */
106
- public async archiveAdvertisementCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
107
- const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
108
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
109
- let localVarQueryParameters: any = {};
110
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
111
- const produces = ['application/json'];
112
- // give precedence to 'application/json'
113
- if (produces.indexOf('application/json') >= 0) {
114
- localVarHeaderParams.Accept = 'application/json';
115
- } else {
116
- localVarHeaderParams.Accept = produces.join(',');
117
- }
118
- let localVarFormParams: any = {};
119
-
120
- // verify required parameter 'id' is not null or undefined
121
- if (id === null || id === undefined) {
122
- throw new Error('Required parameter id was null or undefined when calling archiveAdvertisementCredit.');
123
- }
124
-
125
- (<any>Object).assign(localVarHeaderParams, options.headers);
126
-
127
- let localVarUseFormData = false;
128
-
129
- let localVarRequestOptions: localVarRequest.Options = {
130
- method: 'DELETE',
131
- qs: localVarQueryParameters,
132
- headers: localVarHeaderParams,
133
- uri: localVarPath,
134
- useQuerystring: this._useQuerystring,
135
- json: true,
136
- };
137
-
138
- let authenticationPromise = Promise.resolve();
139
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
140
-
141
- let interceptorPromise = authenticationPromise;
142
- for (const interceptor of this.interceptors) {
143
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
144
- }
145
-
146
- return interceptorPromise.then(() => {
147
- if (Object.keys(localVarFormParams).length) {
148
- if (localVarUseFormData) {
149
- (<any>localVarRequestOptions).formData = localVarFormParams;
150
- } else {
151
- localVarRequestOptions.form = localVarFormParams;
152
- }
153
- }
154
- return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
155
- localVarRequest(localVarRequestOptions, (error, response, body) => {
156
- if (error) {
157
- reject(error);
158
- } else {
159
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
160
- body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
161
- resolve({ response: response, body: body });
162
- } else {
163
- reject(new HttpError(response, body, response.statusCode));
164
- }
165
- }
166
- });
167
- });
168
- });
169
- }
170
- /**
171
- *
172
- * @summary Create ad credit
173
- * @param body
174
- */
175
- public async createAdvertisementCredit (body: PickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
176
- const localVarPath = this.basePath + '/v1/payment/advertisementCredit';
177
- let localVarQueryParameters: any = {};
178
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
179
- const produces = ['application/json'];
180
- // give precedence to 'application/json'
181
- if (produces.indexOf('application/json') >= 0) {
182
- localVarHeaderParams.Accept = 'application/json';
183
- } else {
184
- localVarHeaderParams.Accept = produces.join(',');
185
- }
186
- let localVarFormParams: any = {};
187
-
188
- // verify required parameter 'body' is not null or undefined
189
- if (body === null || body === undefined) {
190
- throw new Error('Required parameter body was null or undefined when calling createAdvertisementCredit.');
191
- }
192
-
193
- (<any>Object).assign(localVarHeaderParams, options.headers);
194
-
195
- let localVarUseFormData = false;
196
-
197
- let localVarRequestOptions: localVarRequest.Options = {
198
- method: 'POST',
199
- qs: localVarQueryParameters,
200
- headers: localVarHeaderParams,
201
- uri: localVarPath,
202
- useQuerystring: this._useQuerystring,
203
- json: true,
204
- body: ObjectSerializer.serialize(body, "PickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID")
205
- };
206
-
207
- let authenticationPromise = Promise.resolve();
208
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
209
-
210
- let interceptorPromise = authenticationPromise;
211
- for (const interceptor of this.interceptors) {
212
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
213
- }
214
-
215
- return interceptorPromise.then(() => {
216
- if (Object.keys(localVarFormParams).length) {
217
- if (localVarUseFormData) {
218
- (<any>localVarRequestOptions).formData = localVarFormParams;
219
- } else {
220
- localVarRequestOptions.form = localVarFormParams;
221
- }
222
- }
223
- return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
224
- localVarRequest(localVarRequestOptions, (error, response, body) => {
225
- if (error) {
226
- reject(error);
227
- } else {
228
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
229
- body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
230
- resolve({ response: response, body: body });
231
- } else {
232
- reject(new HttpError(response, body, response.statusCode));
233
- }
234
- }
235
- });
236
- });
237
- });
238
- }
239
- /**
240
- *
241
- * @summary Fetch ad credit
242
- * @param id
243
- */
244
- public async fetchAdvertisementCreditById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
245
- const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
246
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
247
- let localVarQueryParameters: any = {};
248
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
249
- const produces = ['application/json'];
250
- // give precedence to 'application/json'
251
- if (produces.indexOf('application/json') >= 0) {
252
- localVarHeaderParams.Accept = 'application/json';
253
- } else {
254
- localVarHeaderParams.Accept = produces.join(',');
255
- }
256
- let localVarFormParams: any = {};
257
-
258
- // verify required parameter 'id' is not null or undefined
259
- if (id === null || id === undefined) {
260
- throw new Error('Required parameter id was null or undefined when calling fetchAdvertisementCreditById.');
261
- }
262
-
263
- (<any>Object).assign(localVarHeaderParams, options.headers);
264
-
265
- let localVarUseFormData = false;
266
-
267
- let localVarRequestOptions: localVarRequest.Options = {
268
- method: 'GET',
269
- qs: localVarQueryParameters,
270
- headers: localVarHeaderParams,
271
- uri: localVarPath,
272
- useQuerystring: this._useQuerystring,
273
- json: true,
274
- };
275
-
276
- let authenticationPromise = Promise.resolve();
277
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
278
-
279
- let interceptorPromise = authenticationPromise;
280
- for (const interceptor of this.interceptors) {
281
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
282
- }
283
-
284
- return interceptorPromise.then(() => {
285
- if (Object.keys(localVarFormParams).length) {
286
- if (localVarUseFormData) {
287
- (<any>localVarRequestOptions).formData = localVarFormParams;
288
- } else {
289
- localVarRequestOptions.form = localVarFormParams;
290
- }
291
- }
292
- return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
293
- localVarRequest(localVarRequestOptions, (error, response, body) => {
294
- if (error) {
295
- reject(error);
296
- } else {
297
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
298
- body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
299
- resolve({ response: response, body: body });
300
- } else {
301
- reject(new HttpError(response, body, response.statusCode));
302
- }
303
- }
304
- });
305
- });
306
- });
307
- }
308
- /**
309
- *
310
- * @summary Fetch scans
311
- * @param id
312
- */
313
- public async fetchAdvertisementCreditScans (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCreditScan>; }> {
314
- const localVarPath = this.basePath + '/v1/payment/advertisementCredit/scans/{id}'
315
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
316
- let localVarQueryParameters: any = {};
317
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
318
- const produces = ['application/json'];
319
- // give precedence to 'application/json'
320
- if (produces.indexOf('application/json') >= 0) {
321
- localVarHeaderParams.Accept = 'application/json';
322
- } else {
323
- localVarHeaderParams.Accept = produces.join(',');
324
- }
325
- let localVarFormParams: any = {};
326
-
327
- // verify required parameter 'id' is not null or undefined
328
- if (id === null || id === undefined) {
329
- throw new Error('Required parameter id was null or undefined when calling fetchAdvertisementCreditScans.');
330
- }
331
-
332
- (<any>Object).assign(localVarHeaderParams, options.headers);
333
-
334
- let localVarUseFormData = false;
335
-
336
- let localVarRequestOptions: localVarRequest.Options = {
337
- method: 'GET',
338
- qs: localVarQueryParameters,
339
- headers: localVarHeaderParams,
340
- uri: localVarPath,
341
- useQuerystring: this._useQuerystring,
342
- json: true,
343
- };
344
-
345
- let authenticationPromise = Promise.resolve();
346
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
347
-
348
- let interceptorPromise = authenticationPromise;
349
- for (const interceptor of this.interceptors) {
350
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
351
- }
352
-
353
- return interceptorPromise.then(() => {
354
- if (Object.keys(localVarFormParams).length) {
355
- if (localVarUseFormData) {
356
- (<any>localVarRequestOptions).formData = localVarFormParams;
357
- } else {
358
- localVarRequestOptions.form = localVarFormParams;
359
- }
360
- }
361
- return new Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCreditScan>; }>((resolve, reject) => {
362
- localVarRequest(localVarRequestOptions, (error, response, body) => {
363
- if (error) {
364
- reject(error);
365
- } else {
366
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
367
- body = ObjectSerializer.deserialize(body, "Array<WTAdvertisementCreditScan>");
368
- resolve({ response: response, body: body });
369
- } else {
370
- reject(new HttpError(response, body, response.statusCode));
371
- }
372
- }
373
- });
374
- });
375
- });
376
- }
377
- /**
378
- *
379
- * @summary Fetch all active ad credits
380
- * @param isArchiveIncluded
381
- */
382
- public async fetchAllAdvertisementCredits (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCredit>; }> {
383
- const localVarPath = this.basePath + '/v1/payment/advertisementCredit/all';
384
- let localVarQueryParameters: any = {};
385
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
386
- const produces = ['application/json'];
387
- // give precedence to 'application/json'
388
- if (produces.indexOf('application/json') >= 0) {
389
- localVarHeaderParams.Accept = 'application/json';
390
- } else {
391
- localVarHeaderParams.Accept = produces.join(',');
392
- }
393
- let localVarFormParams: any = {};
394
-
395
- if (isArchiveIncluded !== undefined) {
396
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
397
- }
398
-
399
- (<any>Object).assign(localVarHeaderParams, options.headers);
400
-
401
- let localVarUseFormData = false;
402
-
403
- let localVarRequestOptions: localVarRequest.Options = {
404
- method: 'GET',
405
- qs: localVarQueryParameters,
406
- headers: localVarHeaderParams,
407
- uri: localVarPath,
408
- useQuerystring: this._useQuerystring,
409
- json: true,
410
- };
411
-
412
- let authenticationPromise = Promise.resolve();
413
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
414
-
415
- let interceptorPromise = authenticationPromise;
416
- for (const interceptor of this.interceptors) {
417
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
418
- }
419
-
420
- return interceptorPromise.then(() => {
421
- if (Object.keys(localVarFormParams).length) {
422
- if (localVarUseFormData) {
423
- (<any>localVarRequestOptions).formData = localVarFormParams;
424
- } else {
425
- localVarRequestOptions.form = localVarFormParams;
426
- }
427
- }
428
- return new Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCredit>; }>((resolve, reject) => {
429
- localVarRequest(localVarRequestOptions, (error, response, body) => {
430
- if (error) {
431
- reject(error);
432
- } else {
433
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
434
- body = ObjectSerializer.deserialize(body, "Array<WTAdvertisementCredit>");
435
- resolve({ response: response, body: body });
436
- } else {
437
- reject(new HttpError(response, body, response.statusCode));
438
- }
439
- }
440
- });
441
- });
442
- });
443
- }
444
- /**
445
- *
446
- * @summary Restore ad credit
447
- * @param id
448
- */
449
- public async restoreAdvertisementCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
450
- const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
451
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
452
- let localVarQueryParameters: any = {};
453
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
454
- const produces = ['application/json'];
455
- // give precedence to 'application/json'
456
- if (produces.indexOf('application/json') >= 0) {
457
- localVarHeaderParams.Accept = 'application/json';
458
- } else {
459
- localVarHeaderParams.Accept = produces.join(',');
460
- }
461
- let localVarFormParams: any = {};
462
-
463
- // verify required parameter 'id' is not null or undefined
464
- if (id === null || id === undefined) {
465
- throw new Error('Required parameter id was null or undefined when calling restoreAdvertisementCredit.');
466
- }
467
-
468
- (<any>Object).assign(localVarHeaderParams, options.headers);
469
-
470
- let localVarUseFormData = false;
471
-
472
- let localVarRequestOptions: localVarRequest.Options = {
473
- method: 'PATCH',
474
- qs: localVarQueryParameters,
475
- headers: localVarHeaderParams,
476
- uri: localVarPath,
477
- useQuerystring: this._useQuerystring,
478
- json: true,
479
- };
480
-
481
- let authenticationPromise = Promise.resolve();
482
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
483
-
484
- let interceptorPromise = authenticationPromise;
485
- for (const interceptor of this.interceptors) {
486
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
487
- }
488
-
489
- return interceptorPromise.then(() => {
490
- if (Object.keys(localVarFormParams).length) {
491
- if (localVarUseFormData) {
492
- (<any>localVarRequestOptions).formData = localVarFormParams;
493
- } else {
494
- localVarRequestOptions.form = localVarFormParams;
495
- }
496
- }
497
- return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
498
- localVarRequest(localVarRequestOptions, (error, response, body) => {
499
- if (error) {
500
- reject(error);
501
- } else {
502
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
503
- body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
504
- resolve({ response: response, body: body });
505
- } else {
506
- reject(new HttpError(response, body, response.statusCode));
507
- }
508
- }
509
- });
510
- });
511
- });
512
- }
513
- /**
514
- *
515
- * @summary Update ad credit
516
- * @param id
517
- * @param wTAdvertisementCreditUpdateParams
518
- */
519
- public async updateAdvertisementCredit (id: any, wTAdvertisementCreditUpdateParams: WTAdvertisementCreditUpdateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
520
- const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
521
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
522
- let localVarQueryParameters: any = {};
523
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
524
- const produces = ['application/json'];
525
- // give precedence to 'application/json'
526
- if (produces.indexOf('application/json') >= 0) {
527
- localVarHeaderParams.Accept = 'application/json';
528
- } else {
529
- localVarHeaderParams.Accept = produces.join(',');
530
- }
531
- let localVarFormParams: any = {};
532
-
533
- // verify required parameter 'id' is not null or undefined
534
- if (id === null || id === undefined) {
535
- throw new Error('Required parameter id was null or undefined when calling updateAdvertisementCredit.');
536
- }
537
-
538
- // verify required parameter 'wTAdvertisementCreditUpdateParams' is not null or undefined
539
- if (wTAdvertisementCreditUpdateParams === null || wTAdvertisementCreditUpdateParams === undefined) {
540
- throw new Error('Required parameter wTAdvertisementCreditUpdateParams was null or undefined when calling updateAdvertisementCredit.');
541
- }
542
-
543
- (<any>Object).assign(localVarHeaderParams, options.headers);
544
-
545
- let localVarUseFormData = false;
546
-
547
- let localVarRequestOptions: localVarRequest.Options = {
548
- method: 'PUT',
549
- qs: localVarQueryParameters,
550
- headers: localVarHeaderParams,
551
- uri: localVarPath,
552
- useQuerystring: this._useQuerystring,
553
- json: true,
554
- body: ObjectSerializer.serialize(wTAdvertisementCreditUpdateParams, "WTAdvertisementCreditUpdateParams")
555
- };
556
-
557
- let authenticationPromise = Promise.resolve();
558
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
559
-
560
- let interceptorPromise = authenticationPromise;
561
- for (const interceptor of this.interceptors) {
562
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
563
- }
564
-
565
- return interceptorPromise.then(() => {
566
- if (Object.keys(localVarFormParams).length) {
567
- if (localVarUseFormData) {
568
- (<any>localVarRequestOptions).formData = localVarFormParams;
569
- } else {
570
- localVarRequestOptions.form = localVarFormParams;
571
- }
572
- }
573
- return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
574
- localVarRequest(localVarRequestOptions, (error, response, body) => {
575
- if (error) {
576
- reject(error);
577
- } else {
578
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
579
- body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
580
- resolve({ response: response, body: body });
581
- } else {
582
- reject(new HttpError(response, body, response.statusCode));
583
- }
584
- }
585
- });
586
- });
587
- });
588
- }
589
- }
1
+ /**
2
+ * wallet-api
3
+ * API
4
+ *
5
+ * The version of the OpenAPI document: 1.1.6
6
+ * Contact: development@wallet.inc
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+
13
+
14
+ import localVarRequest from 'request';
15
+ import http from 'http';
16
+
17
+ /* tslint:disable:no-unused-locals */
18
+ import { AuthError } from '../model/authError';
19
+ import { DuplicateRowFound } from '../model/duplicateRowFound';
20
+ import { FalsumError } from '../model/falsumError';
21
+ import { ForeignKeyDoesNotExist } from '../model/foreignKeyDoesNotExist';
22
+ import { InternalServerError } from '../model/internalServerError';
23
+ import { MerchantNotInitialized } from '../model/merchantNotInitialized';
24
+ import { PickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID } from '../model/pickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID';
25
+ import { WTAdvertisementCredit } from '../model/wTAdvertisementCredit';
26
+ import { WTAdvertisementCreditScan } from '../model/wTAdvertisementCreditScan';
27
+ import { WTAdvertisementCreditUpdateParams } from '../model/wTAdvertisementCreditUpdateParams';
28
+
29
+ import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
30
+ import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
31
+
32
+ import { HttpError, RequestFile } from './apis';
33
+
34
+ let defaultBasePath = 'https://api.wall.et';
35
+
36
+ // ===============================================
37
+ // This file is autogenerated - Please do not edit
38
+ // ===============================================
39
+
40
+ export enum AdvertisementCreditsApiApiKeys {
41
+ api_key,
42
+ }
43
+
44
+ export class AdvertisementCreditsApi {
45
+ protected _basePath = defaultBasePath;
46
+ protected _defaultHeaders : any = {};
47
+ protected _useQuerystring : boolean = false;
48
+
49
+ protected authentications = {
50
+ 'default': <Authentication>new VoidAuth(),
51
+ 'api_key': new ApiKeyAuth('header', 'access-token'),
52
+ }
53
+
54
+ protected interceptors: Interceptor[] = [];
55
+
56
+ constructor(basePath?: string);
57
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
58
+ if (password) {
59
+ if (basePath) {
60
+ this.basePath = basePath;
61
+ }
62
+ } else {
63
+ if (basePathOrUsername) {
64
+ this.basePath = basePathOrUsername
65
+ }
66
+ }
67
+ }
68
+
69
+ set useQuerystring(value: boolean) {
70
+ this._useQuerystring = value;
71
+ }
72
+
73
+ set basePath(basePath: string) {
74
+ this._basePath = basePath;
75
+ }
76
+
77
+ set defaultHeaders(defaultHeaders: any) {
78
+ this._defaultHeaders = defaultHeaders;
79
+ }
80
+
81
+ get defaultHeaders() {
82
+ return this._defaultHeaders;
83
+ }
84
+
85
+ get basePath() {
86
+ return this._basePath;
87
+ }
88
+
89
+ public setDefaultAuthentication(auth: Authentication) {
90
+ this.authentications.default = auth;
91
+ }
92
+
93
+ public setApiKey(key: AdvertisementCreditsApiApiKeys, value: string) {
94
+ (this.authentications as any)[AdvertisementCreditsApiApiKeys[key]].apiKey = value;
95
+ }
96
+
97
+ public addInterceptor(interceptor: Interceptor) {
98
+ this.interceptors.push(interceptor);
99
+ }
100
+
101
+ /**
102
+ *
103
+ * @summary Archive ad credit
104
+ * @param id
105
+ */
106
+ public async archiveAdvertisementCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
107
+ const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
108
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
109
+ let localVarQueryParameters: any = {};
110
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
111
+ const produces = ['application/json'];
112
+ // give precedence to 'application/json'
113
+ if (produces.indexOf('application/json') >= 0) {
114
+ localVarHeaderParams.Accept = 'application/json';
115
+ } else {
116
+ localVarHeaderParams.Accept = produces.join(',');
117
+ }
118
+ let localVarFormParams: any = {};
119
+
120
+ // verify required parameter 'id' is not null or undefined
121
+ if (id === null || id === undefined) {
122
+ throw new Error('Required parameter id was null or undefined when calling archiveAdvertisementCredit.');
123
+ }
124
+
125
+ (<any>Object).assign(localVarHeaderParams, options.headers);
126
+
127
+ let localVarUseFormData = false;
128
+
129
+ let localVarRequestOptions: localVarRequest.Options = {
130
+ method: 'DELETE',
131
+ qs: localVarQueryParameters,
132
+ headers: localVarHeaderParams,
133
+ uri: localVarPath,
134
+ useQuerystring: this._useQuerystring,
135
+ json: true,
136
+ };
137
+
138
+ let authenticationPromise = Promise.resolve();
139
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
140
+
141
+ let interceptorPromise = authenticationPromise;
142
+ for (const interceptor of this.interceptors) {
143
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
144
+ }
145
+
146
+ return interceptorPromise.then(() => {
147
+ if (Object.keys(localVarFormParams).length) {
148
+ if (localVarUseFormData) {
149
+ (<any>localVarRequestOptions).formData = localVarFormParams;
150
+ } else {
151
+ localVarRequestOptions.form = localVarFormParams;
152
+ }
153
+ }
154
+ return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
155
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
156
+ if (error) {
157
+ reject(error);
158
+ } else {
159
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
160
+ body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
161
+ resolve({ response: response, body: body });
162
+ } else {
163
+ reject(new HttpError(response, body, response.statusCode));
164
+ }
165
+ }
166
+ });
167
+ });
168
+ });
169
+ }
170
+ /**
171
+ *
172
+ * @summary Create ad credit
173
+ * @param body
174
+ */
175
+ public async createAdvertisementCredit (body: PickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
176
+ const localVarPath = this.basePath + '/v1/payment/advertisementCredit';
177
+ let localVarQueryParameters: any = {};
178
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
179
+ const produces = ['application/json'];
180
+ // give precedence to 'application/json'
181
+ if (produces.indexOf('application/json') >= 0) {
182
+ localVarHeaderParams.Accept = 'application/json';
183
+ } else {
184
+ localVarHeaderParams.Accept = produces.join(',');
185
+ }
186
+ let localVarFormParams: any = {};
187
+
188
+ // verify required parameter 'body' is not null or undefined
189
+ if (body === null || body === undefined) {
190
+ throw new Error('Required parameter body was null or undefined when calling createAdvertisementCredit.');
191
+ }
192
+
193
+ (<any>Object).assign(localVarHeaderParams, options.headers);
194
+
195
+ let localVarUseFormData = false;
196
+
197
+ let localVarRequestOptions: localVarRequest.Options = {
198
+ method: 'POST',
199
+ qs: localVarQueryParameters,
200
+ headers: localVarHeaderParams,
201
+ uri: localVarPath,
202
+ useQuerystring: this._useQuerystring,
203
+ json: true,
204
+ body: ObjectSerializer.serialize(body, "PickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID")
205
+ };
206
+
207
+ let authenticationPromise = Promise.resolve();
208
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
209
+
210
+ let interceptorPromise = authenticationPromise;
211
+ for (const interceptor of this.interceptors) {
212
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
213
+ }
214
+
215
+ return interceptorPromise.then(() => {
216
+ if (Object.keys(localVarFormParams).length) {
217
+ if (localVarUseFormData) {
218
+ (<any>localVarRequestOptions).formData = localVarFormParams;
219
+ } else {
220
+ localVarRequestOptions.form = localVarFormParams;
221
+ }
222
+ }
223
+ return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
224
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
225
+ if (error) {
226
+ reject(error);
227
+ } else {
228
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
229
+ body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
230
+ resolve({ response: response, body: body });
231
+ } else {
232
+ reject(new HttpError(response, body, response.statusCode));
233
+ }
234
+ }
235
+ });
236
+ });
237
+ });
238
+ }
239
+ /**
240
+ *
241
+ * @summary Fetch ad credit
242
+ * @param id
243
+ */
244
+ public async fetchAdvertisementCreditById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
245
+ const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
246
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
247
+ let localVarQueryParameters: any = {};
248
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
249
+ const produces = ['application/json'];
250
+ // give precedence to 'application/json'
251
+ if (produces.indexOf('application/json') >= 0) {
252
+ localVarHeaderParams.Accept = 'application/json';
253
+ } else {
254
+ localVarHeaderParams.Accept = produces.join(',');
255
+ }
256
+ let localVarFormParams: any = {};
257
+
258
+ // verify required parameter 'id' is not null or undefined
259
+ if (id === null || id === undefined) {
260
+ throw new Error('Required parameter id was null or undefined when calling fetchAdvertisementCreditById.');
261
+ }
262
+
263
+ (<any>Object).assign(localVarHeaderParams, options.headers);
264
+
265
+ let localVarUseFormData = false;
266
+
267
+ let localVarRequestOptions: localVarRequest.Options = {
268
+ method: 'GET',
269
+ qs: localVarQueryParameters,
270
+ headers: localVarHeaderParams,
271
+ uri: localVarPath,
272
+ useQuerystring: this._useQuerystring,
273
+ json: true,
274
+ };
275
+
276
+ let authenticationPromise = Promise.resolve();
277
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
278
+
279
+ let interceptorPromise = authenticationPromise;
280
+ for (const interceptor of this.interceptors) {
281
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
282
+ }
283
+
284
+ return interceptorPromise.then(() => {
285
+ if (Object.keys(localVarFormParams).length) {
286
+ if (localVarUseFormData) {
287
+ (<any>localVarRequestOptions).formData = localVarFormParams;
288
+ } else {
289
+ localVarRequestOptions.form = localVarFormParams;
290
+ }
291
+ }
292
+ return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
293
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
294
+ if (error) {
295
+ reject(error);
296
+ } else {
297
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
298
+ body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
299
+ resolve({ response: response, body: body });
300
+ } else {
301
+ reject(new HttpError(response, body, response.statusCode));
302
+ }
303
+ }
304
+ });
305
+ });
306
+ });
307
+ }
308
+ /**
309
+ *
310
+ * @summary Fetch scans
311
+ * @param id
312
+ */
313
+ public async fetchAdvertisementCreditScans (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCreditScan>; }> {
314
+ const localVarPath = this.basePath + '/v1/payment/advertisementCredit/scans/{id}'
315
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
316
+ let localVarQueryParameters: any = {};
317
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
318
+ const produces = ['application/json'];
319
+ // give precedence to 'application/json'
320
+ if (produces.indexOf('application/json') >= 0) {
321
+ localVarHeaderParams.Accept = 'application/json';
322
+ } else {
323
+ localVarHeaderParams.Accept = produces.join(',');
324
+ }
325
+ let localVarFormParams: any = {};
326
+
327
+ // verify required parameter 'id' is not null or undefined
328
+ if (id === null || id === undefined) {
329
+ throw new Error('Required parameter id was null or undefined when calling fetchAdvertisementCreditScans.');
330
+ }
331
+
332
+ (<any>Object).assign(localVarHeaderParams, options.headers);
333
+
334
+ let localVarUseFormData = false;
335
+
336
+ let localVarRequestOptions: localVarRequest.Options = {
337
+ method: 'GET',
338
+ qs: localVarQueryParameters,
339
+ headers: localVarHeaderParams,
340
+ uri: localVarPath,
341
+ useQuerystring: this._useQuerystring,
342
+ json: true,
343
+ };
344
+
345
+ let authenticationPromise = Promise.resolve();
346
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
347
+
348
+ let interceptorPromise = authenticationPromise;
349
+ for (const interceptor of this.interceptors) {
350
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
351
+ }
352
+
353
+ return interceptorPromise.then(() => {
354
+ if (Object.keys(localVarFormParams).length) {
355
+ if (localVarUseFormData) {
356
+ (<any>localVarRequestOptions).formData = localVarFormParams;
357
+ } else {
358
+ localVarRequestOptions.form = localVarFormParams;
359
+ }
360
+ }
361
+ return new Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCreditScan>; }>((resolve, reject) => {
362
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
363
+ if (error) {
364
+ reject(error);
365
+ } else {
366
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
367
+ body = ObjectSerializer.deserialize(body, "Array<WTAdvertisementCreditScan>");
368
+ resolve({ response: response, body: body });
369
+ } else {
370
+ reject(new HttpError(response, body, response.statusCode));
371
+ }
372
+ }
373
+ });
374
+ });
375
+ });
376
+ }
377
+ /**
378
+ *
379
+ * @summary Fetch all active ad credits
380
+ * @param isArchiveIncluded
381
+ */
382
+ public async fetchAllAdvertisementCredits (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCredit>; }> {
383
+ const localVarPath = this.basePath + '/v1/payment/advertisementCredit/all';
384
+ let localVarQueryParameters: any = {};
385
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
386
+ const produces = ['application/json'];
387
+ // give precedence to 'application/json'
388
+ if (produces.indexOf('application/json') >= 0) {
389
+ localVarHeaderParams.Accept = 'application/json';
390
+ } else {
391
+ localVarHeaderParams.Accept = produces.join(',');
392
+ }
393
+ let localVarFormParams: any = {};
394
+
395
+ if (isArchiveIncluded !== undefined) {
396
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
397
+ }
398
+
399
+ (<any>Object).assign(localVarHeaderParams, options.headers);
400
+
401
+ let localVarUseFormData = false;
402
+
403
+ let localVarRequestOptions: localVarRequest.Options = {
404
+ method: 'GET',
405
+ qs: localVarQueryParameters,
406
+ headers: localVarHeaderParams,
407
+ uri: localVarPath,
408
+ useQuerystring: this._useQuerystring,
409
+ json: true,
410
+ };
411
+
412
+ let authenticationPromise = Promise.resolve();
413
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
414
+
415
+ let interceptorPromise = authenticationPromise;
416
+ for (const interceptor of this.interceptors) {
417
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
418
+ }
419
+
420
+ return interceptorPromise.then(() => {
421
+ if (Object.keys(localVarFormParams).length) {
422
+ if (localVarUseFormData) {
423
+ (<any>localVarRequestOptions).formData = localVarFormParams;
424
+ } else {
425
+ localVarRequestOptions.form = localVarFormParams;
426
+ }
427
+ }
428
+ return new Promise<{ response: http.IncomingMessage; body: Array<WTAdvertisementCredit>; }>((resolve, reject) => {
429
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
430
+ if (error) {
431
+ reject(error);
432
+ } else {
433
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
434
+ body = ObjectSerializer.deserialize(body, "Array<WTAdvertisementCredit>");
435
+ resolve({ response: response, body: body });
436
+ } else {
437
+ reject(new HttpError(response, body, response.statusCode));
438
+ }
439
+ }
440
+ });
441
+ });
442
+ });
443
+ }
444
+ /**
445
+ *
446
+ * @summary Restore ad credit
447
+ * @param id
448
+ */
449
+ public async restoreAdvertisementCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
450
+ const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
451
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
452
+ let localVarQueryParameters: any = {};
453
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
454
+ const produces = ['application/json'];
455
+ // give precedence to 'application/json'
456
+ if (produces.indexOf('application/json') >= 0) {
457
+ localVarHeaderParams.Accept = 'application/json';
458
+ } else {
459
+ localVarHeaderParams.Accept = produces.join(',');
460
+ }
461
+ let localVarFormParams: any = {};
462
+
463
+ // verify required parameter 'id' is not null or undefined
464
+ if (id === null || id === undefined) {
465
+ throw new Error('Required parameter id was null or undefined when calling restoreAdvertisementCredit.');
466
+ }
467
+
468
+ (<any>Object).assign(localVarHeaderParams, options.headers);
469
+
470
+ let localVarUseFormData = false;
471
+
472
+ let localVarRequestOptions: localVarRequest.Options = {
473
+ method: 'PATCH',
474
+ qs: localVarQueryParameters,
475
+ headers: localVarHeaderParams,
476
+ uri: localVarPath,
477
+ useQuerystring: this._useQuerystring,
478
+ json: true,
479
+ };
480
+
481
+ let authenticationPromise = Promise.resolve();
482
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
483
+
484
+ let interceptorPromise = authenticationPromise;
485
+ for (const interceptor of this.interceptors) {
486
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
487
+ }
488
+
489
+ return interceptorPromise.then(() => {
490
+ if (Object.keys(localVarFormParams).length) {
491
+ if (localVarUseFormData) {
492
+ (<any>localVarRequestOptions).formData = localVarFormParams;
493
+ } else {
494
+ localVarRequestOptions.form = localVarFormParams;
495
+ }
496
+ }
497
+ return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
498
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
499
+ if (error) {
500
+ reject(error);
501
+ } else {
502
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
503
+ body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
504
+ resolve({ response: response, body: body });
505
+ } else {
506
+ reject(new HttpError(response, body, response.statusCode));
507
+ }
508
+ }
509
+ });
510
+ });
511
+ });
512
+ }
513
+ /**
514
+ *
515
+ * @summary Update ad credit
516
+ * @param id
517
+ * @param wTAdvertisementCreditUpdateParams
518
+ */
519
+ public async updateAdvertisementCredit (id: any, wTAdvertisementCreditUpdateParams: WTAdvertisementCreditUpdateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }> {
520
+ const localVarPath = this.basePath + '/v1/payment/advertisementCredit/{id}'
521
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
522
+ let localVarQueryParameters: any = {};
523
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
524
+ const produces = ['application/json'];
525
+ // give precedence to 'application/json'
526
+ if (produces.indexOf('application/json') >= 0) {
527
+ localVarHeaderParams.Accept = 'application/json';
528
+ } else {
529
+ localVarHeaderParams.Accept = produces.join(',');
530
+ }
531
+ let localVarFormParams: any = {};
532
+
533
+ // verify required parameter 'id' is not null or undefined
534
+ if (id === null || id === undefined) {
535
+ throw new Error('Required parameter id was null or undefined when calling updateAdvertisementCredit.');
536
+ }
537
+
538
+ // verify required parameter 'wTAdvertisementCreditUpdateParams' is not null or undefined
539
+ if (wTAdvertisementCreditUpdateParams === null || wTAdvertisementCreditUpdateParams === undefined) {
540
+ throw new Error('Required parameter wTAdvertisementCreditUpdateParams was null or undefined when calling updateAdvertisementCredit.');
541
+ }
542
+
543
+ (<any>Object).assign(localVarHeaderParams, options.headers);
544
+
545
+ let localVarUseFormData = false;
546
+
547
+ let localVarRequestOptions: localVarRequest.Options = {
548
+ method: 'PUT',
549
+ qs: localVarQueryParameters,
550
+ headers: localVarHeaderParams,
551
+ uri: localVarPath,
552
+ useQuerystring: this._useQuerystring,
553
+ json: true,
554
+ body: ObjectSerializer.serialize(wTAdvertisementCreditUpdateParams, "WTAdvertisementCreditUpdateParams")
555
+ };
556
+
557
+ let authenticationPromise = Promise.resolve();
558
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
559
+
560
+ let interceptorPromise = authenticationPromise;
561
+ for (const interceptor of this.interceptors) {
562
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
563
+ }
564
+
565
+ return interceptorPromise.then(() => {
566
+ if (Object.keys(localVarFormParams).length) {
567
+ if (localVarUseFormData) {
568
+ (<any>localVarRequestOptions).formData = localVarFormParams;
569
+ } else {
570
+ localVarRequestOptions.form = localVarFormParams;
571
+ }
572
+ }
573
+ return new Promise<{ response: http.IncomingMessage; body: WTAdvertisementCredit; }>((resolve, reject) => {
574
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
575
+ if (error) {
576
+ reject(error);
577
+ } else {
578
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
579
+ body = ObjectSerializer.deserialize(body, "WTAdvertisementCredit");
580
+ resolve({ response: response, body: body });
581
+ } else {
582
+ reject(new HttpError(response, body, response.statusCode));
583
+ }
584
+ }
585
+ });
586
+ });
587
+ });
588
+ }
589
+ }