wallet 1.1.3 → 1.1.4

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