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,1534 +1,1534 @@
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 { AdvertisementCreditBroadcast } from '../model/advertisementCreditBroadcast';
19
- import { AuthError } from '../model/authError';
20
- import { DynamicVoucherBroadcast } from '../model/dynamicVoucherBroadcast';
21
- import { FalsumError } from '../model/falsumError';
22
- import { InlineObject21 } from '../model/inlineObject21';
23
- import { InlineObject22 } from '../model/inlineObject22';
24
- import { InlineObject23 } from '../model/inlineObject23';
25
- import { InternalServerError } from '../model/internalServerError';
26
- import { SimpleSMSBroadcast } from '../model/simpleSMSBroadcast';
27
- import { StaticVoucherCampaignBroadcast } from '../model/staticVoucherCampaignBroadcast';
28
- import { Tcpa } from '../model/tcpa';
29
-
30
- import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
31
- import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
32
-
33
- import { HttpError, RequestFile } from './apis';
34
-
35
- let defaultBasePath = 'https://api.wall.et';
36
-
37
- // ===============================================
38
- // This file is autogenerated - Please do not edit
39
- // ===============================================
40
-
41
- export enum MerchantApiApiKeys {
42
- api_key,
43
- }
44
-
45
- export class MerchantApi {
46
- protected _basePath = defaultBasePath;
47
- protected _defaultHeaders : any = {};
48
- protected _useQuerystring : boolean = false;
49
-
50
- protected authentications = {
51
- 'default': <Authentication>new VoidAuth(),
52
- 'api_key': new ApiKeyAuth('header', 'access-token'),
53
- }
54
-
55
- protected interceptors: Interceptor[] = [];
56
-
57
- constructor(basePath?: string);
58
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
59
- if (password) {
60
- if (basePath) {
61
- this.basePath = basePath;
62
- }
63
- } else {
64
- if (basePathOrUsername) {
65
- this.basePath = basePathOrUsername
66
- }
67
- }
68
- }
69
-
70
- set useQuerystring(value: boolean) {
71
- this._useQuerystring = value;
72
- }
73
-
74
- set basePath(basePath: string) {
75
- this._basePath = basePath;
76
- }
77
-
78
- set defaultHeaders(defaultHeaders: any) {
79
- this._defaultHeaders = defaultHeaders;
80
- }
81
-
82
- get defaultHeaders() {
83
- return this._defaultHeaders;
84
- }
85
-
86
- get basePath() {
87
- return this._basePath;
88
- }
89
-
90
- public setDefaultAuthentication(auth: Authentication) {
91
- this.authentications.default = auth;
92
- }
93
-
94
- public setApiKey(key: MerchantApiApiKeys, value: string) {
95
- (this.authentications as any)[MerchantApiApiKeys[key]].apiKey = value;
96
- }
97
-
98
- public addInterceptor(interceptor: Interceptor) {
99
- this.interceptors.push(interceptor);
100
- }
101
-
102
- /**
103
- *
104
- * @summary Archive payment object broadcast
105
- * @param broadcastID
106
- */
107
- public async archivePaymentObjectBroadcast (broadcastID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
108
- const localVarPath = this.basePath + '/v1/merchant/paymentObjectBroadcast/{broadcastID}'
109
- .replace('{' + 'broadcastID' + '}', encodeURIComponent(String(broadcastID)));
110
- let localVarQueryParameters: any = {};
111
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
112
- const produces = ['application/json'];
113
- // give precedence to 'application/json'
114
- if (produces.indexOf('application/json') >= 0) {
115
- localVarHeaderParams.Accept = 'application/json';
116
- } else {
117
- localVarHeaderParams.Accept = produces.join(',');
118
- }
119
- let localVarFormParams: any = {};
120
-
121
- // verify required parameter 'broadcastID' is not null or undefined
122
- if (broadcastID === null || broadcastID === undefined) {
123
- throw new Error('Required parameter broadcastID was null or undefined when calling archivePaymentObjectBroadcast.');
124
- }
125
-
126
- (<any>Object).assign(localVarHeaderParams, options.headers);
127
-
128
- let localVarUseFormData = false;
129
-
130
- let localVarRequestOptions: localVarRequest.Options = {
131
- method: 'DELETE',
132
- qs: localVarQueryParameters,
133
- headers: localVarHeaderParams,
134
- uri: localVarPath,
135
- useQuerystring: this._useQuerystring,
136
- json: true,
137
- };
138
-
139
- let authenticationPromise = Promise.resolve();
140
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
141
-
142
- let interceptorPromise = authenticationPromise;
143
- for (const interceptor of this.interceptors) {
144
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
145
- }
146
-
147
- return interceptorPromise.then(() => {
148
- if (Object.keys(localVarFormParams).length) {
149
- if (localVarUseFormData) {
150
- (<any>localVarRequestOptions).formData = localVarFormParams;
151
- } else {
152
- localVarRequestOptions.form = localVarFormParams;
153
- }
154
- }
155
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
156
- localVarRequest(localVarRequestOptions, (error, response, body) => {
157
- if (error) {
158
- reject(error);
159
- } else {
160
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
161
- body = ObjectSerializer.deserialize(body, "any");
162
- resolve({ response: response, body: body });
163
- } else {
164
- reject(new HttpError(response, body, response.statusCode));
165
- }
166
- }
167
- });
168
- });
169
- });
170
- }
171
- /**
172
- *
173
- * @summary Fetch all ad credit broadcasts
174
- * @param isArchiveIncluded
175
- */
176
- public async fetchAdvertisementCreditBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<AdvertisementCreditBroadcast>; }> {
177
- const localVarPath = this.basePath + '/v1/merchant/broadcasts/adCredits/all';
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
- if (isArchiveIncluded !== undefined) {
190
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
191
- }
192
-
193
- (<any>Object).assign(localVarHeaderParams, options.headers);
194
-
195
- let localVarUseFormData = false;
196
-
197
- let localVarRequestOptions: localVarRequest.Options = {
198
- method: 'GET',
199
- qs: localVarQueryParameters,
200
- headers: localVarHeaderParams,
201
- uri: localVarPath,
202
- useQuerystring: this._useQuerystring,
203
- json: true,
204
- };
205
-
206
- let authenticationPromise = Promise.resolve();
207
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
208
-
209
- let interceptorPromise = authenticationPromise;
210
- for (const interceptor of this.interceptors) {
211
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
212
- }
213
-
214
- return interceptorPromise.then(() => {
215
- if (Object.keys(localVarFormParams).length) {
216
- if (localVarUseFormData) {
217
- (<any>localVarRequestOptions).formData = localVarFormParams;
218
- } else {
219
- localVarRequestOptions.form = localVarFormParams;
220
- }
221
- }
222
- return new Promise<{ response: http.IncomingMessage; body: Array<AdvertisementCreditBroadcast>; }>((resolve, reject) => {
223
- localVarRequest(localVarRequestOptions, (error, response, body) => {
224
- if (error) {
225
- reject(error);
226
- } else {
227
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
228
- body = ObjectSerializer.deserialize(body, "Array<AdvertisementCreditBroadcast>");
229
- resolve({ response: response, body: body });
230
- } else {
231
- reject(new HttpError(response, body, response.statusCode));
232
- }
233
- }
234
- });
235
- });
236
- });
237
- }
238
- /**
239
- *
240
- * @summary Fetch custom roles
241
- */
242
- public async fetchCustomRoles (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
243
- const localVarPath = this.basePath + '/v1/merchant/roles/custom';
244
- let localVarQueryParameters: any = {};
245
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
246
- const produces = ['application/json'];
247
- // give precedence to 'application/json'
248
- if (produces.indexOf('application/json') >= 0) {
249
- localVarHeaderParams.Accept = 'application/json';
250
- } else {
251
- localVarHeaderParams.Accept = produces.join(',');
252
- }
253
- let localVarFormParams: any = {};
254
-
255
- (<any>Object).assign(localVarHeaderParams, options.headers);
256
-
257
- let localVarUseFormData = false;
258
-
259
- let localVarRequestOptions: localVarRequest.Options = {
260
- method: 'GET',
261
- qs: localVarQueryParameters,
262
- headers: localVarHeaderParams,
263
- uri: localVarPath,
264
- useQuerystring: this._useQuerystring,
265
- json: true,
266
- };
267
-
268
- let authenticationPromise = Promise.resolve();
269
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
270
-
271
- let interceptorPromise = authenticationPromise;
272
- for (const interceptor of this.interceptors) {
273
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
274
- }
275
-
276
- return interceptorPromise.then(() => {
277
- if (Object.keys(localVarFormParams).length) {
278
- if (localVarUseFormData) {
279
- (<any>localVarRequestOptions).formData = localVarFormParams;
280
- } else {
281
- localVarRequestOptions.form = localVarFormParams;
282
- }
283
- }
284
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
285
- localVarRequest(localVarRequestOptions, (error, response, body) => {
286
- if (error) {
287
- reject(error);
288
- } else {
289
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
290
- body = ObjectSerializer.deserialize(body, "any");
291
- resolve({ response: response, body: body });
292
- } else {
293
- reject(new HttpError(response, body, response.statusCode));
294
- }
295
- }
296
- });
297
- });
298
- });
299
- }
300
- /**
301
- *
302
- * @summary Fetch all dynamic voucher broadcasts
303
- * @param isArchiveIncluded
304
- */
305
- public async fetchDynamicVoucherBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<DynamicVoucherBroadcast>; }> {
306
- const localVarPath = this.basePath + '/v1/merchant/broadcasts/dynamicVouchers/all';
307
- let localVarQueryParameters: any = {};
308
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
309
- const produces = ['application/json'];
310
- // give precedence to 'application/json'
311
- if (produces.indexOf('application/json') >= 0) {
312
- localVarHeaderParams.Accept = 'application/json';
313
- } else {
314
- localVarHeaderParams.Accept = produces.join(',');
315
- }
316
- let localVarFormParams: any = {};
317
-
318
- if (isArchiveIncluded !== undefined) {
319
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
320
- }
321
-
322
- (<any>Object).assign(localVarHeaderParams, options.headers);
323
-
324
- let localVarUseFormData = false;
325
-
326
- let localVarRequestOptions: localVarRequest.Options = {
327
- method: 'GET',
328
- qs: localVarQueryParameters,
329
- headers: localVarHeaderParams,
330
- uri: localVarPath,
331
- useQuerystring: this._useQuerystring,
332
- json: true,
333
- };
334
-
335
- let authenticationPromise = Promise.resolve();
336
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
337
-
338
- let interceptorPromise = authenticationPromise;
339
- for (const interceptor of this.interceptors) {
340
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
341
- }
342
-
343
- return interceptorPromise.then(() => {
344
- if (Object.keys(localVarFormParams).length) {
345
- if (localVarUseFormData) {
346
- (<any>localVarRequestOptions).formData = localVarFormParams;
347
- } else {
348
- localVarRequestOptions.form = localVarFormParams;
349
- }
350
- }
351
- return new Promise<{ response: http.IncomingMessage; body: Array<DynamicVoucherBroadcast>; }>((resolve, reject) => {
352
- localVarRequest(localVarRequestOptions, (error, response, body) => {
353
- if (error) {
354
- reject(error);
355
- } else {
356
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
357
- body = ObjectSerializer.deserialize(body, "Array<DynamicVoucherBroadcast>");
358
- resolve({ response: response, body: body });
359
- } else {
360
- reject(new HttpError(response, body, response.statusCode));
361
- }
362
- }
363
- });
364
- });
365
- });
366
- }
367
- /**
368
- *
369
- * @summary Fetch all employees
370
- */
371
- public async fetchEmployees (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
372
- const localVarPath = this.basePath + '/v1/merchant/employees/all';
373
- let localVarQueryParameters: any = {};
374
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
375
- const produces = ['application/json'];
376
- // give precedence to 'application/json'
377
- if (produces.indexOf('application/json') >= 0) {
378
- localVarHeaderParams.Accept = 'application/json';
379
- } else {
380
- localVarHeaderParams.Accept = produces.join(',');
381
- }
382
- let localVarFormParams: any = {};
383
-
384
- (<any>Object).assign(localVarHeaderParams, options.headers);
385
-
386
- let localVarUseFormData = false;
387
-
388
- let localVarRequestOptions: localVarRequest.Options = {
389
- method: 'GET',
390
- qs: localVarQueryParameters,
391
- headers: localVarHeaderParams,
392
- uri: localVarPath,
393
- useQuerystring: this._useQuerystring,
394
- json: true,
395
- };
396
-
397
- let authenticationPromise = Promise.resolve();
398
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
399
-
400
- let interceptorPromise = authenticationPromise;
401
- for (const interceptor of this.interceptors) {
402
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
403
- }
404
-
405
- return interceptorPromise.then(() => {
406
- if (Object.keys(localVarFormParams).length) {
407
- if (localVarUseFormData) {
408
- (<any>localVarRequestOptions).formData = localVarFormParams;
409
- } else {
410
- localVarRequestOptions.form = localVarFormParams;
411
- }
412
- }
413
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
414
- localVarRequest(localVarRequestOptions, (error, response, body) => {
415
- if (error) {
416
- reject(error);
417
- } else {
418
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
419
- body = ObjectSerializer.deserialize(body, "any");
420
- resolve({ response: response, body: body });
421
- } else {
422
- reject(new HttpError(response, body, response.statusCode));
423
- }
424
- }
425
- });
426
- });
427
- });
428
- }
429
- /**
430
- *
431
- * @summary Fetch help desk requests
432
- * @param phoneNumberID
433
- * @param isResolved
434
- */
435
- public async fetchHelpDeskRequests (phoneNumberID: any, isResolved?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
436
- const localVarPath = this.basePath + '/v1/merchant/helpDeskRequests/{phoneNumberID}'
437
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
438
- let localVarQueryParameters: any = {};
439
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
440
- const produces = ['application/json'];
441
- // give precedence to 'application/json'
442
- if (produces.indexOf('application/json') >= 0) {
443
- localVarHeaderParams.Accept = 'application/json';
444
- } else {
445
- localVarHeaderParams.Accept = produces.join(',');
446
- }
447
- let localVarFormParams: any = {};
448
-
449
- // verify required parameter 'phoneNumberID' is not null or undefined
450
- if (phoneNumberID === null || phoneNumberID === undefined) {
451
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchHelpDeskRequests.');
452
- }
453
-
454
- if (isResolved !== undefined) {
455
- localVarQueryParameters['isResolved'] = ObjectSerializer.serialize(isResolved, "boolean");
456
- }
457
-
458
- (<any>Object).assign(localVarHeaderParams, options.headers);
459
-
460
- let localVarUseFormData = false;
461
-
462
- let localVarRequestOptions: localVarRequest.Options = {
463
- method: 'GET',
464
- qs: localVarQueryParameters,
465
- headers: localVarHeaderParams,
466
- uri: localVarPath,
467
- useQuerystring: this._useQuerystring,
468
- json: true,
469
- };
470
-
471
- let authenticationPromise = Promise.resolve();
472
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
473
-
474
- let interceptorPromise = authenticationPromise;
475
- for (const interceptor of this.interceptors) {
476
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
477
- }
478
-
479
- return interceptorPromise.then(() => {
480
- if (Object.keys(localVarFormParams).length) {
481
- if (localVarUseFormData) {
482
- (<any>localVarRequestOptions).formData = localVarFormParams;
483
- } else {
484
- localVarRequestOptions.form = localVarFormParams;
485
- }
486
- }
487
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
488
- localVarRequest(localVarRequestOptions, (error, response, body) => {
489
- if (error) {
490
- reject(error);
491
- } else {
492
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
493
- body = ObjectSerializer.deserialize(body, "any");
494
- resolve({ response: response, body: body });
495
- } else {
496
- reject(new HttpError(response, body, response.statusCode));
497
- }
498
- }
499
- });
500
- });
501
- });
502
- }
503
- /**
504
- *
505
- * @summary Fetch imported list
506
- * @param listID
507
- */
508
- public async fetchImportedList (listID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
509
- const localVarPath = this.basePath + '/v1/merchant/lists/imported/{listID}'
510
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
511
- let localVarQueryParameters: any = {};
512
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
513
- const produces = ['application/json'];
514
- // give precedence to 'application/json'
515
- if (produces.indexOf('application/json') >= 0) {
516
- localVarHeaderParams.Accept = 'application/json';
517
- } else {
518
- localVarHeaderParams.Accept = produces.join(',');
519
- }
520
- let localVarFormParams: any = {};
521
-
522
- // verify required parameter 'listID' is not null or undefined
523
- if (listID === null || listID === undefined) {
524
- throw new Error('Required parameter listID was null or undefined when calling fetchImportedList.');
525
- }
526
-
527
- (<any>Object).assign(localVarHeaderParams, options.headers);
528
-
529
- let localVarUseFormData = false;
530
-
531
- let localVarRequestOptions: localVarRequest.Options = {
532
- method: 'GET',
533
- qs: localVarQueryParameters,
534
- headers: localVarHeaderParams,
535
- uri: localVarPath,
536
- useQuerystring: this._useQuerystring,
537
- json: true,
538
- };
539
-
540
- let authenticationPromise = Promise.resolve();
541
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
542
-
543
- let interceptorPromise = authenticationPromise;
544
- for (const interceptor of this.interceptors) {
545
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
546
- }
547
-
548
- return interceptorPromise.then(() => {
549
- if (Object.keys(localVarFormParams).length) {
550
- if (localVarUseFormData) {
551
- (<any>localVarRequestOptions).formData = localVarFormParams;
552
- } else {
553
- localVarRequestOptions.form = localVarFormParams;
554
- }
555
- }
556
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
557
- localVarRequest(localVarRequestOptions, (error, response, body) => {
558
- if (error) {
559
- reject(error);
560
- } else {
561
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
562
- body = ObjectSerializer.deserialize(body, "any");
563
- resolve({ response: response, body: body });
564
- } else {
565
- reject(new HttpError(response, body, response.statusCode));
566
- }
567
- }
568
- });
569
- });
570
- });
571
- }
572
- /**
573
- *
574
- * @summary Fetch all imported lists
575
- * @param isArchiveIncluded
576
- */
577
- public async fetchImportedLists (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
578
- const localVarPath = this.basePath + '/v1/merchant/lists/imported/all';
579
- let localVarQueryParameters: any = {};
580
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
581
- const produces = ['application/json'];
582
- // give precedence to 'application/json'
583
- if (produces.indexOf('application/json') >= 0) {
584
- localVarHeaderParams.Accept = 'application/json';
585
- } else {
586
- localVarHeaderParams.Accept = produces.join(',');
587
- }
588
- let localVarFormParams: any = {};
589
-
590
- if (isArchiveIncluded !== undefined) {
591
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
592
- }
593
-
594
- (<any>Object).assign(localVarHeaderParams, options.headers);
595
-
596
- let localVarUseFormData = false;
597
-
598
- let localVarRequestOptions: localVarRequest.Options = {
599
- method: 'GET',
600
- qs: localVarQueryParameters,
601
- headers: localVarHeaderParams,
602
- uri: localVarPath,
603
- useQuerystring: this._useQuerystring,
604
- json: true,
605
- };
606
-
607
- let authenticationPromise = Promise.resolve();
608
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
609
-
610
- let interceptorPromise = authenticationPromise;
611
- for (const interceptor of this.interceptors) {
612
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
613
- }
614
-
615
- return interceptorPromise.then(() => {
616
- if (Object.keys(localVarFormParams).length) {
617
- if (localVarUseFormData) {
618
- (<any>localVarRequestOptions).formData = localVarFormParams;
619
- } else {
620
- localVarRequestOptions.form = localVarFormParams;
621
- }
622
- }
623
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
624
- localVarRequest(localVarRequestOptions, (error, response, body) => {
625
- if (error) {
626
- reject(error);
627
- } else {
628
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
629
- body = ObjectSerializer.deserialize(body, "any");
630
- resolve({ response: response, body: body });
631
- } else {
632
- reject(new HttpError(response, body, response.statusCode));
633
- }
634
- }
635
- });
636
- });
637
- });
638
- }
639
- /**
640
- *
641
- * @summary Fetch inbound SMSes
642
- * @param phoneNumberID
643
- * @param fromPhoneNumber
644
- */
645
- public async fetchInboundSMS (phoneNumberID: any, fromPhoneNumber?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
646
- const localVarPath = this.basePath + '/v1/merchant/sms/inbound/{phoneNumberID}'
647
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
648
- let localVarQueryParameters: any = {};
649
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
650
- const produces = ['application/json'];
651
- // give precedence to 'application/json'
652
- if (produces.indexOf('application/json') >= 0) {
653
- localVarHeaderParams.Accept = 'application/json';
654
- } else {
655
- localVarHeaderParams.Accept = produces.join(',');
656
- }
657
- let localVarFormParams: any = {};
658
-
659
- // verify required parameter 'phoneNumberID' is not null or undefined
660
- if (phoneNumberID === null || phoneNumberID === undefined) {
661
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchInboundSMS.');
662
- }
663
-
664
- if (fromPhoneNumber !== undefined) {
665
- localVarQueryParameters['fromPhoneNumber'] = ObjectSerializer.serialize(fromPhoneNumber, "string");
666
- }
667
-
668
- (<any>Object).assign(localVarHeaderParams, options.headers);
669
-
670
- let localVarUseFormData = false;
671
-
672
- let localVarRequestOptions: localVarRequest.Options = {
673
- method: 'GET',
674
- qs: localVarQueryParameters,
675
- headers: localVarHeaderParams,
676
- uri: localVarPath,
677
- useQuerystring: this._useQuerystring,
678
- json: true,
679
- };
680
-
681
- let authenticationPromise = Promise.resolve();
682
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
683
-
684
- let interceptorPromise = authenticationPromise;
685
- for (const interceptor of this.interceptors) {
686
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
687
- }
688
-
689
- return interceptorPromise.then(() => {
690
- if (Object.keys(localVarFormParams).length) {
691
- if (localVarUseFormData) {
692
- (<any>localVarRequestOptions).formData = localVarFormParams;
693
- } else {
694
- localVarRequestOptions.form = localVarFormParams;
695
- }
696
- }
697
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
698
- localVarRequest(localVarRequestOptions, (error, response, body) => {
699
- if (error) {
700
- reject(error);
701
- } else {
702
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
703
- body = ObjectSerializer.deserialize(body, "any");
704
- resolve({ response: response, body: body });
705
- } else {
706
- reject(new HttpError(response, body, response.statusCode));
707
- }
708
- }
709
- });
710
- });
711
- });
712
- }
713
- /**
714
- *
715
- * @summary Fetch outbound SMSes
716
- * @param phoneNumberID
717
- * @param toPhoneNumber
718
- */
719
- public async fetchMerchantOutboundSMS (phoneNumberID: any, toPhoneNumber: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
720
- const localVarPath = this.basePath + '/v1/merchant/sms/outbound/{phoneNumberID}'
721
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
722
- let localVarQueryParameters: any = {};
723
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
724
- const produces = ['application/json'];
725
- // give precedence to 'application/json'
726
- if (produces.indexOf('application/json') >= 0) {
727
- localVarHeaderParams.Accept = 'application/json';
728
- } else {
729
- localVarHeaderParams.Accept = produces.join(',');
730
- }
731
- let localVarFormParams: any = {};
732
-
733
- // verify required parameter 'phoneNumberID' is not null or undefined
734
- if (phoneNumberID === null || phoneNumberID === undefined) {
735
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchMerchantOutboundSMS.');
736
- }
737
-
738
- // verify required parameter 'toPhoneNumber' is not null or undefined
739
- if (toPhoneNumber === null || toPhoneNumber === undefined) {
740
- throw new Error('Required parameter toPhoneNumber was null or undefined when calling fetchMerchantOutboundSMS.');
741
- }
742
-
743
- if (toPhoneNumber !== undefined) {
744
- localVarQueryParameters['toPhoneNumber'] = ObjectSerializer.serialize(toPhoneNumber, "string");
745
- }
746
-
747
- (<any>Object).assign(localVarHeaderParams, options.headers);
748
-
749
- let localVarUseFormData = false;
750
-
751
- let localVarRequestOptions: localVarRequest.Options = {
752
- method: 'GET',
753
- qs: localVarQueryParameters,
754
- headers: localVarHeaderParams,
755
- uri: localVarPath,
756
- useQuerystring: this._useQuerystring,
757
- json: true,
758
- };
759
-
760
- let authenticationPromise = Promise.resolve();
761
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
762
-
763
- let interceptorPromise = authenticationPromise;
764
- for (const interceptor of this.interceptors) {
765
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
766
- }
767
-
768
- return interceptorPromise.then(() => {
769
- if (Object.keys(localVarFormParams).length) {
770
- if (localVarUseFormData) {
771
- (<any>localVarRequestOptions).formData = localVarFormParams;
772
- } else {
773
- localVarRequestOptions.form = localVarFormParams;
774
- }
775
- }
776
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
777
- localVarRequest(localVarRequestOptions, (error, response, body) => {
778
- if (error) {
779
- reject(error);
780
- } else {
781
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
782
- body = ObjectSerializer.deserialize(body, "any");
783
- resolve({ response: response, body: body });
784
- } else {
785
- reject(new HttpError(response, body, response.statusCode));
786
- }
787
- }
788
- });
789
- });
790
- });
791
- }
792
- /**
793
- *
794
- * @summary Fetch all phone numbers
795
- * @param isArchiveIncluded
796
- * @param isApproved
797
- */
798
- public async fetchMerchantPhoneNumbers (isArchiveIncluded?: boolean, isApproved?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
799
- const localVarPath = this.basePath + '/v1/merchant/phoneNumbers/all';
800
- let localVarQueryParameters: any = {};
801
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
802
- const produces = ['application/json'];
803
- // give precedence to 'application/json'
804
- if (produces.indexOf('application/json') >= 0) {
805
- localVarHeaderParams.Accept = 'application/json';
806
- } else {
807
- localVarHeaderParams.Accept = produces.join(',');
808
- }
809
- let localVarFormParams: any = {};
810
-
811
- if (isArchiveIncluded !== undefined) {
812
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
813
- }
814
-
815
- if (isApproved !== undefined) {
816
- localVarQueryParameters['isApproved'] = ObjectSerializer.serialize(isApproved, "boolean");
817
- }
818
-
819
- (<any>Object).assign(localVarHeaderParams, options.headers);
820
-
821
- let localVarUseFormData = false;
822
-
823
- let localVarRequestOptions: localVarRequest.Options = {
824
- method: 'GET',
825
- qs: localVarQueryParameters,
826
- headers: localVarHeaderParams,
827
- uri: localVarPath,
828
- useQuerystring: this._useQuerystring,
829
- json: true,
830
- };
831
-
832
- let authenticationPromise = Promise.resolve();
833
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
834
-
835
- let interceptorPromise = authenticationPromise;
836
- for (const interceptor of this.interceptors) {
837
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
838
- }
839
-
840
- return interceptorPromise.then(() => {
841
- if (Object.keys(localVarFormParams).length) {
842
- if (localVarUseFormData) {
843
- (<any>localVarRequestOptions).formData = localVarFormParams;
844
- } else {
845
- localVarRequestOptions.form = localVarFormParams;
846
- }
847
- }
848
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
849
- localVarRequest(localVarRequestOptions, (error, response, body) => {
850
- if (error) {
851
- reject(error);
852
- } else {
853
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
854
- body = ObjectSerializer.deserialize(body, "any");
855
- resolve({ response: response, body: body });
856
- } else {
857
- reject(new HttpError(response, body, response.statusCode));
858
- }
859
- }
860
- });
861
- });
862
- });
863
- }
864
- /**
865
- *
866
- * @summary Fetch opt in list
867
- * @param listID
868
- */
869
- public async fetchOptInList (listID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
870
- const localVarPath = this.basePath + '/v1/merchant/lists/optIn/{listID}'
871
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
872
- let localVarQueryParameters: any = {};
873
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
874
- const produces = ['application/json'];
875
- // give precedence to 'application/json'
876
- if (produces.indexOf('application/json') >= 0) {
877
- localVarHeaderParams.Accept = 'application/json';
878
- } else {
879
- localVarHeaderParams.Accept = produces.join(',');
880
- }
881
- let localVarFormParams: any = {};
882
-
883
- // verify required parameter 'listID' is not null or undefined
884
- if (listID === null || listID === undefined) {
885
- throw new Error('Required parameter listID was null or undefined when calling fetchOptInList.');
886
- }
887
-
888
- (<any>Object).assign(localVarHeaderParams, options.headers);
889
-
890
- let localVarUseFormData = false;
891
-
892
- let localVarRequestOptions: localVarRequest.Options = {
893
- method: 'GET',
894
- qs: localVarQueryParameters,
895
- headers: localVarHeaderParams,
896
- uri: localVarPath,
897
- useQuerystring: this._useQuerystring,
898
- json: true,
899
- };
900
-
901
- let authenticationPromise = Promise.resolve();
902
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
903
-
904
- let interceptorPromise = authenticationPromise;
905
- for (const interceptor of this.interceptors) {
906
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
907
- }
908
-
909
- return interceptorPromise.then(() => {
910
- if (Object.keys(localVarFormParams).length) {
911
- if (localVarUseFormData) {
912
- (<any>localVarRequestOptions).formData = localVarFormParams;
913
- } else {
914
- localVarRequestOptions.form = localVarFormParams;
915
- }
916
- }
917
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
918
- localVarRequest(localVarRequestOptions, (error, response, body) => {
919
- if (error) {
920
- reject(error);
921
- } else {
922
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
923
- body = ObjectSerializer.deserialize(body, "any");
924
- resolve({ response: response, body: body });
925
- } else {
926
- reject(new HttpError(response, body, response.statusCode));
927
- }
928
- }
929
- });
930
- });
931
- });
932
- }
933
- /**
934
- *
935
- * @summary Fetch all opt in lists
936
- * @param isArchiveIncluded
937
- */
938
- public async fetchOptInLists (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
939
- const localVarPath = this.basePath + '/v1/merchant/lists/optIn/all';
940
- let localVarQueryParameters: any = {};
941
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
942
- const produces = ['application/json'];
943
- // give precedence to 'application/json'
944
- if (produces.indexOf('application/json') >= 0) {
945
- localVarHeaderParams.Accept = 'application/json';
946
- } else {
947
- localVarHeaderParams.Accept = produces.join(',');
948
- }
949
- let localVarFormParams: any = {};
950
-
951
- if (isArchiveIncluded !== undefined) {
952
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
953
- }
954
-
955
- (<any>Object).assign(localVarHeaderParams, options.headers);
956
-
957
- let localVarUseFormData = false;
958
-
959
- let localVarRequestOptions: localVarRequest.Options = {
960
- method: 'GET',
961
- qs: localVarQueryParameters,
962
- headers: localVarHeaderParams,
963
- uri: localVarPath,
964
- useQuerystring: this._useQuerystring,
965
- json: true,
966
- };
967
-
968
- let authenticationPromise = Promise.resolve();
969
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
970
-
971
- let interceptorPromise = authenticationPromise;
972
- for (const interceptor of this.interceptors) {
973
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
974
- }
975
-
976
- return interceptorPromise.then(() => {
977
- if (Object.keys(localVarFormParams).length) {
978
- if (localVarUseFormData) {
979
- (<any>localVarRequestOptions).formData = localVarFormParams;
980
- } else {
981
- localVarRequestOptions.form = localVarFormParams;
982
- }
983
- }
984
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
985
- localVarRequest(localVarRequestOptions, (error, response, body) => {
986
- if (error) {
987
- reject(error);
988
- } else {
989
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
990
- body = ObjectSerializer.deserialize(body, "any");
991
- resolve({ response: response, body: body });
992
- } else {
993
- reject(new HttpError(response, body, response.statusCode));
994
- }
995
- }
996
- });
997
- });
998
- });
999
- }
1000
- /**
1001
- *
1002
- * @summary Fetch phone number
1003
- * @param phoneNumberID
1004
- */
1005
- public async fetchPhoneNumber (phoneNumberID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1006
- const localVarPath = this.basePath + '/v1/merchant/phoneNumber/{phoneNumberID}'
1007
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1008
- let localVarQueryParameters: any = {};
1009
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1010
- const produces = ['application/json'];
1011
- // give precedence to 'application/json'
1012
- if (produces.indexOf('application/json') >= 0) {
1013
- localVarHeaderParams.Accept = 'application/json';
1014
- } else {
1015
- localVarHeaderParams.Accept = produces.join(',');
1016
- }
1017
- let localVarFormParams: any = {};
1018
-
1019
- // verify required parameter 'phoneNumberID' is not null or undefined
1020
- if (phoneNumberID === null || phoneNumberID === undefined) {
1021
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchPhoneNumber.');
1022
- }
1023
-
1024
- (<any>Object).assign(localVarHeaderParams, options.headers);
1025
-
1026
- let localVarUseFormData = false;
1027
-
1028
- let localVarRequestOptions: localVarRequest.Options = {
1029
- method: 'GET',
1030
- qs: localVarQueryParameters,
1031
- headers: localVarHeaderParams,
1032
- uri: localVarPath,
1033
- useQuerystring: this._useQuerystring,
1034
- json: true,
1035
- };
1036
-
1037
- let authenticationPromise = Promise.resolve();
1038
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1039
-
1040
- let interceptorPromise = authenticationPromise;
1041
- for (const interceptor of this.interceptors) {
1042
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1043
- }
1044
-
1045
- return interceptorPromise.then(() => {
1046
- if (Object.keys(localVarFormParams).length) {
1047
- if (localVarUseFormData) {
1048
- (<any>localVarRequestOptions).formData = localVarFormParams;
1049
- } else {
1050
- localVarRequestOptions.form = localVarFormParams;
1051
- }
1052
- }
1053
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1054
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1055
- if (error) {
1056
- reject(error);
1057
- } else {
1058
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1059
- body = ObjectSerializer.deserialize(body, "any");
1060
- resolve({ response: response, body: body });
1061
- } else {
1062
- reject(new HttpError(response, body, response.statusCode));
1063
- }
1064
- }
1065
- });
1066
- });
1067
- });
1068
- }
1069
- /**
1070
- *
1071
- * @summary Fetch all simple SMS broadcasts
1072
- * @param isArchiveIncluded
1073
- */
1074
- public async fetchSimpleSMSBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<SimpleSMSBroadcast>; }> {
1075
- const localVarPath = this.basePath + '/v1/merchant/broadcasts/simpleSMS/all';
1076
- let localVarQueryParameters: any = {};
1077
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1078
- const produces = ['application/json'];
1079
- // give precedence to 'application/json'
1080
- if (produces.indexOf('application/json') >= 0) {
1081
- localVarHeaderParams.Accept = 'application/json';
1082
- } else {
1083
- localVarHeaderParams.Accept = produces.join(',');
1084
- }
1085
- let localVarFormParams: any = {};
1086
-
1087
- if (isArchiveIncluded !== undefined) {
1088
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
1089
- }
1090
-
1091
- (<any>Object).assign(localVarHeaderParams, options.headers);
1092
-
1093
- let localVarUseFormData = false;
1094
-
1095
- let localVarRequestOptions: localVarRequest.Options = {
1096
- method: 'GET',
1097
- qs: localVarQueryParameters,
1098
- headers: localVarHeaderParams,
1099
- uri: localVarPath,
1100
- useQuerystring: this._useQuerystring,
1101
- json: true,
1102
- };
1103
-
1104
- let authenticationPromise = Promise.resolve();
1105
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1106
-
1107
- let interceptorPromise = authenticationPromise;
1108
- for (const interceptor of this.interceptors) {
1109
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1110
- }
1111
-
1112
- return interceptorPromise.then(() => {
1113
- if (Object.keys(localVarFormParams).length) {
1114
- if (localVarUseFormData) {
1115
- (<any>localVarRequestOptions).formData = localVarFormParams;
1116
- } else {
1117
- localVarRequestOptions.form = localVarFormParams;
1118
- }
1119
- }
1120
- return new Promise<{ response: http.IncomingMessage; body: Array<SimpleSMSBroadcast>; }>((resolve, reject) => {
1121
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1122
- if (error) {
1123
- reject(error);
1124
- } else {
1125
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1126
- body = ObjectSerializer.deserialize(body, "Array<SimpleSMSBroadcast>");
1127
- resolve({ response: response, body: body });
1128
- } else {
1129
- reject(new HttpError(response, body, response.statusCode));
1130
- }
1131
- }
1132
- });
1133
- });
1134
- });
1135
- }
1136
- /**
1137
- *
1138
- * @summary Fetch all static voucher campaign broadcasts
1139
- * @param isArchiveIncluded
1140
- */
1141
- public async fetchStaticVoucherCampaignBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<StaticVoucherCampaignBroadcast>; }> {
1142
- const localVarPath = this.basePath + '/v1/merchant/broadcasts/staticVoucherCampaign/all';
1143
- let localVarQueryParameters: any = {};
1144
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1145
- const produces = ['application/json'];
1146
- // give precedence to 'application/json'
1147
- if (produces.indexOf('application/json') >= 0) {
1148
- localVarHeaderParams.Accept = 'application/json';
1149
- } else {
1150
- localVarHeaderParams.Accept = produces.join(',');
1151
- }
1152
- let localVarFormParams: any = {};
1153
-
1154
- if (isArchiveIncluded !== undefined) {
1155
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
1156
- }
1157
-
1158
- (<any>Object).assign(localVarHeaderParams, options.headers);
1159
-
1160
- let localVarUseFormData = false;
1161
-
1162
- let localVarRequestOptions: localVarRequest.Options = {
1163
- method: 'GET',
1164
- qs: localVarQueryParameters,
1165
- headers: localVarHeaderParams,
1166
- uri: localVarPath,
1167
- useQuerystring: this._useQuerystring,
1168
- json: true,
1169
- };
1170
-
1171
- let authenticationPromise = Promise.resolve();
1172
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1173
-
1174
- let interceptorPromise = authenticationPromise;
1175
- for (const interceptor of this.interceptors) {
1176
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1177
- }
1178
-
1179
- return interceptorPromise.then(() => {
1180
- if (Object.keys(localVarFormParams).length) {
1181
- if (localVarUseFormData) {
1182
- (<any>localVarRequestOptions).formData = localVarFormParams;
1183
- } else {
1184
- localVarRequestOptions.form = localVarFormParams;
1185
- }
1186
- }
1187
- return new Promise<{ response: http.IncomingMessage; body: Array<StaticVoucherCampaignBroadcast>; }>((resolve, reject) => {
1188
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1189
- if (error) {
1190
- reject(error);
1191
- } else {
1192
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1193
- body = ObjectSerializer.deserialize(body, "Array<StaticVoucherCampaignBroadcast>");
1194
- resolve({ response: response, body: body });
1195
- } else {
1196
- reject(new HttpError(response, body, response.statusCode));
1197
- }
1198
- }
1199
- });
1200
- });
1201
- });
1202
- }
1203
- /**
1204
- *
1205
- * @summary Fetch all TCPA Filters
1206
- */
1207
- public async fetchTCPAFilter (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }> {
1208
- const localVarPath = this.basePath + '/v1/merchant/tcpa/filter/all';
1209
- let localVarQueryParameters: any = {};
1210
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1211
- const produces = ['application/json'];
1212
- // give precedence to 'application/json'
1213
- if (produces.indexOf('application/json') >= 0) {
1214
- localVarHeaderParams.Accept = 'application/json';
1215
- } else {
1216
- localVarHeaderParams.Accept = produces.join(',');
1217
- }
1218
- let localVarFormParams: any = {};
1219
-
1220
- (<any>Object).assign(localVarHeaderParams, options.headers);
1221
-
1222
- let localVarUseFormData = false;
1223
-
1224
- let localVarRequestOptions: localVarRequest.Options = {
1225
- method: 'GET',
1226
- qs: localVarQueryParameters,
1227
- headers: localVarHeaderParams,
1228
- uri: localVarPath,
1229
- useQuerystring: this._useQuerystring,
1230
- json: true,
1231
- };
1232
-
1233
- let authenticationPromise = Promise.resolve();
1234
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1235
-
1236
- let interceptorPromise = authenticationPromise;
1237
- for (const interceptor of this.interceptors) {
1238
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1239
- }
1240
-
1241
- return interceptorPromise.then(() => {
1242
- if (Object.keys(localVarFormParams).length) {
1243
- if (localVarUseFormData) {
1244
- (<any>localVarRequestOptions).formData = localVarFormParams;
1245
- } else {
1246
- localVarRequestOptions.form = localVarFormParams;
1247
- }
1248
- }
1249
- return new Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }>((resolve, reject) => {
1250
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1251
- if (error) {
1252
- reject(error);
1253
- } else {
1254
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1255
- body = ObjectSerializer.deserialize(body, "Array<Tcpa>");
1256
- resolve({ response: response, body: body });
1257
- } else {
1258
- reject(new HttpError(response, body, response.statusCode));
1259
- }
1260
- }
1261
- });
1262
- });
1263
- });
1264
- }
1265
- /**
1266
- *
1267
- * @summary Fetch wallet configuration
1268
- */
1269
- public async fetchWalletConfiguration (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1270
- const localVarPath = this.basePath + '/v1/merchant/wallet/configuration';
1271
- let localVarQueryParameters: any = {};
1272
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1273
- const produces = ['application/json'];
1274
- // give precedence to 'application/json'
1275
- if (produces.indexOf('application/json') >= 0) {
1276
- localVarHeaderParams.Accept = 'application/json';
1277
- } else {
1278
- localVarHeaderParams.Accept = produces.join(',');
1279
- }
1280
- let localVarFormParams: any = {};
1281
-
1282
- (<any>Object).assign(localVarHeaderParams, options.headers);
1283
-
1284
- let localVarUseFormData = false;
1285
-
1286
- let localVarRequestOptions: localVarRequest.Options = {
1287
- method: 'GET',
1288
- qs: localVarQueryParameters,
1289
- headers: localVarHeaderParams,
1290
- uri: localVarPath,
1291
- useQuerystring: this._useQuerystring,
1292
- json: true,
1293
- };
1294
-
1295
- let authenticationPromise = Promise.resolve();
1296
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1297
-
1298
- let interceptorPromise = authenticationPromise;
1299
- for (const interceptor of this.interceptors) {
1300
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1301
- }
1302
-
1303
- return interceptorPromise.then(() => {
1304
- if (Object.keys(localVarFormParams).length) {
1305
- if (localVarUseFormData) {
1306
- (<any>localVarRequestOptions).formData = localVarFormParams;
1307
- } else {
1308
- localVarRequestOptions.form = localVarFormParams;
1309
- }
1310
- }
1311
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1312
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1313
- if (error) {
1314
- reject(error);
1315
- } else {
1316
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1317
- body = ObjectSerializer.deserialize(body, "any");
1318
- resolve({ response: response, body: body });
1319
- } else {
1320
- reject(new HttpError(response, body, response.statusCode));
1321
- }
1322
- }
1323
- });
1324
- });
1325
- });
1326
- }
1327
- /**
1328
- *
1329
- * @summary Update billing contact
1330
- * @param inlineObject22
1331
- */
1332
- public async updateBillingContact (inlineObject22: InlineObject22, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1333
- const localVarPath = this.basePath + '/v1/merchant/billing/contact';
1334
- let localVarQueryParameters: any = {};
1335
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1336
- const produces = ['application/json'];
1337
- // give precedence to 'application/json'
1338
- if (produces.indexOf('application/json') >= 0) {
1339
- localVarHeaderParams.Accept = 'application/json';
1340
- } else {
1341
- localVarHeaderParams.Accept = produces.join(',');
1342
- }
1343
- let localVarFormParams: any = {};
1344
-
1345
- // verify required parameter 'inlineObject22' is not null or undefined
1346
- if (inlineObject22 === null || inlineObject22 === undefined) {
1347
- throw new Error('Required parameter inlineObject22 was null or undefined when calling updateBillingContact.');
1348
- }
1349
-
1350
- (<any>Object).assign(localVarHeaderParams, options.headers);
1351
-
1352
- let localVarUseFormData = false;
1353
-
1354
- let localVarRequestOptions: localVarRequest.Options = {
1355
- method: 'PUT',
1356
- qs: localVarQueryParameters,
1357
- headers: localVarHeaderParams,
1358
- uri: localVarPath,
1359
- useQuerystring: this._useQuerystring,
1360
- json: true,
1361
- body: ObjectSerializer.serialize(inlineObject22, "InlineObject22")
1362
- };
1363
-
1364
- let authenticationPromise = Promise.resolve();
1365
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1366
-
1367
- let interceptorPromise = authenticationPromise;
1368
- for (const interceptor of this.interceptors) {
1369
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1370
- }
1371
-
1372
- return interceptorPromise.then(() => {
1373
- if (Object.keys(localVarFormParams).length) {
1374
- if (localVarUseFormData) {
1375
- (<any>localVarRequestOptions).formData = localVarFormParams;
1376
- } else {
1377
- localVarRequestOptions.form = localVarFormParams;
1378
- }
1379
- }
1380
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1381
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1382
- if (error) {
1383
- reject(error);
1384
- } else {
1385
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1386
- body = ObjectSerializer.deserialize(body, "any");
1387
- resolve({ response: response, body: body });
1388
- } else {
1389
- reject(new HttpError(response, body, response.statusCode));
1390
- }
1391
- }
1392
- });
1393
- });
1394
- });
1395
- }
1396
- /**
1397
- *
1398
- * @summary Update merchant details
1399
- * @param inlineObject21
1400
- */
1401
- public async updateMerchant (inlineObject21: InlineObject21, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1402
- const localVarPath = this.basePath + '/v1/merchant';
1403
- let localVarQueryParameters: any = {};
1404
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1405
- const produces = ['application/json'];
1406
- // give precedence to 'application/json'
1407
- if (produces.indexOf('application/json') >= 0) {
1408
- localVarHeaderParams.Accept = 'application/json';
1409
- } else {
1410
- localVarHeaderParams.Accept = produces.join(',');
1411
- }
1412
- let localVarFormParams: any = {};
1413
-
1414
- // verify required parameter 'inlineObject21' is not null or undefined
1415
- if (inlineObject21 === null || inlineObject21 === undefined) {
1416
- throw new Error('Required parameter inlineObject21 was null or undefined when calling updateMerchant.');
1417
- }
1418
-
1419
- (<any>Object).assign(localVarHeaderParams, options.headers);
1420
-
1421
- let localVarUseFormData = false;
1422
-
1423
- let localVarRequestOptions: localVarRequest.Options = {
1424
- method: 'PUT',
1425
- qs: localVarQueryParameters,
1426
- headers: localVarHeaderParams,
1427
- uri: localVarPath,
1428
- useQuerystring: this._useQuerystring,
1429
- json: true,
1430
- body: ObjectSerializer.serialize(inlineObject21, "InlineObject21")
1431
- };
1432
-
1433
- let authenticationPromise = Promise.resolve();
1434
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1435
-
1436
- let interceptorPromise = authenticationPromise;
1437
- for (const interceptor of this.interceptors) {
1438
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1439
- }
1440
-
1441
- return interceptorPromise.then(() => {
1442
- if (Object.keys(localVarFormParams).length) {
1443
- if (localVarUseFormData) {
1444
- (<any>localVarRequestOptions).formData = localVarFormParams;
1445
- } else {
1446
- localVarRequestOptions.form = localVarFormParams;
1447
- }
1448
- }
1449
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1450
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1451
- if (error) {
1452
- reject(error);
1453
- } else {
1454
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1455
- body = ObjectSerializer.deserialize(body, "any");
1456
- resolve({ response: response, body: body });
1457
- } else {
1458
- reject(new HttpError(response, body, response.statusCode));
1459
- }
1460
- }
1461
- });
1462
- });
1463
- });
1464
- }
1465
- /**
1466
- *
1467
- * @summary Update POS Integration
1468
- * @param inlineObject23
1469
- */
1470
- public async updatePosIntegration (inlineObject23: InlineObject23, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1471
- const localVarPath = this.basePath + '/v1/merchant/pos/integration';
1472
- let localVarQueryParameters: any = {};
1473
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1474
- const produces = ['application/json'];
1475
- // give precedence to 'application/json'
1476
- if (produces.indexOf('application/json') >= 0) {
1477
- localVarHeaderParams.Accept = 'application/json';
1478
- } else {
1479
- localVarHeaderParams.Accept = produces.join(',');
1480
- }
1481
- let localVarFormParams: any = {};
1482
-
1483
- // verify required parameter 'inlineObject23' is not null or undefined
1484
- if (inlineObject23 === null || inlineObject23 === undefined) {
1485
- throw new Error('Required parameter inlineObject23 was null or undefined when calling updatePosIntegration.');
1486
- }
1487
-
1488
- (<any>Object).assign(localVarHeaderParams, options.headers);
1489
-
1490
- let localVarUseFormData = false;
1491
-
1492
- let localVarRequestOptions: localVarRequest.Options = {
1493
- method: 'PUT',
1494
- qs: localVarQueryParameters,
1495
- headers: localVarHeaderParams,
1496
- uri: localVarPath,
1497
- useQuerystring: this._useQuerystring,
1498
- json: true,
1499
- body: ObjectSerializer.serialize(inlineObject23, "InlineObject23")
1500
- };
1501
-
1502
- let authenticationPromise = Promise.resolve();
1503
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1504
-
1505
- let interceptorPromise = authenticationPromise;
1506
- for (const interceptor of this.interceptors) {
1507
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1508
- }
1509
-
1510
- return interceptorPromise.then(() => {
1511
- if (Object.keys(localVarFormParams).length) {
1512
- if (localVarUseFormData) {
1513
- (<any>localVarRequestOptions).formData = localVarFormParams;
1514
- } else {
1515
- localVarRequestOptions.form = localVarFormParams;
1516
- }
1517
- }
1518
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1519
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1520
- if (error) {
1521
- reject(error);
1522
- } else {
1523
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1524
- body = ObjectSerializer.deserialize(body, "any");
1525
- resolve({ response: response, body: body });
1526
- } else {
1527
- reject(new HttpError(response, body, response.statusCode));
1528
- }
1529
- }
1530
- });
1531
- });
1532
- });
1533
- }
1534
- }
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 { AdvertisementCreditBroadcast } from '../model/advertisementCreditBroadcast';
19
+ import { AuthError } from '../model/authError';
20
+ import { DynamicVoucherBroadcast } from '../model/dynamicVoucherBroadcast';
21
+ import { FalsumError } from '../model/falsumError';
22
+ import { InlineObject21 } from '../model/inlineObject21';
23
+ import { InlineObject22 } from '../model/inlineObject22';
24
+ import { InlineObject23 } from '../model/inlineObject23';
25
+ import { InternalServerError } from '../model/internalServerError';
26
+ import { SimpleSMSBroadcast } from '../model/simpleSMSBroadcast';
27
+ import { StaticVoucherCampaignBroadcast } from '../model/staticVoucherCampaignBroadcast';
28
+ import { Tcpa } from '../model/tcpa';
29
+
30
+ import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
31
+ import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
32
+
33
+ import { HttpError, RequestFile } from './apis';
34
+
35
+ let defaultBasePath = 'https://api.wall.et';
36
+
37
+ // ===============================================
38
+ // This file is autogenerated - Please do not edit
39
+ // ===============================================
40
+
41
+ export enum MerchantApiApiKeys {
42
+ api_key,
43
+ }
44
+
45
+ export class MerchantApi {
46
+ protected _basePath = defaultBasePath;
47
+ protected _defaultHeaders : any = {};
48
+ protected _useQuerystring : boolean = false;
49
+
50
+ protected authentications = {
51
+ 'default': <Authentication>new VoidAuth(),
52
+ 'api_key': new ApiKeyAuth('header', 'access-token'),
53
+ }
54
+
55
+ protected interceptors: Interceptor[] = [];
56
+
57
+ constructor(basePath?: string);
58
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
59
+ if (password) {
60
+ if (basePath) {
61
+ this.basePath = basePath;
62
+ }
63
+ } else {
64
+ if (basePathOrUsername) {
65
+ this.basePath = basePathOrUsername
66
+ }
67
+ }
68
+ }
69
+
70
+ set useQuerystring(value: boolean) {
71
+ this._useQuerystring = value;
72
+ }
73
+
74
+ set basePath(basePath: string) {
75
+ this._basePath = basePath;
76
+ }
77
+
78
+ set defaultHeaders(defaultHeaders: any) {
79
+ this._defaultHeaders = defaultHeaders;
80
+ }
81
+
82
+ get defaultHeaders() {
83
+ return this._defaultHeaders;
84
+ }
85
+
86
+ get basePath() {
87
+ return this._basePath;
88
+ }
89
+
90
+ public setDefaultAuthentication(auth: Authentication) {
91
+ this.authentications.default = auth;
92
+ }
93
+
94
+ public setApiKey(key: MerchantApiApiKeys, value: string) {
95
+ (this.authentications as any)[MerchantApiApiKeys[key]].apiKey = value;
96
+ }
97
+
98
+ public addInterceptor(interceptor: Interceptor) {
99
+ this.interceptors.push(interceptor);
100
+ }
101
+
102
+ /**
103
+ *
104
+ * @summary Archive payment object broadcast
105
+ * @param broadcastID
106
+ */
107
+ public async archivePaymentObjectBroadcast (broadcastID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
108
+ const localVarPath = this.basePath + '/v1/merchant/paymentObjectBroadcast/{broadcastID}'
109
+ .replace('{' + 'broadcastID' + '}', encodeURIComponent(String(broadcastID)));
110
+ let localVarQueryParameters: any = {};
111
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
112
+ const produces = ['application/json'];
113
+ // give precedence to 'application/json'
114
+ if (produces.indexOf('application/json') >= 0) {
115
+ localVarHeaderParams.Accept = 'application/json';
116
+ } else {
117
+ localVarHeaderParams.Accept = produces.join(',');
118
+ }
119
+ let localVarFormParams: any = {};
120
+
121
+ // verify required parameter 'broadcastID' is not null or undefined
122
+ if (broadcastID === null || broadcastID === undefined) {
123
+ throw new Error('Required parameter broadcastID was null or undefined when calling archivePaymentObjectBroadcast.');
124
+ }
125
+
126
+ (<any>Object).assign(localVarHeaderParams, options.headers);
127
+
128
+ let localVarUseFormData = false;
129
+
130
+ let localVarRequestOptions: localVarRequest.Options = {
131
+ method: 'DELETE',
132
+ qs: localVarQueryParameters,
133
+ headers: localVarHeaderParams,
134
+ uri: localVarPath,
135
+ useQuerystring: this._useQuerystring,
136
+ json: true,
137
+ };
138
+
139
+ let authenticationPromise = Promise.resolve();
140
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
141
+
142
+ let interceptorPromise = authenticationPromise;
143
+ for (const interceptor of this.interceptors) {
144
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
145
+ }
146
+
147
+ return interceptorPromise.then(() => {
148
+ if (Object.keys(localVarFormParams).length) {
149
+ if (localVarUseFormData) {
150
+ (<any>localVarRequestOptions).formData = localVarFormParams;
151
+ } else {
152
+ localVarRequestOptions.form = localVarFormParams;
153
+ }
154
+ }
155
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
156
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
157
+ if (error) {
158
+ reject(error);
159
+ } else {
160
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
161
+ body = ObjectSerializer.deserialize(body, "any");
162
+ resolve({ response: response, body: body });
163
+ } else {
164
+ reject(new HttpError(response, body, response.statusCode));
165
+ }
166
+ }
167
+ });
168
+ });
169
+ });
170
+ }
171
+ /**
172
+ *
173
+ * @summary Fetch all ad credit broadcasts
174
+ * @param isArchiveIncluded
175
+ */
176
+ public async fetchAdvertisementCreditBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<AdvertisementCreditBroadcast>; }> {
177
+ const localVarPath = this.basePath + '/v1/merchant/broadcasts/adCredits/all';
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
+ if (isArchiveIncluded !== undefined) {
190
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
191
+ }
192
+
193
+ (<any>Object).assign(localVarHeaderParams, options.headers);
194
+
195
+ let localVarUseFormData = false;
196
+
197
+ let localVarRequestOptions: localVarRequest.Options = {
198
+ method: 'GET',
199
+ qs: localVarQueryParameters,
200
+ headers: localVarHeaderParams,
201
+ uri: localVarPath,
202
+ useQuerystring: this._useQuerystring,
203
+ json: true,
204
+ };
205
+
206
+ let authenticationPromise = Promise.resolve();
207
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
208
+
209
+ let interceptorPromise = authenticationPromise;
210
+ for (const interceptor of this.interceptors) {
211
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
212
+ }
213
+
214
+ return interceptorPromise.then(() => {
215
+ if (Object.keys(localVarFormParams).length) {
216
+ if (localVarUseFormData) {
217
+ (<any>localVarRequestOptions).formData = localVarFormParams;
218
+ } else {
219
+ localVarRequestOptions.form = localVarFormParams;
220
+ }
221
+ }
222
+ return new Promise<{ response: http.IncomingMessage; body: Array<AdvertisementCreditBroadcast>; }>((resolve, reject) => {
223
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
224
+ if (error) {
225
+ reject(error);
226
+ } else {
227
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
228
+ body = ObjectSerializer.deserialize(body, "Array<AdvertisementCreditBroadcast>");
229
+ resolve({ response: response, body: body });
230
+ } else {
231
+ reject(new HttpError(response, body, response.statusCode));
232
+ }
233
+ }
234
+ });
235
+ });
236
+ });
237
+ }
238
+ /**
239
+ *
240
+ * @summary Fetch custom roles
241
+ */
242
+ public async fetchCustomRoles (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
243
+ const localVarPath = this.basePath + '/v1/merchant/roles/custom';
244
+ let localVarQueryParameters: any = {};
245
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
246
+ const produces = ['application/json'];
247
+ // give precedence to 'application/json'
248
+ if (produces.indexOf('application/json') >= 0) {
249
+ localVarHeaderParams.Accept = 'application/json';
250
+ } else {
251
+ localVarHeaderParams.Accept = produces.join(',');
252
+ }
253
+ let localVarFormParams: any = {};
254
+
255
+ (<any>Object).assign(localVarHeaderParams, options.headers);
256
+
257
+ let localVarUseFormData = false;
258
+
259
+ let localVarRequestOptions: localVarRequest.Options = {
260
+ method: 'GET',
261
+ qs: localVarQueryParameters,
262
+ headers: localVarHeaderParams,
263
+ uri: localVarPath,
264
+ useQuerystring: this._useQuerystring,
265
+ json: true,
266
+ };
267
+
268
+ let authenticationPromise = Promise.resolve();
269
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
270
+
271
+ let interceptorPromise = authenticationPromise;
272
+ for (const interceptor of this.interceptors) {
273
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
274
+ }
275
+
276
+ return interceptorPromise.then(() => {
277
+ if (Object.keys(localVarFormParams).length) {
278
+ if (localVarUseFormData) {
279
+ (<any>localVarRequestOptions).formData = localVarFormParams;
280
+ } else {
281
+ localVarRequestOptions.form = localVarFormParams;
282
+ }
283
+ }
284
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
285
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
286
+ if (error) {
287
+ reject(error);
288
+ } else {
289
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
290
+ body = ObjectSerializer.deserialize(body, "any");
291
+ resolve({ response: response, body: body });
292
+ } else {
293
+ reject(new HttpError(response, body, response.statusCode));
294
+ }
295
+ }
296
+ });
297
+ });
298
+ });
299
+ }
300
+ /**
301
+ *
302
+ * @summary Fetch all dynamic voucher broadcasts
303
+ * @param isArchiveIncluded
304
+ */
305
+ public async fetchDynamicVoucherBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<DynamicVoucherBroadcast>; }> {
306
+ const localVarPath = this.basePath + '/v1/merchant/broadcasts/dynamicVouchers/all';
307
+ let localVarQueryParameters: any = {};
308
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
309
+ const produces = ['application/json'];
310
+ // give precedence to 'application/json'
311
+ if (produces.indexOf('application/json') >= 0) {
312
+ localVarHeaderParams.Accept = 'application/json';
313
+ } else {
314
+ localVarHeaderParams.Accept = produces.join(',');
315
+ }
316
+ let localVarFormParams: any = {};
317
+
318
+ if (isArchiveIncluded !== undefined) {
319
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
320
+ }
321
+
322
+ (<any>Object).assign(localVarHeaderParams, options.headers);
323
+
324
+ let localVarUseFormData = false;
325
+
326
+ let localVarRequestOptions: localVarRequest.Options = {
327
+ method: 'GET',
328
+ qs: localVarQueryParameters,
329
+ headers: localVarHeaderParams,
330
+ uri: localVarPath,
331
+ useQuerystring: this._useQuerystring,
332
+ json: true,
333
+ };
334
+
335
+ let authenticationPromise = Promise.resolve();
336
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
337
+
338
+ let interceptorPromise = authenticationPromise;
339
+ for (const interceptor of this.interceptors) {
340
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
341
+ }
342
+
343
+ return interceptorPromise.then(() => {
344
+ if (Object.keys(localVarFormParams).length) {
345
+ if (localVarUseFormData) {
346
+ (<any>localVarRequestOptions).formData = localVarFormParams;
347
+ } else {
348
+ localVarRequestOptions.form = localVarFormParams;
349
+ }
350
+ }
351
+ return new Promise<{ response: http.IncomingMessage; body: Array<DynamicVoucherBroadcast>; }>((resolve, reject) => {
352
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
353
+ if (error) {
354
+ reject(error);
355
+ } else {
356
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
357
+ body = ObjectSerializer.deserialize(body, "Array<DynamicVoucherBroadcast>");
358
+ resolve({ response: response, body: body });
359
+ } else {
360
+ reject(new HttpError(response, body, response.statusCode));
361
+ }
362
+ }
363
+ });
364
+ });
365
+ });
366
+ }
367
+ /**
368
+ *
369
+ * @summary Fetch all employees
370
+ */
371
+ public async fetchEmployees (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
372
+ const localVarPath = this.basePath + '/v1/merchant/employees/all';
373
+ let localVarQueryParameters: any = {};
374
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
375
+ const produces = ['application/json'];
376
+ // give precedence to 'application/json'
377
+ if (produces.indexOf('application/json') >= 0) {
378
+ localVarHeaderParams.Accept = 'application/json';
379
+ } else {
380
+ localVarHeaderParams.Accept = produces.join(',');
381
+ }
382
+ let localVarFormParams: any = {};
383
+
384
+ (<any>Object).assign(localVarHeaderParams, options.headers);
385
+
386
+ let localVarUseFormData = false;
387
+
388
+ let localVarRequestOptions: localVarRequest.Options = {
389
+ method: 'GET',
390
+ qs: localVarQueryParameters,
391
+ headers: localVarHeaderParams,
392
+ uri: localVarPath,
393
+ useQuerystring: this._useQuerystring,
394
+ json: true,
395
+ };
396
+
397
+ let authenticationPromise = Promise.resolve();
398
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
399
+
400
+ let interceptorPromise = authenticationPromise;
401
+ for (const interceptor of this.interceptors) {
402
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
403
+ }
404
+
405
+ return interceptorPromise.then(() => {
406
+ if (Object.keys(localVarFormParams).length) {
407
+ if (localVarUseFormData) {
408
+ (<any>localVarRequestOptions).formData = localVarFormParams;
409
+ } else {
410
+ localVarRequestOptions.form = localVarFormParams;
411
+ }
412
+ }
413
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
414
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
415
+ if (error) {
416
+ reject(error);
417
+ } else {
418
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
419
+ body = ObjectSerializer.deserialize(body, "any");
420
+ resolve({ response: response, body: body });
421
+ } else {
422
+ reject(new HttpError(response, body, response.statusCode));
423
+ }
424
+ }
425
+ });
426
+ });
427
+ });
428
+ }
429
+ /**
430
+ *
431
+ * @summary Fetch help desk requests
432
+ * @param phoneNumberID
433
+ * @param isResolved
434
+ */
435
+ public async fetchHelpDeskRequests (phoneNumberID: any, isResolved?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
436
+ const localVarPath = this.basePath + '/v1/merchant/helpDeskRequests/{phoneNumberID}'
437
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
438
+ let localVarQueryParameters: any = {};
439
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
440
+ const produces = ['application/json'];
441
+ // give precedence to 'application/json'
442
+ if (produces.indexOf('application/json') >= 0) {
443
+ localVarHeaderParams.Accept = 'application/json';
444
+ } else {
445
+ localVarHeaderParams.Accept = produces.join(',');
446
+ }
447
+ let localVarFormParams: any = {};
448
+
449
+ // verify required parameter 'phoneNumberID' is not null or undefined
450
+ if (phoneNumberID === null || phoneNumberID === undefined) {
451
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchHelpDeskRequests.');
452
+ }
453
+
454
+ if (isResolved !== undefined) {
455
+ localVarQueryParameters['isResolved'] = ObjectSerializer.serialize(isResolved, "boolean");
456
+ }
457
+
458
+ (<any>Object).assign(localVarHeaderParams, options.headers);
459
+
460
+ let localVarUseFormData = false;
461
+
462
+ let localVarRequestOptions: localVarRequest.Options = {
463
+ method: 'GET',
464
+ qs: localVarQueryParameters,
465
+ headers: localVarHeaderParams,
466
+ uri: localVarPath,
467
+ useQuerystring: this._useQuerystring,
468
+ json: true,
469
+ };
470
+
471
+ let authenticationPromise = Promise.resolve();
472
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
473
+
474
+ let interceptorPromise = authenticationPromise;
475
+ for (const interceptor of this.interceptors) {
476
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
477
+ }
478
+
479
+ return interceptorPromise.then(() => {
480
+ if (Object.keys(localVarFormParams).length) {
481
+ if (localVarUseFormData) {
482
+ (<any>localVarRequestOptions).formData = localVarFormParams;
483
+ } else {
484
+ localVarRequestOptions.form = localVarFormParams;
485
+ }
486
+ }
487
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
488
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
489
+ if (error) {
490
+ reject(error);
491
+ } else {
492
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
493
+ body = ObjectSerializer.deserialize(body, "any");
494
+ resolve({ response: response, body: body });
495
+ } else {
496
+ reject(new HttpError(response, body, response.statusCode));
497
+ }
498
+ }
499
+ });
500
+ });
501
+ });
502
+ }
503
+ /**
504
+ *
505
+ * @summary Fetch imported list
506
+ * @param listID
507
+ */
508
+ public async fetchImportedList (listID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
509
+ const localVarPath = this.basePath + '/v1/merchant/lists/imported/{listID}'
510
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
511
+ let localVarQueryParameters: any = {};
512
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
513
+ const produces = ['application/json'];
514
+ // give precedence to 'application/json'
515
+ if (produces.indexOf('application/json') >= 0) {
516
+ localVarHeaderParams.Accept = 'application/json';
517
+ } else {
518
+ localVarHeaderParams.Accept = produces.join(',');
519
+ }
520
+ let localVarFormParams: any = {};
521
+
522
+ // verify required parameter 'listID' is not null or undefined
523
+ if (listID === null || listID === undefined) {
524
+ throw new Error('Required parameter listID was null or undefined when calling fetchImportedList.');
525
+ }
526
+
527
+ (<any>Object).assign(localVarHeaderParams, options.headers);
528
+
529
+ let localVarUseFormData = false;
530
+
531
+ let localVarRequestOptions: localVarRequest.Options = {
532
+ method: 'GET',
533
+ qs: localVarQueryParameters,
534
+ headers: localVarHeaderParams,
535
+ uri: localVarPath,
536
+ useQuerystring: this._useQuerystring,
537
+ json: true,
538
+ };
539
+
540
+ let authenticationPromise = Promise.resolve();
541
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
542
+
543
+ let interceptorPromise = authenticationPromise;
544
+ for (const interceptor of this.interceptors) {
545
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
546
+ }
547
+
548
+ return interceptorPromise.then(() => {
549
+ if (Object.keys(localVarFormParams).length) {
550
+ if (localVarUseFormData) {
551
+ (<any>localVarRequestOptions).formData = localVarFormParams;
552
+ } else {
553
+ localVarRequestOptions.form = localVarFormParams;
554
+ }
555
+ }
556
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
557
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
558
+ if (error) {
559
+ reject(error);
560
+ } else {
561
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
562
+ body = ObjectSerializer.deserialize(body, "any");
563
+ resolve({ response: response, body: body });
564
+ } else {
565
+ reject(new HttpError(response, body, response.statusCode));
566
+ }
567
+ }
568
+ });
569
+ });
570
+ });
571
+ }
572
+ /**
573
+ *
574
+ * @summary Fetch all imported lists
575
+ * @param isArchiveIncluded
576
+ */
577
+ public async fetchImportedLists (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
578
+ const localVarPath = this.basePath + '/v1/merchant/lists/imported/all';
579
+ let localVarQueryParameters: any = {};
580
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
581
+ const produces = ['application/json'];
582
+ // give precedence to 'application/json'
583
+ if (produces.indexOf('application/json') >= 0) {
584
+ localVarHeaderParams.Accept = 'application/json';
585
+ } else {
586
+ localVarHeaderParams.Accept = produces.join(',');
587
+ }
588
+ let localVarFormParams: any = {};
589
+
590
+ if (isArchiveIncluded !== undefined) {
591
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
592
+ }
593
+
594
+ (<any>Object).assign(localVarHeaderParams, options.headers);
595
+
596
+ let localVarUseFormData = false;
597
+
598
+ let localVarRequestOptions: localVarRequest.Options = {
599
+ method: 'GET',
600
+ qs: localVarQueryParameters,
601
+ headers: localVarHeaderParams,
602
+ uri: localVarPath,
603
+ useQuerystring: this._useQuerystring,
604
+ json: true,
605
+ };
606
+
607
+ let authenticationPromise = Promise.resolve();
608
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
609
+
610
+ let interceptorPromise = authenticationPromise;
611
+ for (const interceptor of this.interceptors) {
612
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
613
+ }
614
+
615
+ return interceptorPromise.then(() => {
616
+ if (Object.keys(localVarFormParams).length) {
617
+ if (localVarUseFormData) {
618
+ (<any>localVarRequestOptions).formData = localVarFormParams;
619
+ } else {
620
+ localVarRequestOptions.form = localVarFormParams;
621
+ }
622
+ }
623
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
624
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
625
+ if (error) {
626
+ reject(error);
627
+ } else {
628
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
629
+ body = ObjectSerializer.deserialize(body, "any");
630
+ resolve({ response: response, body: body });
631
+ } else {
632
+ reject(new HttpError(response, body, response.statusCode));
633
+ }
634
+ }
635
+ });
636
+ });
637
+ });
638
+ }
639
+ /**
640
+ *
641
+ * @summary Fetch inbound SMSes
642
+ * @param phoneNumberID
643
+ * @param fromPhoneNumber
644
+ */
645
+ public async fetchInboundSMS (phoneNumberID: any, fromPhoneNumber?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
646
+ const localVarPath = this.basePath + '/v1/merchant/sms/inbound/{phoneNumberID}'
647
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
648
+ let localVarQueryParameters: any = {};
649
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
650
+ const produces = ['application/json'];
651
+ // give precedence to 'application/json'
652
+ if (produces.indexOf('application/json') >= 0) {
653
+ localVarHeaderParams.Accept = 'application/json';
654
+ } else {
655
+ localVarHeaderParams.Accept = produces.join(',');
656
+ }
657
+ let localVarFormParams: any = {};
658
+
659
+ // verify required parameter 'phoneNumberID' is not null or undefined
660
+ if (phoneNumberID === null || phoneNumberID === undefined) {
661
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchInboundSMS.');
662
+ }
663
+
664
+ if (fromPhoneNumber !== undefined) {
665
+ localVarQueryParameters['fromPhoneNumber'] = ObjectSerializer.serialize(fromPhoneNumber, "string");
666
+ }
667
+
668
+ (<any>Object).assign(localVarHeaderParams, options.headers);
669
+
670
+ let localVarUseFormData = false;
671
+
672
+ let localVarRequestOptions: localVarRequest.Options = {
673
+ method: 'GET',
674
+ qs: localVarQueryParameters,
675
+ headers: localVarHeaderParams,
676
+ uri: localVarPath,
677
+ useQuerystring: this._useQuerystring,
678
+ json: true,
679
+ };
680
+
681
+ let authenticationPromise = Promise.resolve();
682
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
683
+
684
+ let interceptorPromise = authenticationPromise;
685
+ for (const interceptor of this.interceptors) {
686
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
687
+ }
688
+
689
+ return interceptorPromise.then(() => {
690
+ if (Object.keys(localVarFormParams).length) {
691
+ if (localVarUseFormData) {
692
+ (<any>localVarRequestOptions).formData = localVarFormParams;
693
+ } else {
694
+ localVarRequestOptions.form = localVarFormParams;
695
+ }
696
+ }
697
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
698
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
699
+ if (error) {
700
+ reject(error);
701
+ } else {
702
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
703
+ body = ObjectSerializer.deserialize(body, "any");
704
+ resolve({ response: response, body: body });
705
+ } else {
706
+ reject(new HttpError(response, body, response.statusCode));
707
+ }
708
+ }
709
+ });
710
+ });
711
+ });
712
+ }
713
+ /**
714
+ *
715
+ * @summary Fetch outbound SMSes
716
+ * @param phoneNumberID
717
+ * @param toPhoneNumber
718
+ */
719
+ public async fetchMerchantOutboundSMS (phoneNumberID: any, toPhoneNumber: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
720
+ const localVarPath = this.basePath + '/v1/merchant/sms/outbound/{phoneNumberID}'
721
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
722
+ let localVarQueryParameters: any = {};
723
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
724
+ const produces = ['application/json'];
725
+ // give precedence to 'application/json'
726
+ if (produces.indexOf('application/json') >= 0) {
727
+ localVarHeaderParams.Accept = 'application/json';
728
+ } else {
729
+ localVarHeaderParams.Accept = produces.join(',');
730
+ }
731
+ let localVarFormParams: any = {};
732
+
733
+ // verify required parameter 'phoneNumberID' is not null or undefined
734
+ if (phoneNumberID === null || phoneNumberID === undefined) {
735
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchMerchantOutboundSMS.');
736
+ }
737
+
738
+ // verify required parameter 'toPhoneNumber' is not null or undefined
739
+ if (toPhoneNumber === null || toPhoneNumber === undefined) {
740
+ throw new Error('Required parameter toPhoneNumber was null or undefined when calling fetchMerchantOutboundSMS.');
741
+ }
742
+
743
+ if (toPhoneNumber !== undefined) {
744
+ localVarQueryParameters['toPhoneNumber'] = ObjectSerializer.serialize(toPhoneNumber, "string");
745
+ }
746
+
747
+ (<any>Object).assign(localVarHeaderParams, options.headers);
748
+
749
+ let localVarUseFormData = false;
750
+
751
+ let localVarRequestOptions: localVarRequest.Options = {
752
+ method: 'GET',
753
+ qs: localVarQueryParameters,
754
+ headers: localVarHeaderParams,
755
+ uri: localVarPath,
756
+ useQuerystring: this._useQuerystring,
757
+ json: true,
758
+ };
759
+
760
+ let authenticationPromise = Promise.resolve();
761
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
762
+
763
+ let interceptorPromise = authenticationPromise;
764
+ for (const interceptor of this.interceptors) {
765
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
766
+ }
767
+
768
+ return interceptorPromise.then(() => {
769
+ if (Object.keys(localVarFormParams).length) {
770
+ if (localVarUseFormData) {
771
+ (<any>localVarRequestOptions).formData = localVarFormParams;
772
+ } else {
773
+ localVarRequestOptions.form = localVarFormParams;
774
+ }
775
+ }
776
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
777
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
778
+ if (error) {
779
+ reject(error);
780
+ } else {
781
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
782
+ body = ObjectSerializer.deserialize(body, "any");
783
+ resolve({ response: response, body: body });
784
+ } else {
785
+ reject(new HttpError(response, body, response.statusCode));
786
+ }
787
+ }
788
+ });
789
+ });
790
+ });
791
+ }
792
+ /**
793
+ *
794
+ * @summary Fetch all phone numbers
795
+ * @param isArchiveIncluded
796
+ * @param isApproved
797
+ */
798
+ public async fetchMerchantPhoneNumbers (isArchiveIncluded?: boolean, isApproved?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
799
+ const localVarPath = this.basePath + '/v1/merchant/phoneNumbers/all';
800
+ let localVarQueryParameters: any = {};
801
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
802
+ const produces = ['application/json'];
803
+ // give precedence to 'application/json'
804
+ if (produces.indexOf('application/json') >= 0) {
805
+ localVarHeaderParams.Accept = 'application/json';
806
+ } else {
807
+ localVarHeaderParams.Accept = produces.join(',');
808
+ }
809
+ let localVarFormParams: any = {};
810
+
811
+ if (isArchiveIncluded !== undefined) {
812
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
813
+ }
814
+
815
+ if (isApproved !== undefined) {
816
+ localVarQueryParameters['isApproved'] = ObjectSerializer.serialize(isApproved, "boolean");
817
+ }
818
+
819
+ (<any>Object).assign(localVarHeaderParams, options.headers);
820
+
821
+ let localVarUseFormData = false;
822
+
823
+ let localVarRequestOptions: localVarRequest.Options = {
824
+ method: 'GET',
825
+ qs: localVarQueryParameters,
826
+ headers: localVarHeaderParams,
827
+ uri: localVarPath,
828
+ useQuerystring: this._useQuerystring,
829
+ json: true,
830
+ };
831
+
832
+ let authenticationPromise = Promise.resolve();
833
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
834
+
835
+ let interceptorPromise = authenticationPromise;
836
+ for (const interceptor of this.interceptors) {
837
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
838
+ }
839
+
840
+ return interceptorPromise.then(() => {
841
+ if (Object.keys(localVarFormParams).length) {
842
+ if (localVarUseFormData) {
843
+ (<any>localVarRequestOptions).formData = localVarFormParams;
844
+ } else {
845
+ localVarRequestOptions.form = localVarFormParams;
846
+ }
847
+ }
848
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
849
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
850
+ if (error) {
851
+ reject(error);
852
+ } else {
853
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
854
+ body = ObjectSerializer.deserialize(body, "any");
855
+ resolve({ response: response, body: body });
856
+ } else {
857
+ reject(new HttpError(response, body, response.statusCode));
858
+ }
859
+ }
860
+ });
861
+ });
862
+ });
863
+ }
864
+ /**
865
+ *
866
+ * @summary Fetch opt in list
867
+ * @param listID
868
+ */
869
+ public async fetchOptInList (listID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
870
+ const localVarPath = this.basePath + '/v1/merchant/lists/optIn/{listID}'
871
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
872
+ let localVarQueryParameters: any = {};
873
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
874
+ const produces = ['application/json'];
875
+ // give precedence to 'application/json'
876
+ if (produces.indexOf('application/json') >= 0) {
877
+ localVarHeaderParams.Accept = 'application/json';
878
+ } else {
879
+ localVarHeaderParams.Accept = produces.join(',');
880
+ }
881
+ let localVarFormParams: any = {};
882
+
883
+ // verify required parameter 'listID' is not null or undefined
884
+ if (listID === null || listID === undefined) {
885
+ throw new Error('Required parameter listID was null or undefined when calling fetchOptInList.');
886
+ }
887
+
888
+ (<any>Object).assign(localVarHeaderParams, options.headers);
889
+
890
+ let localVarUseFormData = false;
891
+
892
+ let localVarRequestOptions: localVarRequest.Options = {
893
+ method: 'GET',
894
+ qs: localVarQueryParameters,
895
+ headers: localVarHeaderParams,
896
+ uri: localVarPath,
897
+ useQuerystring: this._useQuerystring,
898
+ json: true,
899
+ };
900
+
901
+ let authenticationPromise = Promise.resolve();
902
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
903
+
904
+ let interceptorPromise = authenticationPromise;
905
+ for (const interceptor of this.interceptors) {
906
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
907
+ }
908
+
909
+ return interceptorPromise.then(() => {
910
+ if (Object.keys(localVarFormParams).length) {
911
+ if (localVarUseFormData) {
912
+ (<any>localVarRequestOptions).formData = localVarFormParams;
913
+ } else {
914
+ localVarRequestOptions.form = localVarFormParams;
915
+ }
916
+ }
917
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
918
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
919
+ if (error) {
920
+ reject(error);
921
+ } else {
922
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
923
+ body = ObjectSerializer.deserialize(body, "any");
924
+ resolve({ response: response, body: body });
925
+ } else {
926
+ reject(new HttpError(response, body, response.statusCode));
927
+ }
928
+ }
929
+ });
930
+ });
931
+ });
932
+ }
933
+ /**
934
+ *
935
+ * @summary Fetch all opt in lists
936
+ * @param isArchiveIncluded
937
+ */
938
+ public async fetchOptInLists (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
939
+ const localVarPath = this.basePath + '/v1/merchant/lists/optIn/all';
940
+ let localVarQueryParameters: any = {};
941
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
942
+ const produces = ['application/json'];
943
+ // give precedence to 'application/json'
944
+ if (produces.indexOf('application/json') >= 0) {
945
+ localVarHeaderParams.Accept = 'application/json';
946
+ } else {
947
+ localVarHeaderParams.Accept = produces.join(',');
948
+ }
949
+ let localVarFormParams: any = {};
950
+
951
+ if (isArchiveIncluded !== undefined) {
952
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
953
+ }
954
+
955
+ (<any>Object).assign(localVarHeaderParams, options.headers);
956
+
957
+ let localVarUseFormData = false;
958
+
959
+ let localVarRequestOptions: localVarRequest.Options = {
960
+ method: 'GET',
961
+ qs: localVarQueryParameters,
962
+ headers: localVarHeaderParams,
963
+ uri: localVarPath,
964
+ useQuerystring: this._useQuerystring,
965
+ json: true,
966
+ };
967
+
968
+ let authenticationPromise = Promise.resolve();
969
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
970
+
971
+ let interceptorPromise = authenticationPromise;
972
+ for (const interceptor of this.interceptors) {
973
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
974
+ }
975
+
976
+ return interceptorPromise.then(() => {
977
+ if (Object.keys(localVarFormParams).length) {
978
+ if (localVarUseFormData) {
979
+ (<any>localVarRequestOptions).formData = localVarFormParams;
980
+ } else {
981
+ localVarRequestOptions.form = localVarFormParams;
982
+ }
983
+ }
984
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
985
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
986
+ if (error) {
987
+ reject(error);
988
+ } else {
989
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
990
+ body = ObjectSerializer.deserialize(body, "any");
991
+ resolve({ response: response, body: body });
992
+ } else {
993
+ reject(new HttpError(response, body, response.statusCode));
994
+ }
995
+ }
996
+ });
997
+ });
998
+ });
999
+ }
1000
+ /**
1001
+ *
1002
+ * @summary Fetch phone number
1003
+ * @param phoneNumberID
1004
+ */
1005
+ public async fetchPhoneNumber (phoneNumberID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1006
+ const localVarPath = this.basePath + '/v1/merchant/phoneNumber/{phoneNumberID}'
1007
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1008
+ let localVarQueryParameters: any = {};
1009
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1010
+ const produces = ['application/json'];
1011
+ // give precedence to 'application/json'
1012
+ if (produces.indexOf('application/json') >= 0) {
1013
+ localVarHeaderParams.Accept = 'application/json';
1014
+ } else {
1015
+ localVarHeaderParams.Accept = produces.join(',');
1016
+ }
1017
+ let localVarFormParams: any = {};
1018
+
1019
+ // verify required parameter 'phoneNumberID' is not null or undefined
1020
+ if (phoneNumberID === null || phoneNumberID === undefined) {
1021
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchPhoneNumber.');
1022
+ }
1023
+
1024
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1025
+
1026
+ let localVarUseFormData = false;
1027
+
1028
+ let localVarRequestOptions: localVarRequest.Options = {
1029
+ method: 'GET',
1030
+ qs: localVarQueryParameters,
1031
+ headers: localVarHeaderParams,
1032
+ uri: localVarPath,
1033
+ useQuerystring: this._useQuerystring,
1034
+ json: true,
1035
+ };
1036
+
1037
+ let authenticationPromise = Promise.resolve();
1038
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1039
+
1040
+ let interceptorPromise = authenticationPromise;
1041
+ for (const interceptor of this.interceptors) {
1042
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1043
+ }
1044
+
1045
+ return interceptorPromise.then(() => {
1046
+ if (Object.keys(localVarFormParams).length) {
1047
+ if (localVarUseFormData) {
1048
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1049
+ } else {
1050
+ localVarRequestOptions.form = localVarFormParams;
1051
+ }
1052
+ }
1053
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1054
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1055
+ if (error) {
1056
+ reject(error);
1057
+ } else {
1058
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1059
+ body = ObjectSerializer.deserialize(body, "any");
1060
+ resolve({ response: response, body: body });
1061
+ } else {
1062
+ reject(new HttpError(response, body, response.statusCode));
1063
+ }
1064
+ }
1065
+ });
1066
+ });
1067
+ });
1068
+ }
1069
+ /**
1070
+ *
1071
+ * @summary Fetch all simple SMS broadcasts
1072
+ * @param isArchiveIncluded
1073
+ */
1074
+ public async fetchSimpleSMSBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<SimpleSMSBroadcast>; }> {
1075
+ const localVarPath = this.basePath + '/v1/merchant/broadcasts/simpleSMS/all';
1076
+ let localVarQueryParameters: any = {};
1077
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1078
+ const produces = ['application/json'];
1079
+ // give precedence to 'application/json'
1080
+ if (produces.indexOf('application/json') >= 0) {
1081
+ localVarHeaderParams.Accept = 'application/json';
1082
+ } else {
1083
+ localVarHeaderParams.Accept = produces.join(',');
1084
+ }
1085
+ let localVarFormParams: any = {};
1086
+
1087
+ if (isArchiveIncluded !== undefined) {
1088
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
1089
+ }
1090
+
1091
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1092
+
1093
+ let localVarUseFormData = false;
1094
+
1095
+ let localVarRequestOptions: localVarRequest.Options = {
1096
+ method: 'GET',
1097
+ qs: localVarQueryParameters,
1098
+ headers: localVarHeaderParams,
1099
+ uri: localVarPath,
1100
+ useQuerystring: this._useQuerystring,
1101
+ json: true,
1102
+ };
1103
+
1104
+ let authenticationPromise = Promise.resolve();
1105
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1106
+
1107
+ let interceptorPromise = authenticationPromise;
1108
+ for (const interceptor of this.interceptors) {
1109
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1110
+ }
1111
+
1112
+ return interceptorPromise.then(() => {
1113
+ if (Object.keys(localVarFormParams).length) {
1114
+ if (localVarUseFormData) {
1115
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1116
+ } else {
1117
+ localVarRequestOptions.form = localVarFormParams;
1118
+ }
1119
+ }
1120
+ return new Promise<{ response: http.IncomingMessage; body: Array<SimpleSMSBroadcast>; }>((resolve, reject) => {
1121
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1122
+ if (error) {
1123
+ reject(error);
1124
+ } else {
1125
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1126
+ body = ObjectSerializer.deserialize(body, "Array<SimpleSMSBroadcast>");
1127
+ resolve({ response: response, body: body });
1128
+ } else {
1129
+ reject(new HttpError(response, body, response.statusCode));
1130
+ }
1131
+ }
1132
+ });
1133
+ });
1134
+ });
1135
+ }
1136
+ /**
1137
+ *
1138
+ * @summary Fetch all static voucher campaign broadcasts
1139
+ * @param isArchiveIncluded
1140
+ */
1141
+ public async fetchStaticVoucherCampaignBroadcasts (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<StaticVoucherCampaignBroadcast>; }> {
1142
+ const localVarPath = this.basePath + '/v1/merchant/broadcasts/staticVoucherCampaign/all';
1143
+ let localVarQueryParameters: any = {};
1144
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1145
+ const produces = ['application/json'];
1146
+ // give precedence to 'application/json'
1147
+ if (produces.indexOf('application/json') >= 0) {
1148
+ localVarHeaderParams.Accept = 'application/json';
1149
+ } else {
1150
+ localVarHeaderParams.Accept = produces.join(',');
1151
+ }
1152
+ let localVarFormParams: any = {};
1153
+
1154
+ if (isArchiveIncluded !== undefined) {
1155
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
1156
+ }
1157
+
1158
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1159
+
1160
+ let localVarUseFormData = false;
1161
+
1162
+ let localVarRequestOptions: localVarRequest.Options = {
1163
+ method: 'GET',
1164
+ qs: localVarQueryParameters,
1165
+ headers: localVarHeaderParams,
1166
+ uri: localVarPath,
1167
+ useQuerystring: this._useQuerystring,
1168
+ json: true,
1169
+ };
1170
+
1171
+ let authenticationPromise = Promise.resolve();
1172
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1173
+
1174
+ let interceptorPromise = authenticationPromise;
1175
+ for (const interceptor of this.interceptors) {
1176
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1177
+ }
1178
+
1179
+ return interceptorPromise.then(() => {
1180
+ if (Object.keys(localVarFormParams).length) {
1181
+ if (localVarUseFormData) {
1182
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1183
+ } else {
1184
+ localVarRequestOptions.form = localVarFormParams;
1185
+ }
1186
+ }
1187
+ return new Promise<{ response: http.IncomingMessage; body: Array<StaticVoucherCampaignBroadcast>; }>((resolve, reject) => {
1188
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1189
+ if (error) {
1190
+ reject(error);
1191
+ } else {
1192
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1193
+ body = ObjectSerializer.deserialize(body, "Array<StaticVoucherCampaignBroadcast>");
1194
+ resolve({ response: response, body: body });
1195
+ } else {
1196
+ reject(new HttpError(response, body, response.statusCode));
1197
+ }
1198
+ }
1199
+ });
1200
+ });
1201
+ });
1202
+ }
1203
+ /**
1204
+ *
1205
+ * @summary Fetch all TCPA Filters
1206
+ */
1207
+ public async fetchTCPAFilter (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }> {
1208
+ const localVarPath = this.basePath + '/v1/merchant/tcpa/filter/all';
1209
+ let localVarQueryParameters: any = {};
1210
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1211
+ const produces = ['application/json'];
1212
+ // give precedence to 'application/json'
1213
+ if (produces.indexOf('application/json') >= 0) {
1214
+ localVarHeaderParams.Accept = 'application/json';
1215
+ } else {
1216
+ localVarHeaderParams.Accept = produces.join(',');
1217
+ }
1218
+ let localVarFormParams: any = {};
1219
+
1220
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1221
+
1222
+ let localVarUseFormData = false;
1223
+
1224
+ let localVarRequestOptions: localVarRequest.Options = {
1225
+ method: 'GET',
1226
+ qs: localVarQueryParameters,
1227
+ headers: localVarHeaderParams,
1228
+ uri: localVarPath,
1229
+ useQuerystring: this._useQuerystring,
1230
+ json: true,
1231
+ };
1232
+
1233
+ let authenticationPromise = Promise.resolve();
1234
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1235
+
1236
+ let interceptorPromise = authenticationPromise;
1237
+ for (const interceptor of this.interceptors) {
1238
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1239
+ }
1240
+
1241
+ return interceptorPromise.then(() => {
1242
+ if (Object.keys(localVarFormParams).length) {
1243
+ if (localVarUseFormData) {
1244
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1245
+ } else {
1246
+ localVarRequestOptions.form = localVarFormParams;
1247
+ }
1248
+ }
1249
+ return new Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }>((resolve, reject) => {
1250
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1251
+ if (error) {
1252
+ reject(error);
1253
+ } else {
1254
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1255
+ body = ObjectSerializer.deserialize(body, "Array<Tcpa>");
1256
+ resolve({ response: response, body: body });
1257
+ } else {
1258
+ reject(new HttpError(response, body, response.statusCode));
1259
+ }
1260
+ }
1261
+ });
1262
+ });
1263
+ });
1264
+ }
1265
+ /**
1266
+ *
1267
+ * @summary Fetch wallet configuration
1268
+ */
1269
+ public async fetchWalletConfiguration (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1270
+ const localVarPath = this.basePath + '/v1/merchant/wallet/configuration';
1271
+ let localVarQueryParameters: any = {};
1272
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1273
+ const produces = ['application/json'];
1274
+ // give precedence to 'application/json'
1275
+ if (produces.indexOf('application/json') >= 0) {
1276
+ localVarHeaderParams.Accept = 'application/json';
1277
+ } else {
1278
+ localVarHeaderParams.Accept = produces.join(',');
1279
+ }
1280
+ let localVarFormParams: any = {};
1281
+
1282
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1283
+
1284
+ let localVarUseFormData = false;
1285
+
1286
+ let localVarRequestOptions: localVarRequest.Options = {
1287
+ method: 'GET',
1288
+ qs: localVarQueryParameters,
1289
+ headers: localVarHeaderParams,
1290
+ uri: localVarPath,
1291
+ useQuerystring: this._useQuerystring,
1292
+ json: true,
1293
+ };
1294
+
1295
+ let authenticationPromise = Promise.resolve();
1296
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1297
+
1298
+ let interceptorPromise = authenticationPromise;
1299
+ for (const interceptor of this.interceptors) {
1300
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1301
+ }
1302
+
1303
+ return interceptorPromise.then(() => {
1304
+ if (Object.keys(localVarFormParams).length) {
1305
+ if (localVarUseFormData) {
1306
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1307
+ } else {
1308
+ localVarRequestOptions.form = localVarFormParams;
1309
+ }
1310
+ }
1311
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1312
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1313
+ if (error) {
1314
+ reject(error);
1315
+ } else {
1316
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1317
+ body = ObjectSerializer.deserialize(body, "any");
1318
+ resolve({ response: response, body: body });
1319
+ } else {
1320
+ reject(new HttpError(response, body, response.statusCode));
1321
+ }
1322
+ }
1323
+ });
1324
+ });
1325
+ });
1326
+ }
1327
+ /**
1328
+ *
1329
+ * @summary Update billing contact
1330
+ * @param inlineObject22
1331
+ */
1332
+ public async updateBillingContact (inlineObject22: InlineObject22, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1333
+ const localVarPath = this.basePath + '/v1/merchant/billing/contact';
1334
+ let localVarQueryParameters: any = {};
1335
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1336
+ const produces = ['application/json'];
1337
+ // give precedence to 'application/json'
1338
+ if (produces.indexOf('application/json') >= 0) {
1339
+ localVarHeaderParams.Accept = 'application/json';
1340
+ } else {
1341
+ localVarHeaderParams.Accept = produces.join(',');
1342
+ }
1343
+ let localVarFormParams: any = {};
1344
+
1345
+ // verify required parameter 'inlineObject22' is not null or undefined
1346
+ if (inlineObject22 === null || inlineObject22 === undefined) {
1347
+ throw new Error('Required parameter inlineObject22 was null or undefined when calling updateBillingContact.');
1348
+ }
1349
+
1350
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1351
+
1352
+ let localVarUseFormData = false;
1353
+
1354
+ let localVarRequestOptions: localVarRequest.Options = {
1355
+ method: 'PUT',
1356
+ qs: localVarQueryParameters,
1357
+ headers: localVarHeaderParams,
1358
+ uri: localVarPath,
1359
+ useQuerystring: this._useQuerystring,
1360
+ json: true,
1361
+ body: ObjectSerializer.serialize(inlineObject22, "InlineObject22")
1362
+ };
1363
+
1364
+ let authenticationPromise = Promise.resolve();
1365
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1366
+
1367
+ let interceptorPromise = authenticationPromise;
1368
+ for (const interceptor of this.interceptors) {
1369
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1370
+ }
1371
+
1372
+ return interceptorPromise.then(() => {
1373
+ if (Object.keys(localVarFormParams).length) {
1374
+ if (localVarUseFormData) {
1375
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1376
+ } else {
1377
+ localVarRequestOptions.form = localVarFormParams;
1378
+ }
1379
+ }
1380
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1381
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1382
+ if (error) {
1383
+ reject(error);
1384
+ } else {
1385
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1386
+ body = ObjectSerializer.deserialize(body, "any");
1387
+ resolve({ response: response, body: body });
1388
+ } else {
1389
+ reject(new HttpError(response, body, response.statusCode));
1390
+ }
1391
+ }
1392
+ });
1393
+ });
1394
+ });
1395
+ }
1396
+ /**
1397
+ *
1398
+ * @summary Update merchant details
1399
+ * @param inlineObject21
1400
+ */
1401
+ public async updateMerchant (inlineObject21: InlineObject21, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1402
+ const localVarPath = this.basePath + '/v1/merchant';
1403
+ let localVarQueryParameters: any = {};
1404
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1405
+ const produces = ['application/json'];
1406
+ // give precedence to 'application/json'
1407
+ if (produces.indexOf('application/json') >= 0) {
1408
+ localVarHeaderParams.Accept = 'application/json';
1409
+ } else {
1410
+ localVarHeaderParams.Accept = produces.join(',');
1411
+ }
1412
+ let localVarFormParams: any = {};
1413
+
1414
+ // verify required parameter 'inlineObject21' is not null or undefined
1415
+ if (inlineObject21 === null || inlineObject21 === undefined) {
1416
+ throw new Error('Required parameter inlineObject21 was null or undefined when calling updateMerchant.');
1417
+ }
1418
+
1419
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1420
+
1421
+ let localVarUseFormData = false;
1422
+
1423
+ let localVarRequestOptions: localVarRequest.Options = {
1424
+ method: 'PUT',
1425
+ qs: localVarQueryParameters,
1426
+ headers: localVarHeaderParams,
1427
+ uri: localVarPath,
1428
+ useQuerystring: this._useQuerystring,
1429
+ json: true,
1430
+ body: ObjectSerializer.serialize(inlineObject21, "InlineObject21")
1431
+ };
1432
+
1433
+ let authenticationPromise = Promise.resolve();
1434
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1435
+
1436
+ let interceptorPromise = authenticationPromise;
1437
+ for (const interceptor of this.interceptors) {
1438
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1439
+ }
1440
+
1441
+ return interceptorPromise.then(() => {
1442
+ if (Object.keys(localVarFormParams).length) {
1443
+ if (localVarUseFormData) {
1444
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1445
+ } else {
1446
+ localVarRequestOptions.form = localVarFormParams;
1447
+ }
1448
+ }
1449
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1450
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1451
+ if (error) {
1452
+ reject(error);
1453
+ } else {
1454
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1455
+ body = ObjectSerializer.deserialize(body, "any");
1456
+ resolve({ response: response, body: body });
1457
+ } else {
1458
+ reject(new HttpError(response, body, response.statusCode));
1459
+ }
1460
+ }
1461
+ });
1462
+ });
1463
+ });
1464
+ }
1465
+ /**
1466
+ *
1467
+ * @summary Update POS Integration
1468
+ * @param inlineObject23
1469
+ */
1470
+ public async updatePosIntegration (inlineObject23: InlineObject23, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1471
+ const localVarPath = this.basePath + '/v1/merchant/pos/integration';
1472
+ let localVarQueryParameters: any = {};
1473
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1474
+ const produces = ['application/json'];
1475
+ // give precedence to 'application/json'
1476
+ if (produces.indexOf('application/json') >= 0) {
1477
+ localVarHeaderParams.Accept = 'application/json';
1478
+ } else {
1479
+ localVarHeaderParams.Accept = produces.join(',');
1480
+ }
1481
+ let localVarFormParams: any = {};
1482
+
1483
+ // verify required parameter 'inlineObject23' is not null or undefined
1484
+ if (inlineObject23 === null || inlineObject23 === undefined) {
1485
+ throw new Error('Required parameter inlineObject23 was null or undefined when calling updatePosIntegration.');
1486
+ }
1487
+
1488
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1489
+
1490
+ let localVarUseFormData = false;
1491
+
1492
+ let localVarRequestOptions: localVarRequest.Options = {
1493
+ method: 'PUT',
1494
+ qs: localVarQueryParameters,
1495
+ headers: localVarHeaderParams,
1496
+ uri: localVarPath,
1497
+ useQuerystring: this._useQuerystring,
1498
+ json: true,
1499
+ body: ObjectSerializer.serialize(inlineObject23, "InlineObject23")
1500
+ };
1501
+
1502
+ let authenticationPromise = Promise.resolve();
1503
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1504
+
1505
+ let interceptorPromise = authenticationPromise;
1506
+ for (const interceptor of this.interceptors) {
1507
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1508
+ }
1509
+
1510
+ return interceptorPromise.then(() => {
1511
+ if (Object.keys(localVarFormParams).length) {
1512
+ if (localVarUseFormData) {
1513
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1514
+ } else {
1515
+ localVarRequestOptions.form = localVarFormParams;
1516
+ }
1517
+ }
1518
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1519
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1520
+ if (error) {
1521
+ reject(error);
1522
+ } else {
1523
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1524
+ body = ObjectSerializer.deserialize(body, "any");
1525
+ resolve({ response: response, body: body });
1526
+ } else {
1527
+ reject(new HttpError(response, body, response.statusCode));
1528
+ }
1529
+ }
1530
+ });
1531
+ });
1532
+ });
1533
+ }
1534
+ }