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
package/api/sMSApi.ts CHANGED
@@ -1,1999 +1,1999 @@
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 { Agreement } from '../model/agreement';
19
- import { AuthError } from '../model/authError';
20
- import { FalsumError } from '../model/falsumError';
21
- import { ImportedList } from '../model/importedList';
22
- import { ImportedListRecipient } from '../model/importedListRecipient';
23
- import { InlineObject51 } from '../model/inlineObject51';
24
- import { InlineObject52 } from '../model/inlineObject52';
25
- import { InlineObject53 } from '../model/inlineObject53';
26
- import { InlineObject54 } from '../model/inlineObject54';
27
- import { InlineObject55 } from '../model/inlineObject55';
28
- import { InlineObject56 } from '../model/inlineObject56';
29
- import { InlineObject57 } from '../model/inlineObject57';
30
- import { InlineObject58 } from '../model/inlineObject58';
31
- import { InlineObject59 } from '../model/inlineObject59';
32
- import { InlineObject60 } from '../model/inlineObject60';
33
- import { InlineObject61 } from '../model/inlineObject61';
34
- import { InlineObject62 } from '../model/inlineObject62';
35
- import { InternalServerError } from '../model/internalServerError';
36
- import { OptInList } from '../model/optInList';
37
- import { OptInListSource } from '../model/optInListSource';
38
- import { OptInListSubscriber } from '../model/optInListSubscriber';
39
- import { OutboundSMS } from '../model/outboundSMS';
40
- import { PhoneNumber } from '../model/phoneNumber';
41
- import { Tcpa } from '../model/tcpa';
42
- import { WTOptInListCreationParams } from '../model/wTOptInListCreationParams';
43
-
44
- import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
45
- import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
46
-
47
- import { HttpError, RequestFile } from './apis';
48
-
49
- let defaultBasePath = 'https://api.wall.et';
50
-
51
- // ===============================================
52
- // This file is autogenerated - Please do not edit
53
- // ===============================================
54
-
55
- export enum SMSApiApiKeys {
56
- api_key,
57
- }
58
-
59
- export class SMSApi {
60
- protected _basePath = defaultBasePath;
61
- protected _defaultHeaders : any = {};
62
- protected _useQuerystring : boolean = false;
63
-
64
- protected authentications = {
65
- 'default': <Authentication>new VoidAuth(),
66
- 'api_key': new ApiKeyAuth('header', 'access-token'),
67
- }
68
-
69
- protected interceptors: Interceptor[] = [];
70
-
71
- constructor(basePath?: string);
72
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
73
- if (password) {
74
- if (basePath) {
75
- this.basePath = basePath;
76
- }
77
- } else {
78
- if (basePathOrUsername) {
79
- this.basePath = basePathOrUsername
80
- }
81
- }
82
- }
83
-
84
- set useQuerystring(value: boolean) {
85
- this._useQuerystring = value;
86
- }
87
-
88
- set basePath(basePath: string) {
89
- this._basePath = basePath;
90
- }
91
-
92
- set defaultHeaders(defaultHeaders: any) {
93
- this._defaultHeaders = defaultHeaders;
94
- }
95
-
96
- get defaultHeaders() {
97
- return this._defaultHeaders;
98
- }
99
-
100
- get basePath() {
101
- return this._basePath;
102
- }
103
-
104
- public setDefaultAuthentication(auth: Authentication) {
105
- this.authentications.default = auth;
106
- }
107
-
108
- public setApiKey(key: SMSApiApiKeys, value: string) {
109
- (this.authentications as any)[SMSApiApiKeys[key]].apiKey = value;
110
- }
111
-
112
- public addInterceptor(interceptor: Interceptor) {
113
- this.interceptors.push(interceptor);
114
- }
115
-
116
- /**
117
- *
118
- * @summary Acquire phone number
119
- * @param inlineObject52
120
- */
121
- public async acquirePhoneNumber (inlineObject52: InlineObject52, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
122
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/acquire';
123
- let localVarQueryParameters: any = {};
124
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
125
- const produces = ['application/json'];
126
- // give precedence to 'application/json'
127
- if (produces.indexOf('application/json') >= 0) {
128
- localVarHeaderParams.Accept = 'application/json';
129
- } else {
130
- localVarHeaderParams.Accept = produces.join(',');
131
- }
132
- let localVarFormParams: any = {};
133
-
134
- // verify required parameter 'inlineObject52' is not null or undefined
135
- if (inlineObject52 === null || inlineObject52 === undefined) {
136
- throw new Error('Required parameter inlineObject52 was null or undefined when calling acquirePhoneNumber.');
137
- }
138
-
139
- (<any>Object).assign(localVarHeaderParams, options.headers);
140
-
141
- let localVarUseFormData = false;
142
-
143
- let localVarRequestOptions: localVarRequest.Options = {
144
- method: 'POST',
145
- qs: localVarQueryParameters,
146
- headers: localVarHeaderParams,
147
- uri: localVarPath,
148
- useQuerystring: this._useQuerystring,
149
- json: true,
150
- body: ObjectSerializer.serialize(inlineObject52, "InlineObject52")
151
- };
152
-
153
- let authenticationPromise = Promise.resolve();
154
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
155
-
156
- let interceptorPromise = authenticationPromise;
157
- for (const interceptor of this.interceptors) {
158
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
159
- }
160
-
161
- return interceptorPromise.then(() => {
162
- if (Object.keys(localVarFormParams).length) {
163
- if (localVarUseFormData) {
164
- (<any>localVarRequestOptions).formData = localVarFormParams;
165
- } else {
166
- localVarRequestOptions.form = localVarFormParams;
167
- }
168
- }
169
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
170
- localVarRequest(localVarRequestOptions, (error, response, body) => {
171
- if (error) {
172
- reject(error);
173
- } else {
174
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
175
- body = ObjectSerializer.deserialize(body, "any");
176
- resolve({ response: response, body: body });
177
- } else {
178
- reject(new HttpError(response, body, response.statusCode));
179
- }
180
- }
181
- });
182
- });
183
- });
184
- }
185
- /**
186
- *
187
- * @summary Archive phone number
188
- * @param phoneNumberID
189
- */
190
- public async archivePhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PhoneNumber; }> {
191
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/{phoneNumberID}'
192
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
193
- let localVarQueryParameters: any = {};
194
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
195
- const produces = ['application/json'];
196
- // give precedence to 'application/json'
197
- if (produces.indexOf('application/json') >= 0) {
198
- localVarHeaderParams.Accept = 'application/json';
199
- } else {
200
- localVarHeaderParams.Accept = produces.join(',');
201
- }
202
- let localVarFormParams: any = {};
203
-
204
- // verify required parameter 'phoneNumberID' is not null or undefined
205
- if (phoneNumberID === null || phoneNumberID === undefined) {
206
- throw new Error('Required parameter phoneNumberID was null or undefined when calling archivePhoneNumber.');
207
- }
208
-
209
- (<any>Object).assign(localVarHeaderParams, options.headers);
210
-
211
- let localVarUseFormData = false;
212
-
213
- let localVarRequestOptions: localVarRequest.Options = {
214
- method: 'DELETE',
215
- qs: localVarQueryParameters,
216
- headers: localVarHeaderParams,
217
- uri: localVarPath,
218
- useQuerystring: this._useQuerystring,
219
- json: true,
220
- };
221
-
222
- let authenticationPromise = Promise.resolve();
223
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
224
-
225
- let interceptorPromise = authenticationPromise;
226
- for (const interceptor of this.interceptors) {
227
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
228
- }
229
-
230
- return interceptorPromise.then(() => {
231
- if (Object.keys(localVarFormParams).length) {
232
- if (localVarUseFormData) {
233
- (<any>localVarRequestOptions).formData = localVarFormParams;
234
- } else {
235
- localVarRequestOptions.form = localVarFormParams;
236
- }
237
- }
238
- return new Promise<{ response: http.IncomingMessage; body: PhoneNumber; }>((resolve, reject) => {
239
- localVarRequest(localVarRequestOptions, (error, response, body) => {
240
- if (error) {
241
- reject(error);
242
- } else {
243
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
244
- body = ObjectSerializer.deserialize(body, "PhoneNumber");
245
- resolve({ response: response, body: body });
246
- } else {
247
- reject(new HttpError(response, body, response.statusCode));
248
- }
249
- }
250
- });
251
- });
252
- });
253
- }
254
- /**
255
- *
256
- * @summary Create imported list
257
- * @param inlineObject60
258
- */
259
- public async createImportedList (inlineObject60: InlineObject60, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ImportedList; }> {
260
- const localVarPath = this.basePath + '/v1/sms/importedList';
261
- let localVarQueryParameters: any = {};
262
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
263
- const produces = ['application/json'];
264
- // give precedence to 'application/json'
265
- if (produces.indexOf('application/json') >= 0) {
266
- localVarHeaderParams.Accept = 'application/json';
267
- } else {
268
- localVarHeaderParams.Accept = produces.join(',');
269
- }
270
- let localVarFormParams: any = {};
271
-
272
- // verify required parameter 'inlineObject60' is not null or undefined
273
- if (inlineObject60 === null || inlineObject60 === undefined) {
274
- throw new Error('Required parameter inlineObject60 was null or undefined when calling createImportedList.');
275
- }
276
-
277
- (<any>Object).assign(localVarHeaderParams, options.headers);
278
-
279
- let localVarUseFormData = false;
280
-
281
- let localVarRequestOptions: localVarRequest.Options = {
282
- method: 'POST',
283
- qs: localVarQueryParameters,
284
- headers: localVarHeaderParams,
285
- uri: localVarPath,
286
- useQuerystring: this._useQuerystring,
287
- json: true,
288
- body: ObjectSerializer.serialize(inlineObject60, "InlineObject60")
289
- };
290
-
291
- let authenticationPromise = Promise.resolve();
292
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
293
-
294
- let interceptorPromise = authenticationPromise;
295
- for (const interceptor of this.interceptors) {
296
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
297
- }
298
-
299
- return interceptorPromise.then(() => {
300
- if (Object.keys(localVarFormParams).length) {
301
- if (localVarUseFormData) {
302
- (<any>localVarRequestOptions).formData = localVarFormParams;
303
- } else {
304
- localVarRequestOptions.form = localVarFormParams;
305
- }
306
- }
307
- return new Promise<{ response: http.IncomingMessage; body: ImportedList; }>((resolve, reject) => {
308
- localVarRequest(localVarRequestOptions, (error, response, body) => {
309
- if (error) {
310
- reject(error);
311
- } else {
312
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
313
- body = ObjectSerializer.deserialize(body, "ImportedList");
314
- resolve({ response: response, body: body });
315
- } else {
316
- reject(new HttpError(response, body, response.statusCode));
317
- }
318
- }
319
- });
320
- });
321
- });
322
- }
323
- /**
324
- *
325
- * @summary Create opt in list
326
- * @param wTOptInListCreationParams
327
- */
328
- public async createOptInList (wTOptInListCreationParams: WTOptInListCreationParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: OptInList; }> {
329
- const localVarPath = this.basePath + '/v1/sms/optInList';
330
- let localVarQueryParameters: any = {};
331
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
332
- const produces = ['application/json'];
333
- // give precedence to 'application/json'
334
- if (produces.indexOf('application/json') >= 0) {
335
- localVarHeaderParams.Accept = 'application/json';
336
- } else {
337
- localVarHeaderParams.Accept = produces.join(',');
338
- }
339
- let localVarFormParams: any = {};
340
-
341
- // verify required parameter 'wTOptInListCreationParams' is not null or undefined
342
- if (wTOptInListCreationParams === null || wTOptInListCreationParams === undefined) {
343
- throw new Error('Required parameter wTOptInListCreationParams was null or undefined when calling createOptInList.');
344
- }
345
-
346
- (<any>Object).assign(localVarHeaderParams, options.headers);
347
-
348
- let localVarUseFormData = false;
349
-
350
- let localVarRequestOptions: localVarRequest.Options = {
351
- method: 'POST',
352
- qs: localVarQueryParameters,
353
- headers: localVarHeaderParams,
354
- uri: localVarPath,
355
- useQuerystring: this._useQuerystring,
356
- json: true,
357
- body: ObjectSerializer.serialize(wTOptInListCreationParams, "WTOptInListCreationParams")
358
- };
359
-
360
- let authenticationPromise = Promise.resolve();
361
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
362
-
363
- let interceptorPromise = authenticationPromise;
364
- for (const interceptor of this.interceptors) {
365
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
366
- }
367
-
368
- return interceptorPromise.then(() => {
369
- if (Object.keys(localVarFormParams).length) {
370
- if (localVarUseFormData) {
371
- (<any>localVarRequestOptions).formData = localVarFormParams;
372
- } else {
373
- localVarRequestOptions.form = localVarFormParams;
374
- }
375
- }
376
- return new Promise<{ response: http.IncomingMessage; body: OptInList; }>((resolve, reject) => {
377
- localVarRequest(localVarRequestOptions, (error, response, body) => {
378
- if (error) {
379
- reject(error);
380
- } else {
381
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
382
- body = ObjectSerializer.deserialize(body, "OptInList");
383
- resolve({ response: response, body: body });
384
- } else {
385
- reject(new HttpError(response, body, response.statusCode));
386
- }
387
- }
388
- });
389
- });
390
- });
391
- }
392
- /**
393
- *
394
- * @summary Create opt in list source
395
- * @param inlineObject57
396
- */
397
- public async createOptInListSource (inlineObject57: InlineObject57, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: OptInListSource; }> {
398
- const localVarPath = this.basePath + '/v1/sms/optInListSource';
399
- let localVarQueryParameters: any = {};
400
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
401
- const produces = ['application/json'];
402
- // give precedence to 'application/json'
403
- if (produces.indexOf('application/json') >= 0) {
404
- localVarHeaderParams.Accept = 'application/json';
405
- } else {
406
- localVarHeaderParams.Accept = produces.join(',');
407
- }
408
- let localVarFormParams: any = {};
409
-
410
- // verify required parameter 'inlineObject57' is not null or undefined
411
- if (inlineObject57 === null || inlineObject57 === undefined) {
412
- throw new Error('Required parameter inlineObject57 was null or undefined when calling createOptInListSource.');
413
- }
414
-
415
- (<any>Object).assign(localVarHeaderParams, options.headers);
416
-
417
- let localVarUseFormData = false;
418
-
419
- let localVarRequestOptions: localVarRequest.Options = {
420
- method: 'POST',
421
- qs: localVarQueryParameters,
422
- headers: localVarHeaderParams,
423
- uri: localVarPath,
424
- useQuerystring: this._useQuerystring,
425
- json: true,
426
- body: ObjectSerializer.serialize(inlineObject57, "InlineObject57")
427
- };
428
-
429
- let authenticationPromise = Promise.resolve();
430
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
431
-
432
- let interceptorPromise = authenticationPromise;
433
- for (const interceptor of this.interceptors) {
434
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
435
- }
436
-
437
- return interceptorPromise.then(() => {
438
- if (Object.keys(localVarFormParams).length) {
439
- if (localVarUseFormData) {
440
- (<any>localVarRequestOptions).formData = localVarFormParams;
441
- } else {
442
- localVarRequestOptions.form = localVarFormParams;
443
- }
444
- }
445
- return new Promise<{ response: http.IncomingMessage; body: OptInListSource; }>((resolve, reject) => {
446
- localVarRequest(localVarRequestOptions, (error, response, body) => {
447
- if (error) {
448
- reject(error);
449
- } else {
450
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
451
- body = ObjectSerializer.deserialize(body, "OptInListSource");
452
- resolve({ response: response, body: body });
453
- } else {
454
- reject(new HttpError(response, body, response.statusCode));
455
- }
456
- }
457
- });
458
- });
459
- });
460
- }
461
- /**
462
- *
463
- * @summary Accept SMS agreement
464
- * @param inlineObject51
465
- */
466
- public async createSMSAgreement (inlineObject51: InlineObject51, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Agreement; }> {
467
- const localVarPath = this.basePath + '/v1/sms/agreement/create';
468
- let localVarQueryParameters: any = {};
469
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
470
- const produces = ['application/json'];
471
- // give precedence to 'application/json'
472
- if (produces.indexOf('application/json') >= 0) {
473
- localVarHeaderParams.Accept = 'application/json';
474
- } else {
475
- localVarHeaderParams.Accept = produces.join(',');
476
- }
477
- let localVarFormParams: any = {};
478
-
479
- // verify required parameter 'inlineObject51' is not null or undefined
480
- if (inlineObject51 === null || inlineObject51 === undefined) {
481
- throw new Error('Required parameter inlineObject51 was null or undefined when calling createSMSAgreement.');
482
- }
483
-
484
- (<any>Object).assign(localVarHeaderParams, options.headers);
485
-
486
- let localVarUseFormData = false;
487
-
488
- let localVarRequestOptions: localVarRequest.Options = {
489
- method: 'POST',
490
- qs: localVarQueryParameters,
491
- headers: localVarHeaderParams,
492
- uri: localVarPath,
493
- useQuerystring: this._useQuerystring,
494
- json: true,
495
- body: ObjectSerializer.serialize(inlineObject51, "InlineObject51")
496
- };
497
-
498
- let authenticationPromise = Promise.resolve();
499
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
500
-
501
- let interceptorPromise = authenticationPromise;
502
- for (const interceptor of this.interceptors) {
503
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
504
- }
505
-
506
- return interceptorPromise.then(() => {
507
- if (Object.keys(localVarFormParams).length) {
508
- if (localVarUseFormData) {
509
- (<any>localVarRequestOptions).formData = localVarFormParams;
510
- } else {
511
- localVarRequestOptions.form = localVarFormParams;
512
- }
513
- }
514
- return new Promise<{ response: http.IncomingMessage; body: Agreement; }>((resolve, reject) => {
515
- localVarRequest(localVarRequestOptions, (error, response, body) => {
516
- if (error) {
517
- reject(error);
518
- } else {
519
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
520
- body = ObjectSerializer.deserialize(body, "Agreement");
521
- resolve({ response: response, body: body });
522
- } else {
523
- reject(new HttpError(response, body, response.statusCode));
524
- }
525
- }
526
- });
527
- });
528
- });
529
- }
530
- /**
531
- *
532
- * @summary Export imported list recipients
533
- * @param importedListID
534
- */
535
- public async exportImportedListRecipients (importedListID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
536
- const localVarPath = this.basePath + '/v1/sms/importedList/recipients/export/{importedListID}'
537
- .replace('{' + 'importedListID' + '}', encodeURIComponent(String(importedListID)));
538
- let localVarQueryParameters: any = {};
539
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
540
- const produces = ['application/json'];
541
- // give precedence to 'application/json'
542
- if (produces.indexOf('application/json') >= 0) {
543
- localVarHeaderParams.Accept = 'application/json';
544
- } else {
545
- localVarHeaderParams.Accept = produces.join(',');
546
- }
547
- let localVarFormParams: any = {};
548
-
549
- // verify required parameter 'importedListID' is not null or undefined
550
- if (importedListID === null || importedListID === undefined) {
551
- throw new Error('Required parameter importedListID was null or undefined when calling exportImportedListRecipients.');
552
- }
553
-
554
- (<any>Object).assign(localVarHeaderParams, options.headers);
555
-
556
- let localVarUseFormData = false;
557
-
558
- let localVarRequestOptions: localVarRequest.Options = {
559
- method: 'POST',
560
- qs: localVarQueryParameters,
561
- headers: localVarHeaderParams,
562
- uri: localVarPath,
563
- useQuerystring: this._useQuerystring,
564
- json: true,
565
- };
566
-
567
- let authenticationPromise = Promise.resolve();
568
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
569
-
570
- let interceptorPromise = authenticationPromise;
571
- for (const interceptor of this.interceptors) {
572
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
573
- }
574
-
575
- return interceptorPromise.then(() => {
576
- if (Object.keys(localVarFormParams).length) {
577
- if (localVarUseFormData) {
578
- (<any>localVarRequestOptions).formData = localVarFormParams;
579
- } else {
580
- localVarRequestOptions.form = localVarFormParams;
581
- }
582
- }
583
- return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
584
- localVarRequest(localVarRequestOptions, (error, response, body) => {
585
- if (error) {
586
- reject(error);
587
- } else {
588
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
589
- body = ObjectSerializer.deserialize(body, "string");
590
- resolve({ response: response, body: body });
591
- } else {
592
- reject(new HttpError(response, body, response.statusCode));
593
- }
594
- }
595
- });
596
- });
597
- });
598
- }
599
- /**
600
- *
601
- * @summary Export opt in list subscribers
602
- * @param listID
603
- */
604
- public async exportOptInListSubscribers (listID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
605
- const localVarPath = this.basePath + '/v1/sms/optInList/subscribers/export/{listID}'
606
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
607
- let localVarQueryParameters: any = {};
608
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
609
- const produces = ['application/json'];
610
- // give precedence to 'application/json'
611
- if (produces.indexOf('application/json') >= 0) {
612
- localVarHeaderParams.Accept = 'application/json';
613
- } else {
614
- localVarHeaderParams.Accept = produces.join(',');
615
- }
616
- let localVarFormParams: any = {};
617
-
618
- // verify required parameter 'listID' is not null or undefined
619
- if (listID === null || listID === undefined) {
620
- throw new Error('Required parameter listID was null or undefined when calling exportOptInListSubscribers.');
621
- }
622
-
623
- (<any>Object).assign(localVarHeaderParams, options.headers);
624
-
625
- let localVarUseFormData = false;
626
-
627
- let localVarRequestOptions: localVarRequest.Options = {
628
- method: 'POST',
629
- qs: localVarQueryParameters,
630
- headers: localVarHeaderParams,
631
- uri: localVarPath,
632
- useQuerystring: this._useQuerystring,
633
- json: true,
634
- };
635
-
636
- let authenticationPromise = Promise.resolve();
637
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
638
-
639
- let interceptorPromise = authenticationPromise;
640
- for (const interceptor of this.interceptors) {
641
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
642
- }
643
-
644
- return interceptorPromise.then(() => {
645
- if (Object.keys(localVarFormParams).length) {
646
- if (localVarUseFormData) {
647
- (<any>localVarRequestOptions).formData = localVarFormParams;
648
- } else {
649
- localVarRequestOptions.form = localVarFormParams;
650
- }
651
- }
652
- return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
653
- localVarRequest(localVarRequestOptions, (error, response, body) => {
654
- if (error) {
655
- reject(error);
656
- } else {
657
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
658
- body = ObjectSerializer.deserialize(body, "string");
659
- resolve({ response: response, body: body });
660
- } else {
661
- reject(new HttpError(response, body, response.statusCode));
662
- }
663
- }
664
- });
665
- });
666
- });
667
- }
668
- /**
669
- *
670
- * @summary Fetch blocked TCPA entries
671
- * @param phoneNumberID
672
- */
673
- public async fetchBlockedTCPAEntries (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }> {
674
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/blocked/{phoneNumberID}'
675
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
676
- let localVarQueryParameters: any = {};
677
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
678
- const produces = ['application/json'];
679
- // give precedence to 'application/json'
680
- if (produces.indexOf('application/json') >= 0) {
681
- localVarHeaderParams.Accept = 'application/json';
682
- } else {
683
- localVarHeaderParams.Accept = produces.join(',');
684
- }
685
- let localVarFormParams: any = {};
686
-
687
- // verify required parameter 'phoneNumberID' is not null or undefined
688
- if (phoneNumberID === null || phoneNumberID === undefined) {
689
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchBlockedTCPAEntries.');
690
- }
691
-
692
- (<any>Object).assign(localVarHeaderParams, options.headers);
693
-
694
- let localVarUseFormData = false;
695
-
696
- let localVarRequestOptions: localVarRequest.Options = {
697
- method: 'GET',
698
- qs: localVarQueryParameters,
699
- headers: localVarHeaderParams,
700
- uri: localVarPath,
701
- useQuerystring: this._useQuerystring,
702
- json: true,
703
- };
704
-
705
- let authenticationPromise = Promise.resolve();
706
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
707
-
708
- let interceptorPromise = authenticationPromise;
709
- for (const interceptor of this.interceptors) {
710
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
711
- }
712
-
713
- return interceptorPromise.then(() => {
714
- if (Object.keys(localVarFormParams).length) {
715
- if (localVarUseFormData) {
716
- (<any>localVarRequestOptions).formData = localVarFormParams;
717
- } else {
718
- localVarRequestOptions.form = localVarFormParams;
719
- }
720
- }
721
- return new Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }>((resolve, reject) => {
722
- localVarRequest(localVarRequestOptions, (error, response, body) => {
723
- if (error) {
724
- reject(error);
725
- } else {
726
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
727
- body = ObjectSerializer.deserialize(body, "Array<Tcpa>");
728
- resolve({ response: response, body: body });
729
- } else {
730
- reject(new HttpError(response, body, response.statusCode));
731
- }
732
- }
733
- });
734
- });
735
- });
736
- }
737
- /**
738
- *
739
- * @summary Fetch imported list recipients
740
- * @param listID
741
- */
742
- public async fetchImportedListRecipients (listID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<ImportedListRecipient>; }> {
743
- const localVarPath = this.basePath + '/v1/sms/importedList/recipients/{listID}'
744
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
745
- let localVarQueryParameters: any = {};
746
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
747
- const produces = ['application/json'];
748
- // give precedence to 'application/json'
749
- if (produces.indexOf('application/json') >= 0) {
750
- localVarHeaderParams.Accept = 'application/json';
751
- } else {
752
- localVarHeaderParams.Accept = produces.join(',');
753
- }
754
- let localVarFormParams: any = {};
755
-
756
- // verify required parameter 'listID' is not null or undefined
757
- if (listID === null || listID === undefined) {
758
- throw new Error('Required parameter listID was null or undefined when calling fetchImportedListRecipients.');
759
- }
760
-
761
- (<any>Object).assign(localVarHeaderParams, options.headers);
762
-
763
- let localVarUseFormData = false;
764
-
765
- let localVarRequestOptions: localVarRequest.Options = {
766
- method: 'GET',
767
- qs: localVarQueryParameters,
768
- headers: localVarHeaderParams,
769
- uri: localVarPath,
770
- useQuerystring: this._useQuerystring,
771
- json: true,
772
- };
773
-
774
- let authenticationPromise = Promise.resolve();
775
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
776
-
777
- let interceptorPromise = authenticationPromise;
778
- for (const interceptor of this.interceptors) {
779
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
780
- }
781
-
782
- return interceptorPromise.then(() => {
783
- if (Object.keys(localVarFormParams).length) {
784
- if (localVarUseFormData) {
785
- (<any>localVarRequestOptions).formData = localVarFormParams;
786
- } else {
787
- localVarRequestOptions.form = localVarFormParams;
788
- }
789
- }
790
- return new Promise<{ response: http.IncomingMessage; body: Array<ImportedListRecipient>; }>((resolve, reject) => {
791
- localVarRequest(localVarRequestOptions, (error, response, body) => {
792
- if (error) {
793
- reject(error);
794
- } else {
795
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
796
- body = ObjectSerializer.deserialize(body, "Array<ImportedListRecipient>");
797
- resolve({ response: response, body: body });
798
- } else {
799
- reject(new HttpError(response, body, response.statusCode));
800
- }
801
- }
802
- });
803
- });
804
- });
805
- }
806
- /**
807
- *
808
- * @summary Fetch opt in list subscribers
809
- * @param listID
810
- * @param isSubscribed
811
- * @param isPendingAge21Verification
812
- * @param isArchiveIncluded
813
- */
814
- public async fetchOptInListSubscribers (listID: string, isSubscribed?: boolean, isPendingAge21Verification?: boolean, isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }> {
815
- const localVarPath = this.basePath + '/v1/sms/optInList/subscribers/{listID}'
816
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
817
- let localVarQueryParameters: any = {};
818
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
819
- const produces = ['application/json'];
820
- // give precedence to 'application/json'
821
- if (produces.indexOf('application/json') >= 0) {
822
- localVarHeaderParams.Accept = 'application/json';
823
- } else {
824
- localVarHeaderParams.Accept = produces.join(',');
825
- }
826
- let localVarFormParams: any = {};
827
-
828
- // verify required parameter 'listID' is not null or undefined
829
- if (listID === null || listID === undefined) {
830
- throw new Error('Required parameter listID was null or undefined when calling fetchOptInListSubscribers.');
831
- }
832
-
833
- if (isSubscribed !== undefined) {
834
- localVarQueryParameters['isSubscribed'] = ObjectSerializer.serialize(isSubscribed, "boolean");
835
- }
836
-
837
- if (isPendingAge21Verification !== undefined) {
838
- localVarQueryParameters['isPendingAge21Verification'] = ObjectSerializer.serialize(isPendingAge21Verification, "boolean");
839
- }
840
-
841
- if (isArchiveIncluded !== undefined) {
842
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
843
- }
844
-
845
- (<any>Object).assign(localVarHeaderParams, options.headers);
846
-
847
- let localVarUseFormData = false;
848
-
849
- let localVarRequestOptions: localVarRequest.Options = {
850
- method: 'GET',
851
- qs: localVarQueryParameters,
852
- headers: localVarHeaderParams,
853
- uri: localVarPath,
854
- useQuerystring: this._useQuerystring,
855
- json: true,
856
- };
857
-
858
- let authenticationPromise = Promise.resolve();
859
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
860
-
861
- let interceptorPromise = authenticationPromise;
862
- for (const interceptor of this.interceptors) {
863
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
864
- }
865
-
866
- return interceptorPromise.then(() => {
867
- if (Object.keys(localVarFormParams).length) {
868
- if (localVarUseFormData) {
869
- (<any>localVarRequestOptions).formData = localVarFormParams;
870
- } else {
871
- localVarRequestOptions.form = localVarFormParams;
872
- }
873
- }
874
- return new Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }>((resolve, reject) => {
875
- localVarRequest(localVarRequestOptions, (error, response, body) => {
876
- if (error) {
877
- reject(error);
878
- } else {
879
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
880
- body = ObjectSerializer.deserialize(body, "Array<OptInListSubscriber>");
881
- resolve({ response: response, body: body });
882
- } else {
883
- reject(new HttpError(response, body, response.statusCode));
884
- }
885
- }
886
- });
887
- });
888
- });
889
- }
890
- /**
891
- *
892
- * @summary Fetch opt in lists
893
- * @param phoneNumberID
894
- */
895
- public async fetchOptInListsAssociatedWithPhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
896
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/lists/{phoneNumberID}'
897
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
898
- let localVarQueryParameters: any = {};
899
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
900
- const produces = ['application/json'];
901
- // give precedence to 'application/json'
902
- if (produces.indexOf('application/json') >= 0) {
903
- localVarHeaderParams.Accept = 'application/json';
904
- } else {
905
- localVarHeaderParams.Accept = produces.join(',');
906
- }
907
- let localVarFormParams: any = {};
908
-
909
- // verify required parameter 'phoneNumberID' is not null or undefined
910
- if (phoneNumberID === null || phoneNumberID === undefined) {
911
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchOptInListsAssociatedWithPhoneNumber.');
912
- }
913
-
914
- (<any>Object).assign(localVarHeaderParams, options.headers);
915
-
916
- let localVarUseFormData = false;
917
-
918
- let localVarRequestOptions: localVarRequest.Options = {
919
- method: 'GET',
920
- qs: localVarQueryParameters,
921
- headers: localVarHeaderParams,
922
- uri: localVarPath,
923
- useQuerystring: this._useQuerystring,
924
- json: true,
925
- };
926
-
927
- let authenticationPromise = Promise.resolve();
928
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
929
-
930
- let interceptorPromise = authenticationPromise;
931
- for (const interceptor of this.interceptors) {
932
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
933
- }
934
-
935
- return interceptorPromise.then(() => {
936
- if (Object.keys(localVarFormParams).length) {
937
- if (localVarUseFormData) {
938
- (<any>localVarRequestOptions).formData = localVarFormParams;
939
- } else {
940
- localVarRequestOptions.form = localVarFormParams;
941
- }
942
- }
943
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
944
- localVarRequest(localVarRequestOptions, (error, response, body) => {
945
- if (error) {
946
- reject(error);
947
- } else {
948
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
949
- body = ObjectSerializer.deserialize(body, "any");
950
- resolve({ response: response, body: body });
951
- } else {
952
- reject(new HttpError(response, body, response.statusCode));
953
- }
954
- }
955
- });
956
- });
957
- });
958
- }
959
- /**
960
- *
961
- * @summary Fetch opt in source subscribers
962
- * @param sourceID
963
- * @param isSubscribed
964
- * @param isPendingAge21Verification
965
- * @param isArchiveIncluded
966
- */
967
- public async fetchOptInSourceSubscribers (sourceID: string, isSubscribed?: boolean, isPendingAge21Verification?: boolean, isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }> {
968
- const localVarPath = this.basePath + '/v1/sms/optInSource/subscribers/{sourceID}'
969
- .replace('{' + 'sourceID' + '}', encodeURIComponent(String(sourceID)));
970
- let localVarQueryParameters: any = {};
971
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
972
- const produces = ['application/json'];
973
- // give precedence to 'application/json'
974
- if (produces.indexOf('application/json') >= 0) {
975
- localVarHeaderParams.Accept = 'application/json';
976
- } else {
977
- localVarHeaderParams.Accept = produces.join(',');
978
- }
979
- let localVarFormParams: any = {};
980
-
981
- // verify required parameter 'sourceID' is not null or undefined
982
- if (sourceID === null || sourceID === undefined) {
983
- throw new Error('Required parameter sourceID was null or undefined when calling fetchOptInSourceSubscribers.');
984
- }
985
-
986
- if (isSubscribed !== undefined) {
987
- localVarQueryParameters['isSubscribed'] = ObjectSerializer.serialize(isSubscribed, "boolean");
988
- }
989
-
990
- if (isPendingAge21Verification !== undefined) {
991
- localVarQueryParameters['isPendingAge21Verification'] = ObjectSerializer.serialize(isPendingAge21Verification, "boolean");
992
- }
993
-
994
- if (isArchiveIncluded !== undefined) {
995
- localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
996
- }
997
-
998
- (<any>Object).assign(localVarHeaderParams, options.headers);
999
-
1000
- let localVarUseFormData = false;
1001
-
1002
- let localVarRequestOptions: localVarRequest.Options = {
1003
- method: 'GET',
1004
- qs: localVarQueryParameters,
1005
- headers: localVarHeaderParams,
1006
- uri: localVarPath,
1007
- useQuerystring: this._useQuerystring,
1008
- json: true,
1009
- };
1010
-
1011
- let authenticationPromise = Promise.resolve();
1012
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1013
-
1014
- let interceptorPromise = authenticationPromise;
1015
- for (const interceptor of this.interceptors) {
1016
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1017
- }
1018
-
1019
- return interceptorPromise.then(() => {
1020
- if (Object.keys(localVarFormParams).length) {
1021
- if (localVarUseFormData) {
1022
- (<any>localVarRequestOptions).formData = localVarFormParams;
1023
- } else {
1024
- localVarRequestOptions.form = localVarFormParams;
1025
- }
1026
- }
1027
- return new Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }>((resolve, reject) => {
1028
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1029
- if (error) {
1030
- reject(error);
1031
- } else {
1032
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1033
- body = ObjectSerializer.deserialize(body, "Array<OptInListSubscriber>");
1034
- resolve({ response: response, body: body });
1035
- } else {
1036
- reject(new HttpError(response, body, response.statusCode));
1037
- }
1038
- }
1039
- });
1040
- });
1041
- });
1042
- }
1043
- /**
1044
- *
1045
- * @summary Fetch opt in sources
1046
- * @param phoneNumberID
1047
- */
1048
- public async fetchOptInSourcesAssociatedWithPhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1049
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/sources/{phoneNumberID}'
1050
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1051
- let localVarQueryParameters: any = {};
1052
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1053
- const produces = ['application/json'];
1054
- // give precedence to 'application/json'
1055
- if (produces.indexOf('application/json') >= 0) {
1056
- localVarHeaderParams.Accept = 'application/json';
1057
- } else {
1058
- localVarHeaderParams.Accept = produces.join(',');
1059
- }
1060
- let localVarFormParams: any = {};
1061
-
1062
- // verify required parameter 'phoneNumberID' is not null or undefined
1063
- if (phoneNumberID === null || phoneNumberID === undefined) {
1064
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchOptInSourcesAssociatedWithPhoneNumber.');
1065
- }
1066
-
1067
- (<any>Object).assign(localVarHeaderParams, options.headers);
1068
-
1069
- let localVarUseFormData = false;
1070
-
1071
- let localVarRequestOptions: localVarRequest.Options = {
1072
- method: 'GET',
1073
- qs: localVarQueryParameters,
1074
- headers: localVarHeaderParams,
1075
- uri: localVarPath,
1076
- useQuerystring: this._useQuerystring,
1077
- json: true,
1078
- };
1079
-
1080
- let authenticationPromise = Promise.resolve();
1081
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1082
-
1083
- let interceptorPromise = authenticationPromise;
1084
- for (const interceptor of this.interceptors) {
1085
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1086
- }
1087
-
1088
- return interceptorPromise.then(() => {
1089
- if (Object.keys(localVarFormParams).length) {
1090
- if (localVarUseFormData) {
1091
- (<any>localVarRequestOptions).formData = localVarFormParams;
1092
- } else {
1093
- localVarRequestOptions.form = localVarFormParams;
1094
- }
1095
- }
1096
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1097
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1098
- if (error) {
1099
- reject(error);
1100
- } else {
1101
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1102
- body = ObjectSerializer.deserialize(body, "any");
1103
- resolve({ response: response, body: body });
1104
- } else {
1105
- reject(new HttpError(response, body, response.statusCode));
1106
- }
1107
- }
1108
- });
1109
- });
1110
- });
1111
- }
1112
- /**
1113
- *
1114
- * @summary Fetch outbound SMS
1115
- * @param phoneNumberID
1116
- * @param toPhoneNumber
1117
- * @param paymentObjectBroadcastID
1118
- */
1119
- public async fetchOutboundSMS (phoneNumberID: string, toPhoneNumber?: string, paymentObjectBroadcastID?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1120
- const localVarPath = this.basePath + '/v1/sms/outbound/{phoneNumberID}'
1121
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1122
- let localVarQueryParameters: any = {};
1123
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1124
- const produces = ['application/json'];
1125
- // give precedence to 'application/json'
1126
- if (produces.indexOf('application/json') >= 0) {
1127
- localVarHeaderParams.Accept = 'application/json';
1128
- } else {
1129
- localVarHeaderParams.Accept = produces.join(',');
1130
- }
1131
- let localVarFormParams: any = {};
1132
-
1133
- // verify required parameter 'phoneNumberID' is not null or undefined
1134
- if (phoneNumberID === null || phoneNumberID === undefined) {
1135
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchOutboundSMS.');
1136
- }
1137
-
1138
- if (toPhoneNumber !== undefined) {
1139
- localVarQueryParameters['toPhoneNumber'] = ObjectSerializer.serialize(toPhoneNumber, "string");
1140
- }
1141
-
1142
- if (paymentObjectBroadcastID !== undefined) {
1143
- localVarQueryParameters['paymentObjectBroadcastID'] = ObjectSerializer.serialize(paymentObjectBroadcastID, "string");
1144
- }
1145
-
1146
- (<any>Object).assign(localVarHeaderParams, options.headers);
1147
-
1148
- let localVarUseFormData = false;
1149
-
1150
- let localVarRequestOptions: localVarRequest.Options = {
1151
- method: 'GET',
1152
- qs: localVarQueryParameters,
1153
- headers: localVarHeaderParams,
1154
- uri: localVarPath,
1155
- useQuerystring: this._useQuerystring,
1156
- json: true,
1157
- };
1158
-
1159
- let authenticationPromise = Promise.resolve();
1160
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1161
-
1162
- let interceptorPromise = authenticationPromise;
1163
- for (const interceptor of this.interceptors) {
1164
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1165
- }
1166
-
1167
- return interceptorPromise.then(() => {
1168
- if (Object.keys(localVarFormParams).length) {
1169
- if (localVarUseFormData) {
1170
- (<any>localVarRequestOptions).formData = localVarFormParams;
1171
- } else {
1172
- localVarRequestOptions.form = localVarFormParams;
1173
- }
1174
- }
1175
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1176
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1177
- if (error) {
1178
- reject(error);
1179
- } else {
1180
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1181
- body = ObjectSerializer.deserialize(body, "any");
1182
- resolve({ response: response, body: body });
1183
- } else {
1184
- reject(new HttpError(response, body, response.statusCode));
1185
- }
1186
- }
1187
- });
1188
- });
1189
- });
1190
- }
1191
- /**
1192
- *
1193
- * @summary Fetch payment object broadcasts
1194
- * @param phoneNumberID
1195
- */
1196
- public async fetchPaymentObjectBroadcasts (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1197
- const localVarPath = this.basePath + '/v1/sms/paymentObjectBroadcasts/{phoneNumberID}'
1198
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1199
- let localVarQueryParameters: any = {};
1200
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1201
- const produces = ['application/json'];
1202
- // give precedence to 'application/json'
1203
- if (produces.indexOf('application/json') >= 0) {
1204
- localVarHeaderParams.Accept = 'application/json';
1205
- } else {
1206
- localVarHeaderParams.Accept = produces.join(',');
1207
- }
1208
- let localVarFormParams: any = {};
1209
-
1210
- // verify required parameter 'phoneNumberID' is not null or undefined
1211
- if (phoneNumberID === null || phoneNumberID === undefined) {
1212
- throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchPaymentObjectBroadcasts.');
1213
- }
1214
-
1215
- (<any>Object).assign(localVarHeaderParams, options.headers);
1216
-
1217
- let localVarUseFormData = false;
1218
-
1219
- let localVarRequestOptions: localVarRequest.Options = {
1220
- method: 'GET',
1221
- qs: localVarQueryParameters,
1222
- headers: localVarHeaderParams,
1223
- uri: localVarPath,
1224
- useQuerystring: this._useQuerystring,
1225
- json: true,
1226
- };
1227
-
1228
- let authenticationPromise = Promise.resolve();
1229
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1230
-
1231
- let interceptorPromise = authenticationPromise;
1232
- for (const interceptor of this.interceptors) {
1233
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1234
- }
1235
-
1236
- return interceptorPromise.then(() => {
1237
- if (Object.keys(localVarFormParams).length) {
1238
- if (localVarUseFormData) {
1239
- (<any>localVarRequestOptions).formData = localVarFormParams;
1240
- } else {
1241
- localVarRequestOptions.form = localVarFormParams;
1242
- }
1243
- }
1244
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1245
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1246
- if (error) {
1247
- reject(error);
1248
- } else {
1249
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1250
- body = ObjectSerializer.deserialize(body, "any");
1251
- resolve({ response: response, body: body });
1252
- } else {
1253
- reject(new HttpError(response, body, response.statusCode));
1254
- }
1255
- }
1256
- });
1257
- });
1258
- });
1259
- }
1260
- /**
1261
- *
1262
- * @summary Fetch SMS agreement
1263
- */
1264
- public async fetchSMSAgreement (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1265
- const localVarPath = this.basePath + '/v1/sms/agreement';
1266
- let localVarQueryParameters: any = {};
1267
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1268
- const produces = ['application/json'];
1269
- // give precedence to 'application/json'
1270
- if (produces.indexOf('application/json') >= 0) {
1271
- localVarHeaderParams.Accept = 'application/json';
1272
- } else {
1273
- localVarHeaderParams.Accept = produces.join(',');
1274
- }
1275
- let localVarFormParams: any = {};
1276
-
1277
- (<any>Object).assign(localVarHeaderParams, options.headers);
1278
-
1279
- let localVarUseFormData = false;
1280
-
1281
- let localVarRequestOptions: localVarRequest.Options = {
1282
- method: 'GET',
1283
- qs: localVarQueryParameters,
1284
- headers: localVarHeaderParams,
1285
- uri: localVarPath,
1286
- useQuerystring: this._useQuerystring,
1287
- json: true,
1288
- };
1289
-
1290
- let authenticationPromise = Promise.resolve();
1291
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1292
-
1293
- let interceptorPromise = authenticationPromise;
1294
- for (const interceptor of this.interceptors) {
1295
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1296
- }
1297
-
1298
- return interceptorPromise.then(() => {
1299
- if (Object.keys(localVarFormParams).length) {
1300
- if (localVarUseFormData) {
1301
- (<any>localVarRequestOptions).formData = localVarFormParams;
1302
- } else {
1303
- localVarRequestOptions.form = localVarFormParams;
1304
- }
1305
- }
1306
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1307
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1308
- if (error) {
1309
- reject(error);
1310
- } else {
1311
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1312
- body = ObjectSerializer.deserialize(body, "any");
1313
- resolve({ response: response, body: body });
1314
- } else {
1315
- reject(new HttpError(response, body, response.statusCode));
1316
- }
1317
- }
1318
- });
1319
- });
1320
- });
1321
- }
1322
- /**
1323
- *
1324
- * @summary Import imported list recipients
1325
- * @param importedListID
1326
- * @param inlineObject62
1327
- */
1328
- public async importImportedListRecipients (importedListID: string, inlineObject62: InlineObject62, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
1329
- const localVarPath = this.basePath + '/v1/sms/importedList/recipients/import/{importedListID}'
1330
- .replace('{' + 'importedListID' + '}', encodeURIComponent(String(importedListID)));
1331
- let localVarQueryParameters: any = {};
1332
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1333
- const produces = ['application/json'];
1334
- // give precedence to 'application/json'
1335
- if (produces.indexOf('application/json') >= 0) {
1336
- localVarHeaderParams.Accept = 'application/json';
1337
- } else {
1338
- localVarHeaderParams.Accept = produces.join(',');
1339
- }
1340
- let localVarFormParams: any = {};
1341
-
1342
- // verify required parameter 'importedListID' is not null or undefined
1343
- if (importedListID === null || importedListID === undefined) {
1344
- throw new Error('Required parameter importedListID was null or undefined when calling importImportedListRecipients.');
1345
- }
1346
-
1347
- // verify required parameter 'inlineObject62' is not null or undefined
1348
- if (inlineObject62 === null || inlineObject62 === undefined) {
1349
- throw new Error('Required parameter inlineObject62 was null or undefined when calling importImportedListRecipients.');
1350
- }
1351
-
1352
- (<any>Object).assign(localVarHeaderParams, options.headers);
1353
-
1354
- let localVarUseFormData = false;
1355
-
1356
- let localVarRequestOptions: localVarRequest.Options = {
1357
- method: 'POST',
1358
- qs: localVarQueryParameters,
1359
- headers: localVarHeaderParams,
1360
- uri: localVarPath,
1361
- useQuerystring: this._useQuerystring,
1362
- json: true,
1363
- body: ObjectSerializer.serialize(inlineObject62, "InlineObject62")
1364
- };
1365
-
1366
- let authenticationPromise = Promise.resolve();
1367
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1368
-
1369
- let interceptorPromise = authenticationPromise;
1370
- for (const interceptor of this.interceptors) {
1371
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1372
- }
1373
-
1374
- return interceptorPromise.then(() => {
1375
- if (Object.keys(localVarFormParams).length) {
1376
- if (localVarUseFormData) {
1377
- (<any>localVarRequestOptions).formData = localVarFormParams;
1378
- } else {
1379
- localVarRequestOptions.form = localVarFormParams;
1380
- }
1381
- }
1382
- return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
1383
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1384
- if (error) {
1385
- reject(error);
1386
- } else {
1387
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1388
- body = ObjectSerializer.deserialize(body, "string");
1389
- resolve({ response: response, body: body });
1390
- } else {
1391
- reject(new HttpError(response, body, response.statusCode));
1392
- }
1393
- }
1394
- });
1395
- });
1396
- });
1397
- }
1398
- /**
1399
- *
1400
- * @summary Import opt in list subscribers
1401
- * @param listID
1402
- * @param inlineObject59
1403
- */
1404
- public async importOptInListSubscribers (listID: string, inlineObject59: InlineObject59, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
1405
- const localVarPath = this.basePath + '/v1/sms/optInList/subscribers/import/{listID}'
1406
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1407
- let localVarQueryParameters: any = {};
1408
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1409
- const produces = ['application/json'];
1410
- // give precedence to 'application/json'
1411
- if (produces.indexOf('application/json') >= 0) {
1412
- localVarHeaderParams.Accept = 'application/json';
1413
- } else {
1414
- localVarHeaderParams.Accept = produces.join(',');
1415
- }
1416
- let localVarFormParams: any = {};
1417
-
1418
- // verify required parameter 'listID' is not null or undefined
1419
- if (listID === null || listID === undefined) {
1420
- throw new Error('Required parameter listID was null or undefined when calling importOptInListSubscribers.');
1421
- }
1422
-
1423
- // verify required parameter 'inlineObject59' is not null or undefined
1424
- if (inlineObject59 === null || inlineObject59 === undefined) {
1425
- throw new Error('Required parameter inlineObject59 was null or undefined when calling importOptInListSubscribers.');
1426
- }
1427
-
1428
- (<any>Object).assign(localVarHeaderParams, options.headers);
1429
-
1430
- let localVarUseFormData = false;
1431
-
1432
- let localVarRequestOptions: localVarRequest.Options = {
1433
- method: 'POST',
1434
- qs: localVarQueryParameters,
1435
- headers: localVarHeaderParams,
1436
- uri: localVarPath,
1437
- useQuerystring: this._useQuerystring,
1438
- json: true,
1439
- body: ObjectSerializer.serialize(inlineObject59, "InlineObject59")
1440
- };
1441
-
1442
- let authenticationPromise = Promise.resolve();
1443
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1444
-
1445
- let interceptorPromise = authenticationPromise;
1446
- for (const interceptor of this.interceptors) {
1447
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1448
- }
1449
-
1450
- return interceptorPromise.then(() => {
1451
- if (Object.keys(localVarFormParams).length) {
1452
- if (localVarUseFormData) {
1453
- (<any>localVarRequestOptions).formData = localVarFormParams;
1454
- } else {
1455
- localVarRequestOptions.form = localVarFormParams;
1456
- }
1457
- }
1458
- return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
1459
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1460
- if (error) {
1461
- reject(error);
1462
- } else {
1463
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1464
- body = ObjectSerializer.deserialize(body, "string");
1465
- resolve({ response: response, body: body });
1466
- } else {
1467
- reject(new HttpError(response, body, response.statusCode));
1468
- }
1469
- }
1470
- });
1471
- });
1472
- });
1473
- }
1474
- /**
1475
- *
1476
- * @summary Restore phone number
1477
- * @param phoneNumberID
1478
- */
1479
- public async restorePhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PhoneNumber; }> {
1480
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/{phoneNumberID}'
1481
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1482
- let localVarQueryParameters: any = {};
1483
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1484
- const produces = ['application/json'];
1485
- // give precedence to 'application/json'
1486
- if (produces.indexOf('application/json') >= 0) {
1487
- localVarHeaderParams.Accept = 'application/json';
1488
- } else {
1489
- localVarHeaderParams.Accept = produces.join(',');
1490
- }
1491
- let localVarFormParams: any = {};
1492
-
1493
- // verify required parameter 'phoneNumberID' is not null or undefined
1494
- if (phoneNumberID === null || phoneNumberID === undefined) {
1495
- throw new Error('Required parameter phoneNumberID was null or undefined when calling restorePhoneNumber.');
1496
- }
1497
-
1498
- (<any>Object).assign(localVarHeaderParams, options.headers);
1499
-
1500
- let localVarUseFormData = false;
1501
-
1502
- let localVarRequestOptions: localVarRequest.Options = {
1503
- method: 'PATCH',
1504
- qs: localVarQueryParameters,
1505
- headers: localVarHeaderParams,
1506
- uri: localVarPath,
1507
- useQuerystring: this._useQuerystring,
1508
- json: true,
1509
- };
1510
-
1511
- let authenticationPromise = Promise.resolve();
1512
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1513
-
1514
- let interceptorPromise = authenticationPromise;
1515
- for (const interceptor of this.interceptors) {
1516
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1517
- }
1518
-
1519
- return interceptorPromise.then(() => {
1520
- if (Object.keys(localVarFormParams).length) {
1521
- if (localVarUseFormData) {
1522
- (<any>localVarRequestOptions).formData = localVarFormParams;
1523
- } else {
1524
- localVarRequestOptions.form = localVarFormParams;
1525
- }
1526
- }
1527
- return new Promise<{ response: http.IncomingMessage; body: PhoneNumber; }>((resolve, reject) => {
1528
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1529
- if (error) {
1530
- reject(error);
1531
- } else {
1532
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1533
- body = ObjectSerializer.deserialize(body, "PhoneNumber");
1534
- resolve({ response: response, body: body });
1535
- } else {
1536
- reject(new HttpError(response, body, response.statusCode));
1537
- }
1538
- }
1539
- });
1540
- });
1541
- });
1542
- }
1543
- /**
1544
- *
1545
- * @summary Save imported list
1546
- * @param listID
1547
- * @param inlineObject61
1548
- */
1549
- public async saveImportedList (listID: string, inlineObject61: InlineObject61, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1550
- const localVarPath = this.basePath + '/v1/sms/importedList/{listID}'
1551
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1552
- let localVarQueryParameters: any = {};
1553
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1554
- const produces = ['application/json'];
1555
- // give precedence to 'application/json'
1556
- if (produces.indexOf('application/json') >= 0) {
1557
- localVarHeaderParams.Accept = 'application/json';
1558
- } else {
1559
- localVarHeaderParams.Accept = produces.join(',');
1560
- }
1561
- let localVarFormParams: any = {};
1562
-
1563
- // verify required parameter 'listID' is not null or undefined
1564
- if (listID === null || listID === undefined) {
1565
- throw new Error('Required parameter listID was null or undefined when calling saveImportedList.');
1566
- }
1567
-
1568
- // verify required parameter 'inlineObject61' is not null or undefined
1569
- if (inlineObject61 === null || inlineObject61 === undefined) {
1570
- throw new Error('Required parameter inlineObject61 was null or undefined when calling saveImportedList.');
1571
- }
1572
-
1573
- (<any>Object).assign(localVarHeaderParams, options.headers);
1574
-
1575
- let localVarUseFormData = false;
1576
-
1577
- let localVarRequestOptions: localVarRequest.Options = {
1578
- method: 'PUT',
1579
- qs: localVarQueryParameters,
1580
- headers: localVarHeaderParams,
1581
- uri: localVarPath,
1582
- useQuerystring: this._useQuerystring,
1583
- json: true,
1584
- body: ObjectSerializer.serialize(inlineObject61, "InlineObject61")
1585
- };
1586
-
1587
- let authenticationPromise = Promise.resolve();
1588
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1589
-
1590
- let interceptorPromise = authenticationPromise;
1591
- for (const interceptor of this.interceptors) {
1592
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1593
- }
1594
-
1595
- return interceptorPromise.then(() => {
1596
- if (Object.keys(localVarFormParams).length) {
1597
- if (localVarUseFormData) {
1598
- (<any>localVarRequestOptions).formData = localVarFormParams;
1599
- } else {
1600
- localVarRequestOptions.form = localVarFormParams;
1601
- }
1602
- }
1603
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1604
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1605
- if (error) {
1606
- reject(error);
1607
- } else {
1608
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1609
- body = ObjectSerializer.deserialize(body, "any");
1610
- resolve({ response: response, body: body });
1611
- } else {
1612
- reject(new HttpError(response, body, response.statusCode));
1613
- }
1614
- }
1615
- });
1616
- });
1617
- });
1618
- }
1619
- /**
1620
- *
1621
- * @summary Save opt in list
1622
- * @param listID
1623
- * @param inlineObject55
1624
- */
1625
- public async saveOptInList (listID: string, inlineObject55: InlineObject55, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1626
- const localVarPath = this.basePath + '/v1/sms/optInList/{listID}'
1627
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1628
- let localVarQueryParameters: any = {};
1629
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1630
- const produces = ['application/json'];
1631
- // give precedence to 'application/json'
1632
- if (produces.indexOf('application/json') >= 0) {
1633
- localVarHeaderParams.Accept = 'application/json';
1634
- } else {
1635
- localVarHeaderParams.Accept = produces.join(',');
1636
- }
1637
- let localVarFormParams: any = {};
1638
-
1639
- // verify required parameter 'listID' is not null or undefined
1640
- if (listID === null || listID === undefined) {
1641
- throw new Error('Required parameter listID was null or undefined when calling saveOptInList.');
1642
- }
1643
-
1644
- // verify required parameter 'inlineObject55' is not null or undefined
1645
- if (inlineObject55 === null || inlineObject55 === undefined) {
1646
- throw new Error('Required parameter inlineObject55 was null or undefined when calling saveOptInList.');
1647
- }
1648
-
1649
- (<any>Object).assign(localVarHeaderParams, options.headers);
1650
-
1651
- let localVarUseFormData = false;
1652
-
1653
- let localVarRequestOptions: localVarRequest.Options = {
1654
- method: 'PUT',
1655
- qs: localVarQueryParameters,
1656
- headers: localVarHeaderParams,
1657
- uri: localVarPath,
1658
- useQuerystring: this._useQuerystring,
1659
- json: true,
1660
- body: ObjectSerializer.serialize(inlineObject55, "InlineObject55")
1661
- };
1662
-
1663
- let authenticationPromise = Promise.resolve();
1664
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1665
-
1666
- let interceptorPromise = authenticationPromise;
1667
- for (const interceptor of this.interceptors) {
1668
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1669
- }
1670
-
1671
- return interceptorPromise.then(() => {
1672
- if (Object.keys(localVarFormParams).length) {
1673
- if (localVarUseFormData) {
1674
- (<any>localVarRequestOptions).formData = localVarFormParams;
1675
- } else {
1676
- localVarRequestOptions.form = localVarFormParams;
1677
- }
1678
- }
1679
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1680
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1681
- if (error) {
1682
- reject(error);
1683
- } else {
1684
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1685
- body = ObjectSerializer.deserialize(body, "any");
1686
- resolve({ response: response, body: body });
1687
- } else {
1688
- reject(new HttpError(response, body, response.statusCode));
1689
- }
1690
- }
1691
- });
1692
- });
1693
- });
1694
- }
1695
- /**
1696
- *
1697
- * @summary Save opt in list source
1698
- * @param sourceID
1699
- * @param inlineObject58
1700
- */
1701
- public async saveOptInListSource (sourceID: string, inlineObject58: InlineObject58, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: OptInListSource; }> {
1702
- const localVarPath = this.basePath + '/v1/sms/optInListSource/{sourceID}'
1703
- .replace('{' + 'sourceID' + '}', encodeURIComponent(String(sourceID)));
1704
- let localVarQueryParameters: any = {};
1705
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1706
- const produces = ['application/json'];
1707
- // give precedence to 'application/json'
1708
- if (produces.indexOf('application/json') >= 0) {
1709
- localVarHeaderParams.Accept = 'application/json';
1710
- } else {
1711
- localVarHeaderParams.Accept = produces.join(',');
1712
- }
1713
- let localVarFormParams: any = {};
1714
-
1715
- // verify required parameter 'sourceID' is not null or undefined
1716
- if (sourceID === null || sourceID === undefined) {
1717
- throw new Error('Required parameter sourceID was null or undefined when calling saveOptInListSource.');
1718
- }
1719
-
1720
- // verify required parameter 'inlineObject58' is not null or undefined
1721
- if (inlineObject58 === null || inlineObject58 === undefined) {
1722
- throw new Error('Required parameter inlineObject58 was null or undefined when calling saveOptInListSource.');
1723
- }
1724
-
1725
- (<any>Object).assign(localVarHeaderParams, options.headers);
1726
-
1727
- let localVarUseFormData = false;
1728
-
1729
- let localVarRequestOptions: localVarRequest.Options = {
1730
- method: 'PUT',
1731
- qs: localVarQueryParameters,
1732
- headers: localVarHeaderParams,
1733
- uri: localVarPath,
1734
- useQuerystring: this._useQuerystring,
1735
- json: true,
1736
- body: ObjectSerializer.serialize(inlineObject58, "InlineObject58")
1737
- };
1738
-
1739
- let authenticationPromise = Promise.resolve();
1740
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1741
-
1742
- let interceptorPromise = authenticationPromise;
1743
- for (const interceptor of this.interceptors) {
1744
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1745
- }
1746
-
1747
- return interceptorPromise.then(() => {
1748
- if (Object.keys(localVarFormParams).length) {
1749
- if (localVarUseFormData) {
1750
- (<any>localVarRequestOptions).formData = localVarFormParams;
1751
- } else {
1752
- localVarRequestOptions.form = localVarFormParams;
1753
- }
1754
- }
1755
- return new Promise<{ response: http.IncomingMessage; body: OptInListSource; }>((resolve, reject) => {
1756
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1757
- if (error) {
1758
- reject(error);
1759
- } else {
1760
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1761
- body = ObjectSerializer.deserialize(body, "OptInListSource");
1762
- resolve({ response: response, body: body });
1763
- } else {
1764
- reject(new HttpError(response, body, response.statusCode));
1765
- }
1766
- }
1767
- });
1768
- });
1769
- });
1770
- }
1771
- /**
1772
- *
1773
- * @summary Request phone number verification
1774
- * @param phoneNumberID
1775
- * @param inlineObject53
1776
- */
1777
- public async sendPhoneNumberForVerification (phoneNumberID: string, inlineObject53: InlineObject53, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
1778
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/verification/{phoneNumberID}'
1779
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1780
- let localVarQueryParameters: any = {};
1781
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1782
- const produces = ['application/json'];
1783
- // give precedence to 'application/json'
1784
- if (produces.indexOf('application/json') >= 0) {
1785
- localVarHeaderParams.Accept = 'application/json';
1786
- } else {
1787
- localVarHeaderParams.Accept = produces.join(',');
1788
- }
1789
- let localVarFormParams: any = {};
1790
-
1791
- // verify required parameter 'phoneNumberID' is not null or undefined
1792
- if (phoneNumberID === null || phoneNumberID === undefined) {
1793
- throw new Error('Required parameter phoneNumberID was null or undefined when calling sendPhoneNumberForVerification.');
1794
- }
1795
-
1796
- // verify required parameter 'inlineObject53' is not null or undefined
1797
- if (inlineObject53 === null || inlineObject53 === undefined) {
1798
- throw new Error('Required parameter inlineObject53 was null or undefined when calling sendPhoneNumberForVerification.');
1799
- }
1800
-
1801
- (<any>Object).assign(localVarHeaderParams, options.headers);
1802
-
1803
- let localVarUseFormData = false;
1804
-
1805
- let localVarRequestOptions: localVarRequest.Options = {
1806
- method: 'PUT',
1807
- qs: localVarQueryParameters,
1808
- headers: localVarHeaderParams,
1809
- uri: localVarPath,
1810
- useQuerystring: this._useQuerystring,
1811
- json: true,
1812
- body: ObjectSerializer.serialize(inlineObject53, "InlineObject53")
1813
- };
1814
-
1815
- let authenticationPromise = Promise.resolve();
1816
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1817
-
1818
- let interceptorPromise = authenticationPromise;
1819
- for (const interceptor of this.interceptors) {
1820
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1821
- }
1822
-
1823
- return interceptorPromise.then(() => {
1824
- if (Object.keys(localVarFormParams).length) {
1825
- if (localVarUseFormData) {
1826
- (<any>localVarRequestOptions).formData = localVarFormParams;
1827
- } else {
1828
- localVarRequestOptions.form = localVarFormParams;
1829
- }
1830
- }
1831
- return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
1832
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1833
- if (error) {
1834
- reject(error);
1835
- } else {
1836
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1837
- body = ObjectSerializer.deserialize(body, "string");
1838
- resolve({ response: response, body: body });
1839
- } else {
1840
- reject(new HttpError(response, body, response.statusCode));
1841
- }
1842
- }
1843
- });
1844
- });
1845
- });
1846
- }
1847
- /**
1848
- *
1849
- * @summary Send SMS to opt in list
1850
- * @param listID
1851
- * @param inlineObject56
1852
- */
1853
- public async sendSMSToOptInList (listID: string, inlineObject56: InlineObject56, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<OutboundSMS>; }> {
1854
- const localVarPath = this.basePath + '/v1/sms/optInList/send/{listID}'
1855
- .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1856
- let localVarQueryParameters: any = {};
1857
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1858
- const produces = ['application/json'];
1859
- // give precedence to 'application/json'
1860
- if (produces.indexOf('application/json') >= 0) {
1861
- localVarHeaderParams.Accept = 'application/json';
1862
- } else {
1863
- localVarHeaderParams.Accept = produces.join(',');
1864
- }
1865
- let localVarFormParams: any = {};
1866
-
1867
- // verify required parameter 'listID' is not null or undefined
1868
- if (listID === null || listID === undefined) {
1869
- throw new Error('Required parameter listID was null or undefined when calling sendSMSToOptInList.');
1870
- }
1871
-
1872
- // verify required parameter 'inlineObject56' is not null or undefined
1873
- if (inlineObject56 === null || inlineObject56 === undefined) {
1874
- throw new Error('Required parameter inlineObject56 was null or undefined when calling sendSMSToOptInList.');
1875
- }
1876
-
1877
- (<any>Object).assign(localVarHeaderParams, options.headers);
1878
-
1879
- let localVarUseFormData = false;
1880
-
1881
- let localVarRequestOptions: localVarRequest.Options = {
1882
- method: 'POST',
1883
- qs: localVarQueryParameters,
1884
- headers: localVarHeaderParams,
1885
- uri: localVarPath,
1886
- useQuerystring: this._useQuerystring,
1887
- json: true,
1888
- body: ObjectSerializer.serialize(inlineObject56, "InlineObject56")
1889
- };
1890
-
1891
- let authenticationPromise = Promise.resolve();
1892
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1893
-
1894
- let interceptorPromise = authenticationPromise;
1895
- for (const interceptor of this.interceptors) {
1896
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1897
- }
1898
-
1899
- return interceptorPromise.then(() => {
1900
- if (Object.keys(localVarFormParams).length) {
1901
- if (localVarUseFormData) {
1902
- (<any>localVarRequestOptions).formData = localVarFormParams;
1903
- } else {
1904
- localVarRequestOptions.form = localVarFormParams;
1905
- }
1906
- }
1907
- return new Promise<{ response: http.IncomingMessage; body: Array<OutboundSMS>; }>((resolve, reject) => {
1908
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1909
- if (error) {
1910
- reject(error);
1911
- } else {
1912
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1913
- body = ObjectSerializer.deserialize(body, "Array<OutboundSMS>");
1914
- resolve({ response: response, body: body });
1915
- } else {
1916
- reject(new HttpError(response, body, response.statusCode));
1917
- }
1918
- }
1919
- });
1920
- });
1921
- });
1922
- }
1923
- /**
1924
- *
1925
- * @summary Update phone number
1926
- * @param phoneNumberID
1927
- * @param inlineObject54
1928
- */
1929
- public async updatePhoneNumber (phoneNumberID: string, inlineObject54: InlineObject54, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1930
- const localVarPath = this.basePath + '/v1/sms/phoneNumber/{phoneNumberID}'
1931
- .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1932
- let localVarQueryParameters: any = {};
1933
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1934
- const produces = ['application/json'];
1935
- // give precedence to 'application/json'
1936
- if (produces.indexOf('application/json') >= 0) {
1937
- localVarHeaderParams.Accept = 'application/json';
1938
- } else {
1939
- localVarHeaderParams.Accept = produces.join(',');
1940
- }
1941
- let localVarFormParams: any = {};
1942
-
1943
- // verify required parameter 'phoneNumberID' is not null or undefined
1944
- if (phoneNumberID === null || phoneNumberID === undefined) {
1945
- throw new Error('Required parameter phoneNumberID was null or undefined when calling updatePhoneNumber.');
1946
- }
1947
-
1948
- // verify required parameter 'inlineObject54' is not null or undefined
1949
- if (inlineObject54 === null || inlineObject54 === undefined) {
1950
- throw new Error('Required parameter inlineObject54 was null or undefined when calling updatePhoneNumber.');
1951
- }
1952
-
1953
- (<any>Object).assign(localVarHeaderParams, options.headers);
1954
-
1955
- let localVarUseFormData = false;
1956
-
1957
- let localVarRequestOptions: localVarRequest.Options = {
1958
- method: 'PUT',
1959
- qs: localVarQueryParameters,
1960
- headers: localVarHeaderParams,
1961
- uri: localVarPath,
1962
- useQuerystring: this._useQuerystring,
1963
- json: true,
1964
- body: ObjectSerializer.serialize(inlineObject54, "InlineObject54")
1965
- };
1966
-
1967
- let authenticationPromise = Promise.resolve();
1968
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1969
-
1970
- let interceptorPromise = authenticationPromise;
1971
- for (const interceptor of this.interceptors) {
1972
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1973
- }
1974
-
1975
- return interceptorPromise.then(() => {
1976
- if (Object.keys(localVarFormParams).length) {
1977
- if (localVarUseFormData) {
1978
- (<any>localVarRequestOptions).formData = localVarFormParams;
1979
- } else {
1980
- localVarRequestOptions.form = localVarFormParams;
1981
- }
1982
- }
1983
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1984
- localVarRequest(localVarRequestOptions, (error, response, body) => {
1985
- if (error) {
1986
- reject(error);
1987
- } else {
1988
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1989
- body = ObjectSerializer.deserialize(body, "any");
1990
- resolve({ response: response, body: body });
1991
- } else {
1992
- reject(new HttpError(response, body, response.statusCode));
1993
- }
1994
- }
1995
- });
1996
- });
1997
- });
1998
- }
1999
- }
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 { Agreement } from '../model/agreement';
19
+ import { AuthError } from '../model/authError';
20
+ import { FalsumError } from '../model/falsumError';
21
+ import { ImportedList } from '../model/importedList';
22
+ import { ImportedListRecipient } from '../model/importedListRecipient';
23
+ import { InlineObject51 } from '../model/inlineObject51';
24
+ import { InlineObject52 } from '../model/inlineObject52';
25
+ import { InlineObject53 } from '../model/inlineObject53';
26
+ import { InlineObject54 } from '../model/inlineObject54';
27
+ import { InlineObject55 } from '../model/inlineObject55';
28
+ import { InlineObject56 } from '../model/inlineObject56';
29
+ import { InlineObject57 } from '../model/inlineObject57';
30
+ import { InlineObject58 } from '../model/inlineObject58';
31
+ import { InlineObject59 } from '../model/inlineObject59';
32
+ import { InlineObject60 } from '../model/inlineObject60';
33
+ import { InlineObject61 } from '../model/inlineObject61';
34
+ import { InlineObject62 } from '../model/inlineObject62';
35
+ import { InternalServerError } from '../model/internalServerError';
36
+ import { OptInList } from '../model/optInList';
37
+ import { OptInListSource } from '../model/optInListSource';
38
+ import { OptInListSubscriber } from '../model/optInListSubscriber';
39
+ import { OutboundSMS } from '../model/outboundSMS';
40
+ import { PhoneNumber } from '../model/phoneNumber';
41
+ import { Tcpa } from '../model/tcpa';
42
+ import { WTOptInListCreationParams } from '../model/wTOptInListCreationParams';
43
+
44
+ import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
45
+ import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
46
+
47
+ import { HttpError, RequestFile } from './apis';
48
+
49
+ let defaultBasePath = 'https://api.wall.et';
50
+
51
+ // ===============================================
52
+ // This file is autogenerated - Please do not edit
53
+ // ===============================================
54
+
55
+ export enum SMSApiApiKeys {
56
+ api_key,
57
+ }
58
+
59
+ export class SMSApi {
60
+ protected _basePath = defaultBasePath;
61
+ protected _defaultHeaders : any = {};
62
+ protected _useQuerystring : boolean = false;
63
+
64
+ protected authentications = {
65
+ 'default': <Authentication>new VoidAuth(),
66
+ 'api_key': new ApiKeyAuth('header', 'access-token'),
67
+ }
68
+
69
+ protected interceptors: Interceptor[] = [];
70
+
71
+ constructor(basePath?: string);
72
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
73
+ if (password) {
74
+ if (basePath) {
75
+ this.basePath = basePath;
76
+ }
77
+ } else {
78
+ if (basePathOrUsername) {
79
+ this.basePath = basePathOrUsername
80
+ }
81
+ }
82
+ }
83
+
84
+ set useQuerystring(value: boolean) {
85
+ this._useQuerystring = value;
86
+ }
87
+
88
+ set basePath(basePath: string) {
89
+ this._basePath = basePath;
90
+ }
91
+
92
+ set defaultHeaders(defaultHeaders: any) {
93
+ this._defaultHeaders = defaultHeaders;
94
+ }
95
+
96
+ get defaultHeaders() {
97
+ return this._defaultHeaders;
98
+ }
99
+
100
+ get basePath() {
101
+ return this._basePath;
102
+ }
103
+
104
+ public setDefaultAuthentication(auth: Authentication) {
105
+ this.authentications.default = auth;
106
+ }
107
+
108
+ public setApiKey(key: SMSApiApiKeys, value: string) {
109
+ (this.authentications as any)[SMSApiApiKeys[key]].apiKey = value;
110
+ }
111
+
112
+ public addInterceptor(interceptor: Interceptor) {
113
+ this.interceptors.push(interceptor);
114
+ }
115
+
116
+ /**
117
+ *
118
+ * @summary Acquire phone number
119
+ * @param inlineObject52
120
+ */
121
+ public async acquirePhoneNumber (inlineObject52: InlineObject52, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
122
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/acquire';
123
+ let localVarQueryParameters: any = {};
124
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
125
+ const produces = ['application/json'];
126
+ // give precedence to 'application/json'
127
+ if (produces.indexOf('application/json') >= 0) {
128
+ localVarHeaderParams.Accept = 'application/json';
129
+ } else {
130
+ localVarHeaderParams.Accept = produces.join(',');
131
+ }
132
+ let localVarFormParams: any = {};
133
+
134
+ // verify required parameter 'inlineObject52' is not null or undefined
135
+ if (inlineObject52 === null || inlineObject52 === undefined) {
136
+ throw new Error('Required parameter inlineObject52 was null or undefined when calling acquirePhoneNumber.');
137
+ }
138
+
139
+ (<any>Object).assign(localVarHeaderParams, options.headers);
140
+
141
+ let localVarUseFormData = false;
142
+
143
+ let localVarRequestOptions: localVarRequest.Options = {
144
+ method: 'POST',
145
+ qs: localVarQueryParameters,
146
+ headers: localVarHeaderParams,
147
+ uri: localVarPath,
148
+ useQuerystring: this._useQuerystring,
149
+ json: true,
150
+ body: ObjectSerializer.serialize(inlineObject52, "InlineObject52")
151
+ };
152
+
153
+ let authenticationPromise = Promise.resolve();
154
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
155
+
156
+ let interceptorPromise = authenticationPromise;
157
+ for (const interceptor of this.interceptors) {
158
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
159
+ }
160
+
161
+ return interceptorPromise.then(() => {
162
+ if (Object.keys(localVarFormParams).length) {
163
+ if (localVarUseFormData) {
164
+ (<any>localVarRequestOptions).formData = localVarFormParams;
165
+ } else {
166
+ localVarRequestOptions.form = localVarFormParams;
167
+ }
168
+ }
169
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
170
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
171
+ if (error) {
172
+ reject(error);
173
+ } else {
174
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
175
+ body = ObjectSerializer.deserialize(body, "any");
176
+ resolve({ response: response, body: body });
177
+ } else {
178
+ reject(new HttpError(response, body, response.statusCode));
179
+ }
180
+ }
181
+ });
182
+ });
183
+ });
184
+ }
185
+ /**
186
+ *
187
+ * @summary Archive phone number
188
+ * @param phoneNumberID
189
+ */
190
+ public async archivePhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PhoneNumber; }> {
191
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/{phoneNumberID}'
192
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
193
+ let localVarQueryParameters: any = {};
194
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
195
+ const produces = ['application/json'];
196
+ // give precedence to 'application/json'
197
+ if (produces.indexOf('application/json') >= 0) {
198
+ localVarHeaderParams.Accept = 'application/json';
199
+ } else {
200
+ localVarHeaderParams.Accept = produces.join(',');
201
+ }
202
+ let localVarFormParams: any = {};
203
+
204
+ // verify required parameter 'phoneNumberID' is not null or undefined
205
+ if (phoneNumberID === null || phoneNumberID === undefined) {
206
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling archivePhoneNumber.');
207
+ }
208
+
209
+ (<any>Object).assign(localVarHeaderParams, options.headers);
210
+
211
+ let localVarUseFormData = false;
212
+
213
+ let localVarRequestOptions: localVarRequest.Options = {
214
+ method: 'DELETE',
215
+ qs: localVarQueryParameters,
216
+ headers: localVarHeaderParams,
217
+ uri: localVarPath,
218
+ useQuerystring: this._useQuerystring,
219
+ json: true,
220
+ };
221
+
222
+ let authenticationPromise = Promise.resolve();
223
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
224
+
225
+ let interceptorPromise = authenticationPromise;
226
+ for (const interceptor of this.interceptors) {
227
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
228
+ }
229
+
230
+ return interceptorPromise.then(() => {
231
+ if (Object.keys(localVarFormParams).length) {
232
+ if (localVarUseFormData) {
233
+ (<any>localVarRequestOptions).formData = localVarFormParams;
234
+ } else {
235
+ localVarRequestOptions.form = localVarFormParams;
236
+ }
237
+ }
238
+ return new Promise<{ response: http.IncomingMessage; body: PhoneNumber; }>((resolve, reject) => {
239
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
240
+ if (error) {
241
+ reject(error);
242
+ } else {
243
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
244
+ body = ObjectSerializer.deserialize(body, "PhoneNumber");
245
+ resolve({ response: response, body: body });
246
+ } else {
247
+ reject(new HttpError(response, body, response.statusCode));
248
+ }
249
+ }
250
+ });
251
+ });
252
+ });
253
+ }
254
+ /**
255
+ *
256
+ * @summary Create imported list
257
+ * @param inlineObject60
258
+ */
259
+ public async createImportedList (inlineObject60: InlineObject60, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ImportedList; }> {
260
+ const localVarPath = this.basePath + '/v1/sms/importedList';
261
+ let localVarQueryParameters: any = {};
262
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
263
+ const produces = ['application/json'];
264
+ // give precedence to 'application/json'
265
+ if (produces.indexOf('application/json') >= 0) {
266
+ localVarHeaderParams.Accept = 'application/json';
267
+ } else {
268
+ localVarHeaderParams.Accept = produces.join(',');
269
+ }
270
+ let localVarFormParams: any = {};
271
+
272
+ // verify required parameter 'inlineObject60' is not null or undefined
273
+ if (inlineObject60 === null || inlineObject60 === undefined) {
274
+ throw new Error('Required parameter inlineObject60 was null or undefined when calling createImportedList.');
275
+ }
276
+
277
+ (<any>Object).assign(localVarHeaderParams, options.headers);
278
+
279
+ let localVarUseFormData = false;
280
+
281
+ let localVarRequestOptions: localVarRequest.Options = {
282
+ method: 'POST',
283
+ qs: localVarQueryParameters,
284
+ headers: localVarHeaderParams,
285
+ uri: localVarPath,
286
+ useQuerystring: this._useQuerystring,
287
+ json: true,
288
+ body: ObjectSerializer.serialize(inlineObject60, "InlineObject60")
289
+ };
290
+
291
+ let authenticationPromise = Promise.resolve();
292
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
293
+
294
+ let interceptorPromise = authenticationPromise;
295
+ for (const interceptor of this.interceptors) {
296
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
297
+ }
298
+
299
+ return interceptorPromise.then(() => {
300
+ if (Object.keys(localVarFormParams).length) {
301
+ if (localVarUseFormData) {
302
+ (<any>localVarRequestOptions).formData = localVarFormParams;
303
+ } else {
304
+ localVarRequestOptions.form = localVarFormParams;
305
+ }
306
+ }
307
+ return new Promise<{ response: http.IncomingMessage; body: ImportedList; }>((resolve, reject) => {
308
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
309
+ if (error) {
310
+ reject(error);
311
+ } else {
312
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
313
+ body = ObjectSerializer.deserialize(body, "ImportedList");
314
+ resolve({ response: response, body: body });
315
+ } else {
316
+ reject(new HttpError(response, body, response.statusCode));
317
+ }
318
+ }
319
+ });
320
+ });
321
+ });
322
+ }
323
+ /**
324
+ *
325
+ * @summary Create opt in list
326
+ * @param wTOptInListCreationParams
327
+ */
328
+ public async createOptInList (wTOptInListCreationParams: WTOptInListCreationParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: OptInList; }> {
329
+ const localVarPath = this.basePath + '/v1/sms/optInList';
330
+ let localVarQueryParameters: any = {};
331
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
332
+ const produces = ['application/json'];
333
+ // give precedence to 'application/json'
334
+ if (produces.indexOf('application/json') >= 0) {
335
+ localVarHeaderParams.Accept = 'application/json';
336
+ } else {
337
+ localVarHeaderParams.Accept = produces.join(',');
338
+ }
339
+ let localVarFormParams: any = {};
340
+
341
+ // verify required parameter 'wTOptInListCreationParams' is not null or undefined
342
+ if (wTOptInListCreationParams === null || wTOptInListCreationParams === undefined) {
343
+ throw new Error('Required parameter wTOptInListCreationParams was null or undefined when calling createOptInList.');
344
+ }
345
+
346
+ (<any>Object).assign(localVarHeaderParams, options.headers);
347
+
348
+ let localVarUseFormData = false;
349
+
350
+ let localVarRequestOptions: localVarRequest.Options = {
351
+ method: 'POST',
352
+ qs: localVarQueryParameters,
353
+ headers: localVarHeaderParams,
354
+ uri: localVarPath,
355
+ useQuerystring: this._useQuerystring,
356
+ json: true,
357
+ body: ObjectSerializer.serialize(wTOptInListCreationParams, "WTOptInListCreationParams")
358
+ };
359
+
360
+ let authenticationPromise = Promise.resolve();
361
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
362
+
363
+ let interceptorPromise = authenticationPromise;
364
+ for (const interceptor of this.interceptors) {
365
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
366
+ }
367
+
368
+ return interceptorPromise.then(() => {
369
+ if (Object.keys(localVarFormParams).length) {
370
+ if (localVarUseFormData) {
371
+ (<any>localVarRequestOptions).formData = localVarFormParams;
372
+ } else {
373
+ localVarRequestOptions.form = localVarFormParams;
374
+ }
375
+ }
376
+ return new Promise<{ response: http.IncomingMessage; body: OptInList; }>((resolve, reject) => {
377
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
378
+ if (error) {
379
+ reject(error);
380
+ } else {
381
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
382
+ body = ObjectSerializer.deserialize(body, "OptInList");
383
+ resolve({ response: response, body: body });
384
+ } else {
385
+ reject(new HttpError(response, body, response.statusCode));
386
+ }
387
+ }
388
+ });
389
+ });
390
+ });
391
+ }
392
+ /**
393
+ *
394
+ * @summary Create opt in list source
395
+ * @param inlineObject57
396
+ */
397
+ public async createOptInListSource (inlineObject57: InlineObject57, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: OptInListSource; }> {
398
+ const localVarPath = this.basePath + '/v1/sms/optInListSource';
399
+ let localVarQueryParameters: any = {};
400
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
401
+ const produces = ['application/json'];
402
+ // give precedence to 'application/json'
403
+ if (produces.indexOf('application/json') >= 0) {
404
+ localVarHeaderParams.Accept = 'application/json';
405
+ } else {
406
+ localVarHeaderParams.Accept = produces.join(',');
407
+ }
408
+ let localVarFormParams: any = {};
409
+
410
+ // verify required parameter 'inlineObject57' is not null or undefined
411
+ if (inlineObject57 === null || inlineObject57 === undefined) {
412
+ throw new Error('Required parameter inlineObject57 was null or undefined when calling createOptInListSource.');
413
+ }
414
+
415
+ (<any>Object).assign(localVarHeaderParams, options.headers);
416
+
417
+ let localVarUseFormData = false;
418
+
419
+ let localVarRequestOptions: localVarRequest.Options = {
420
+ method: 'POST',
421
+ qs: localVarQueryParameters,
422
+ headers: localVarHeaderParams,
423
+ uri: localVarPath,
424
+ useQuerystring: this._useQuerystring,
425
+ json: true,
426
+ body: ObjectSerializer.serialize(inlineObject57, "InlineObject57")
427
+ };
428
+
429
+ let authenticationPromise = Promise.resolve();
430
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
431
+
432
+ let interceptorPromise = authenticationPromise;
433
+ for (const interceptor of this.interceptors) {
434
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
435
+ }
436
+
437
+ return interceptorPromise.then(() => {
438
+ if (Object.keys(localVarFormParams).length) {
439
+ if (localVarUseFormData) {
440
+ (<any>localVarRequestOptions).formData = localVarFormParams;
441
+ } else {
442
+ localVarRequestOptions.form = localVarFormParams;
443
+ }
444
+ }
445
+ return new Promise<{ response: http.IncomingMessage; body: OptInListSource; }>((resolve, reject) => {
446
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
447
+ if (error) {
448
+ reject(error);
449
+ } else {
450
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
451
+ body = ObjectSerializer.deserialize(body, "OptInListSource");
452
+ resolve({ response: response, body: body });
453
+ } else {
454
+ reject(new HttpError(response, body, response.statusCode));
455
+ }
456
+ }
457
+ });
458
+ });
459
+ });
460
+ }
461
+ /**
462
+ *
463
+ * @summary Accept SMS agreement
464
+ * @param inlineObject51
465
+ */
466
+ public async createSMSAgreement (inlineObject51: InlineObject51, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Agreement; }> {
467
+ const localVarPath = this.basePath + '/v1/sms/agreement/create';
468
+ let localVarQueryParameters: any = {};
469
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
470
+ const produces = ['application/json'];
471
+ // give precedence to 'application/json'
472
+ if (produces.indexOf('application/json') >= 0) {
473
+ localVarHeaderParams.Accept = 'application/json';
474
+ } else {
475
+ localVarHeaderParams.Accept = produces.join(',');
476
+ }
477
+ let localVarFormParams: any = {};
478
+
479
+ // verify required parameter 'inlineObject51' is not null or undefined
480
+ if (inlineObject51 === null || inlineObject51 === undefined) {
481
+ throw new Error('Required parameter inlineObject51 was null or undefined when calling createSMSAgreement.');
482
+ }
483
+
484
+ (<any>Object).assign(localVarHeaderParams, options.headers);
485
+
486
+ let localVarUseFormData = false;
487
+
488
+ let localVarRequestOptions: localVarRequest.Options = {
489
+ method: 'POST',
490
+ qs: localVarQueryParameters,
491
+ headers: localVarHeaderParams,
492
+ uri: localVarPath,
493
+ useQuerystring: this._useQuerystring,
494
+ json: true,
495
+ body: ObjectSerializer.serialize(inlineObject51, "InlineObject51")
496
+ };
497
+
498
+ let authenticationPromise = Promise.resolve();
499
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
500
+
501
+ let interceptorPromise = authenticationPromise;
502
+ for (const interceptor of this.interceptors) {
503
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
504
+ }
505
+
506
+ return interceptorPromise.then(() => {
507
+ if (Object.keys(localVarFormParams).length) {
508
+ if (localVarUseFormData) {
509
+ (<any>localVarRequestOptions).formData = localVarFormParams;
510
+ } else {
511
+ localVarRequestOptions.form = localVarFormParams;
512
+ }
513
+ }
514
+ return new Promise<{ response: http.IncomingMessage; body: Agreement; }>((resolve, reject) => {
515
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
516
+ if (error) {
517
+ reject(error);
518
+ } else {
519
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
520
+ body = ObjectSerializer.deserialize(body, "Agreement");
521
+ resolve({ response: response, body: body });
522
+ } else {
523
+ reject(new HttpError(response, body, response.statusCode));
524
+ }
525
+ }
526
+ });
527
+ });
528
+ });
529
+ }
530
+ /**
531
+ *
532
+ * @summary Export imported list recipients
533
+ * @param importedListID
534
+ */
535
+ public async exportImportedListRecipients (importedListID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
536
+ const localVarPath = this.basePath + '/v1/sms/importedList/recipients/export/{importedListID}'
537
+ .replace('{' + 'importedListID' + '}', encodeURIComponent(String(importedListID)));
538
+ let localVarQueryParameters: any = {};
539
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
540
+ const produces = ['application/json'];
541
+ // give precedence to 'application/json'
542
+ if (produces.indexOf('application/json') >= 0) {
543
+ localVarHeaderParams.Accept = 'application/json';
544
+ } else {
545
+ localVarHeaderParams.Accept = produces.join(',');
546
+ }
547
+ let localVarFormParams: any = {};
548
+
549
+ // verify required parameter 'importedListID' is not null or undefined
550
+ if (importedListID === null || importedListID === undefined) {
551
+ throw new Error('Required parameter importedListID was null or undefined when calling exportImportedListRecipients.');
552
+ }
553
+
554
+ (<any>Object).assign(localVarHeaderParams, options.headers);
555
+
556
+ let localVarUseFormData = false;
557
+
558
+ let localVarRequestOptions: localVarRequest.Options = {
559
+ method: 'POST',
560
+ qs: localVarQueryParameters,
561
+ headers: localVarHeaderParams,
562
+ uri: localVarPath,
563
+ useQuerystring: this._useQuerystring,
564
+ json: true,
565
+ };
566
+
567
+ let authenticationPromise = Promise.resolve();
568
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
569
+
570
+ let interceptorPromise = authenticationPromise;
571
+ for (const interceptor of this.interceptors) {
572
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
573
+ }
574
+
575
+ return interceptorPromise.then(() => {
576
+ if (Object.keys(localVarFormParams).length) {
577
+ if (localVarUseFormData) {
578
+ (<any>localVarRequestOptions).formData = localVarFormParams;
579
+ } else {
580
+ localVarRequestOptions.form = localVarFormParams;
581
+ }
582
+ }
583
+ return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
584
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
585
+ if (error) {
586
+ reject(error);
587
+ } else {
588
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
589
+ body = ObjectSerializer.deserialize(body, "string");
590
+ resolve({ response: response, body: body });
591
+ } else {
592
+ reject(new HttpError(response, body, response.statusCode));
593
+ }
594
+ }
595
+ });
596
+ });
597
+ });
598
+ }
599
+ /**
600
+ *
601
+ * @summary Export opt in list subscribers
602
+ * @param listID
603
+ */
604
+ public async exportOptInListSubscribers (listID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
605
+ const localVarPath = this.basePath + '/v1/sms/optInList/subscribers/export/{listID}'
606
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
607
+ let localVarQueryParameters: any = {};
608
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
609
+ const produces = ['application/json'];
610
+ // give precedence to 'application/json'
611
+ if (produces.indexOf('application/json') >= 0) {
612
+ localVarHeaderParams.Accept = 'application/json';
613
+ } else {
614
+ localVarHeaderParams.Accept = produces.join(',');
615
+ }
616
+ let localVarFormParams: any = {};
617
+
618
+ // verify required parameter 'listID' is not null or undefined
619
+ if (listID === null || listID === undefined) {
620
+ throw new Error('Required parameter listID was null or undefined when calling exportOptInListSubscribers.');
621
+ }
622
+
623
+ (<any>Object).assign(localVarHeaderParams, options.headers);
624
+
625
+ let localVarUseFormData = false;
626
+
627
+ let localVarRequestOptions: localVarRequest.Options = {
628
+ method: 'POST',
629
+ qs: localVarQueryParameters,
630
+ headers: localVarHeaderParams,
631
+ uri: localVarPath,
632
+ useQuerystring: this._useQuerystring,
633
+ json: true,
634
+ };
635
+
636
+ let authenticationPromise = Promise.resolve();
637
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
638
+
639
+ let interceptorPromise = authenticationPromise;
640
+ for (const interceptor of this.interceptors) {
641
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
642
+ }
643
+
644
+ return interceptorPromise.then(() => {
645
+ if (Object.keys(localVarFormParams).length) {
646
+ if (localVarUseFormData) {
647
+ (<any>localVarRequestOptions).formData = localVarFormParams;
648
+ } else {
649
+ localVarRequestOptions.form = localVarFormParams;
650
+ }
651
+ }
652
+ return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
653
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
654
+ if (error) {
655
+ reject(error);
656
+ } else {
657
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
658
+ body = ObjectSerializer.deserialize(body, "string");
659
+ resolve({ response: response, body: body });
660
+ } else {
661
+ reject(new HttpError(response, body, response.statusCode));
662
+ }
663
+ }
664
+ });
665
+ });
666
+ });
667
+ }
668
+ /**
669
+ *
670
+ * @summary Fetch blocked TCPA entries
671
+ * @param phoneNumberID
672
+ */
673
+ public async fetchBlockedTCPAEntries (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }> {
674
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/blocked/{phoneNumberID}'
675
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
676
+ let localVarQueryParameters: any = {};
677
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
678
+ const produces = ['application/json'];
679
+ // give precedence to 'application/json'
680
+ if (produces.indexOf('application/json') >= 0) {
681
+ localVarHeaderParams.Accept = 'application/json';
682
+ } else {
683
+ localVarHeaderParams.Accept = produces.join(',');
684
+ }
685
+ let localVarFormParams: any = {};
686
+
687
+ // verify required parameter 'phoneNumberID' is not null or undefined
688
+ if (phoneNumberID === null || phoneNumberID === undefined) {
689
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchBlockedTCPAEntries.');
690
+ }
691
+
692
+ (<any>Object).assign(localVarHeaderParams, options.headers);
693
+
694
+ let localVarUseFormData = false;
695
+
696
+ let localVarRequestOptions: localVarRequest.Options = {
697
+ method: 'GET',
698
+ qs: localVarQueryParameters,
699
+ headers: localVarHeaderParams,
700
+ uri: localVarPath,
701
+ useQuerystring: this._useQuerystring,
702
+ json: true,
703
+ };
704
+
705
+ let authenticationPromise = Promise.resolve();
706
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
707
+
708
+ let interceptorPromise = authenticationPromise;
709
+ for (const interceptor of this.interceptors) {
710
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
711
+ }
712
+
713
+ return interceptorPromise.then(() => {
714
+ if (Object.keys(localVarFormParams).length) {
715
+ if (localVarUseFormData) {
716
+ (<any>localVarRequestOptions).formData = localVarFormParams;
717
+ } else {
718
+ localVarRequestOptions.form = localVarFormParams;
719
+ }
720
+ }
721
+ return new Promise<{ response: http.IncomingMessage; body: Array<Tcpa>; }>((resolve, reject) => {
722
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
723
+ if (error) {
724
+ reject(error);
725
+ } else {
726
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
727
+ body = ObjectSerializer.deserialize(body, "Array<Tcpa>");
728
+ resolve({ response: response, body: body });
729
+ } else {
730
+ reject(new HttpError(response, body, response.statusCode));
731
+ }
732
+ }
733
+ });
734
+ });
735
+ });
736
+ }
737
+ /**
738
+ *
739
+ * @summary Fetch imported list recipients
740
+ * @param listID
741
+ */
742
+ public async fetchImportedListRecipients (listID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<ImportedListRecipient>; }> {
743
+ const localVarPath = this.basePath + '/v1/sms/importedList/recipients/{listID}'
744
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
745
+ let localVarQueryParameters: any = {};
746
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
747
+ const produces = ['application/json'];
748
+ // give precedence to 'application/json'
749
+ if (produces.indexOf('application/json') >= 0) {
750
+ localVarHeaderParams.Accept = 'application/json';
751
+ } else {
752
+ localVarHeaderParams.Accept = produces.join(',');
753
+ }
754
+ let localVarFormParams: any = {};
755
+
756
+ // verify required parameter 'listID' is not null or undefined
757
+ if (listID === null || listID === undefined) {
758
+ throw new Error('Required parameter listID was null or undefined when calling fetchImportedListRecipients.');
759
+ }
760
+
761
+ (<any>Object).assign(localVarHeaderParams, options.headers);
762
+
763
+ let localVarUseFormData = false;
764
+
765
+ let localVarRequestOptions: localVarRequest.Options = {
766
+ method: 'GET',
767
+ qs: localVarQueryParameters,
768
+ headers: localVarHeaderParams,
769
+ uri: localVarPath,
770
+ useQuerystring: this._useQuerystring,
771
+ json: true,
772
+ };
773
+
774
+ let authenticationPromise = Promise.resolve();
775
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
776
+
777
+ let interceptorPromise = authenticationPromise;
778
+ for (const interceptor of this.interceptors) {
779
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
780
+ }
781
+
782
+ return interceptorPromise.then(() => {
783
+ if (Object.keys(localVarFormParams).length) {
784
+ if (localVarUseFormData) {
785
+ (<any>localVarRequestOptions).formData = localVarFormParams;
786
+ } else {
787
+ localVarRequestOptions.form = localVarFormParams;
788
+ }
789
+ }
790
+ return new Promise<{ response: http.IncomingMessage; body: Array<ImportedListRecipient>; }>((resolve, reject) => {
791
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
792
+ if (error) {
793
+ reject(error);
794
+ } else {
795
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
796
+ body = ObjectSerializer.deserialize(body, "Array<ImportedListRecipient>");
797
+ resolve({ response: response, body: body });
798
+ } else {
799
+ reject(new HttpError(response, body, response.statusCode));
800
+ }
801
+ }
802
+ });
803
+ });
804
+ });
805
+ }
806
+ /**
807
+ *
808
+ * @summary Fetch opt in list subscribers
809
+ * @param listID
810
+ * @param isSubscribed
811
+ * @param isPendingAge21Verification
812
+ * @param isArchiveIncluded
813
+ */
814
+ public async fetchOptInListSubscribers (listID: string, isSubscribed?: boolean, isPendingAge21Verification?: boolean, isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }> {
815
+ const localVarPath = this.basePath + '/v1/sms/optInList/subscribers/{listID}'
816
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
817
+ let localVarQueryParameters: any = {};
818
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
819
+ const produces = ['application/json'];
820
+ // give precedence to 'application/json'
821
+ if (produces.indexOf('application/json') >= 0) {
822
+ localVarHeaderParams.Accept = 'application/json';
823
+ } else {
824
+ localVarHeaderParams.Accept = produces.join(',');
825
+ }
826
+ let localVarFormParams: any = {};
827
+
828
+ // verify required parameter 'listID' is not null or undefined
829
+ if (listID === null || listID === undefined) {
830
+ throw new Error('Required parameter listID was null or undefined when calling fetchOptInListSubscribers.');
831
+ }
832
+
833
+ if (isSubscribed !== undefined) {
834
+ localVarQueryParameters['isSubscribed'] = ObjectSerializer.serialize(isSubscribed, "boolean");
835
+ }
836
+
837
+ if (isPendingAge21Verification !== undefined) {
838
+ localVarQueryParameters['isPendingAge21Verification'] = ObjectSerializer.serialize(isPendingAge21Verification, "boolean");
839
+ }
840
+
841
+ if (isArchiveIncluded !== undefined) {
842
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
843
+ }
844
+
845
+ (<any>Object).assign(localVarHeaderParams, options.headers);
846
+
847
+ let localVarUseFormData = false;
848
+
849
+ let localVarRequestOptions: localVarRequest.Options = {
850
+ method: 'GET',
851
+ qs: localVarQueryParameters,
852
+ headers: localVarHeaderParams,
853
+ uri: localVarPath,
854
+ useQuerystring: this._useQuerystring,
855
+ json: true,
856
+ };
857
+
858
+ let authenticationPromise = Promise.resolve();
859
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
860
+
861
+ let interceptorPromise = authenticationPromise;
862
+ for (const interceptor of this.interceptors) {
863
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
864
+ }
865
+
866
+ return interceptorPromise.then(() => {
867
+ if (Object.keys(localVarFormParams).length) {
868
+ if (localVarUseFormData) {
869
+ (<any>localVarRequestOptions).formData = localVarFormParams;
870
+ } else {
871
+ localVarRequestOptions.form = localVarFormParams;
872
+ }
873
+ }
874
+ return new Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }>((resolve, reject) => {
875
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
876
+ if (error) {
877
+ reject(error);
878
+ } else {
879
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
880
+ body = ObjectSerializer.deserialize(body, "Array<OptInListSubscriber>");
881
+ resolve({ response: response, body: body });
882
+ } else {
883
+ reject(new HttpError(response, body, response.statusCode));
884
+ }
885
+ }
886
+ });
887
+ });
888
+ });
889
+ }
890
+ /**
891
+ *
892
+ * @summary Fetch opt in lists
893
+ * @param phoneNumberID
894
+ */
895
+ public async fetchOptInListsAssociatedWithPhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
896
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/lists/{phoneNumberID}'
897
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
898
+ let localVarQueryParameters: any = {};
899
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
900
+ const produces = ['application/json'];
901
+ // give precedence to 'application/json'
902
+ if (produces.indexOf('application/json') >= 0) {
903
+ localVarHeaderParams.Accept = 'application/json';
904
+ } else {
905
+ localVarHeaderParams.Accept = produces.join(',');
906
+ }
907
+ let localVarFormParams: any = {};
908
+
909
+ // verify required parameter 'phoneNumberID' is not null or undefined
910
+ if (phoneNumberID === null || phoneNumberID === undefined) {
911
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchOptInListsAssociatedWithPhoneNumber.');
912
+ }
913
+
914
+ (<any>Object).assign(localVarHeaderParams, options.headers);
915
+
916
+ let localVarUseFormData = false;
917
+
918
+ let localVarRequestOptions: localVarRequest.Options = {
919
+ method: 'GET',
920
+ qs: localVarQueryParameters,
921
+ headers: localVarHeaderParams,
922
+ uri: localVarPath,
923
+ useQuerystring: this._useQuerystring,
924
+ json: true,
925
+ };
926
+
927
+ let authenticationPromise = Promise.resolve();
928
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
929
+
930
+ let interceptorPromise = authenticationPromise;
931
+ for (const interceptor of this.interceptors) {
932
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
933
+ }
934
+
935
+ return interceptorPromise.then(() => {
936
+ if (Object.keys(localVarFormParams).length) {
937
+ if (localVarUseFormData) {
938
+ (<any>localVarRequestOptions).formData = localVarFormParams;
939
+ } else {
940
+ localVarRequestOptions.form = localVarFormParams;
941
+ }
942
+ }
943
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
944
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
945
+ if (error) {
946
+ reject(error);
947
+ } else {
948
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
949
+ body = ObjectSerializer.deserialize(body, "any");
950
+ resolve({ response: response, body: body });
951
+ } else {
952
+ reject(new HttpError(response, body, response.statusCode));
953
+ }
954
+ }
955
+ });
956
+ });
957
+ });
958
+ }
959
+ /**
960
+ *
961
+ * @summary Fetch opt in source subscribers
962
+ * @param sourceID
963
+ * @param isSubscribed
964
+ * @param isPendingAge21Verification
965
+ * @param isArchiveIncluded
966
+ */
967
+ public async fetchOptInSourceSubscribers (sourceID: string, isSubscribed?: boolean, isPendingAge21Verification?: boolean, isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }> {
968
+ const localVarPath = this.basePath + '/v1/sms/optInSource/subscribers/{sourceID}'
969
+ .replace('{' + 'sourceID' + '}', encodeURIComponent(String(sourceID)));
970
+ let localVarQueryParameters: any = {};
971
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
972
+ const produces = ['application/json'];
973
+ // give precedence to 'application/json'
974
+ if (produces.indexOf('application/json') >= 0) {
975
+ localVarHeaderParams.Accept = 'application/json';
976
+ } else {
977
+ localVarHeaderParams.Accept = produces.join(',');
978
+ }
979
+ let localVarFormParams: any = {};
980
+
981
+ // verify required parameter 'sourceID' is not null or undefined
982
+ if (sourceID === null || sourceID === undefined) {
983
+ throw new Error('Required parameter sourceID was null or undefined when calling fetchOptInSourceSubscribers.');
984
+ }
985
+
986
+ if (isSubscribed !== undefined) {
987
+ localVarQueryParameters['isSubscribed'] = ObjectSerializer.serialize(isSubscribed, "boolean");
988
+ }
989
+
990
+ if (isPendingAge21Verification !== undefined) {
991
+ localVarQueryParameters['isPendingAge21Verification'] = ObjectSerializer.serialize(isPendingAge21Verification, "boolean");
992
+ }
993
+
994
+ if (isArchiveIncluded !== undefined) {
995
+ localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
996
+ }
997
+
998
+ (<any>Object).assign(localVarHeaderParams, options.headers);
999
+
1000
+ let localVarUseFormData = false;
1001
+
1002
+ let localVarRequestOptions: localVarRequest.Options = {
1003
+ method: 'GET',
1004
+ qs: localVarQueryParameters,
1005
+ headers: localVarHeaderParams,
1006
+ uri: localVarPath,
1007
+ useQuerystring: this._useQuerystring,
1008
+ json: true,
1009
+ };
1010
+
1011
+ let authenticationPromise = Promise.resolve();
1012
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1013
+
1014
+ let interceptorPromise = authenticationPromise;
1015
+ for (const interceptor of this.interceptors) {
1016
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1017
+ }
1018
+
1019
+ return interceptorPromise.then(() => {
1020
+ if (Object.keys(localVarFormParams).length) {
1021
+ if (localVarUseFormData) {
1022
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1023
+ } else {
1024
+ localVarRequestOptions.form = localVarFormParams;
1025
+ }
1026
+ }
1027
+ return new Promise<{ response: http.IncomingMessage; body: Array<OptInListSubscriber>; }>((resolve, reject) => {
1028
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1029
+ if (error) {
1030
+ reject(error);
1031
+ } else {
1032
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1033
+ body = ObjectSerializer.deserialize(body, "Array<OptInListSubscriber>");
1034
+ resolve({ response: response, body: body });
1035
+ } else {
1036
+ reject(new HttpError(response, body, response.statusCode));
1037
+ }
1038
+ }
1039
+ });
1040
+ });
1041
+ });
1042
+ }
1043
+ /**
1044
+ *
1045
+ * @summary Fetch opt in sources
1046
+ * @param phoneNumberID
1047
+ */
1048
+ public async fetchOptInSourcesAssociatedWithPhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1049
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/sources/{phoneNumberID}'
1050
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1051
+ let localVarQueryParameters: any = {};
1052
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1053
+ const produces = ['application/json'];
1054
+ // give precedence to 'application/json'
1055
+ if (produces.indexOf('application/json') >= 0) {
1056
+ localVarHeaderParams.Accept = 'application/json';
1057
+ } else {
1058
+ localVarHeaderParams.Accept = produces.join(',');
1059
+ }
1060
+ let localVarFormParams: any = {};
1061
+
1062
+ // verify required parameter 'phoneNumberID' is not null or undefined
1063
+ if (phoneNumberID === null || phoneNumberID === undefined) {
1064
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchOptInSourcesAssociatedWithPhoneNumber.');
1065
+ }
1066
+
1067
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1068
+
1069
+ let localVarUseFormData = false;
1070
+
1071
+ let localVarRequestOptions: localVarRequest.Options = {
1072
+ method: 'GET',
1073
+ qs: localVarQueryParameters,
1074
+ headers: localVarHeaderParams,
1075
+ uri: localVarPath,
1076
+ useQuerystring: this._useQuerystring,
1077
+ json: true,
1078
+ };
1079
+
1080
+ let authenticationPromise = Promise.resolve();
1081
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1082
+
1083
+ let interceptorPromise = authenticationPromise;
1084
+ for (const interceptor of this.interceptors) {
1085
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1086
+ }
1087
+
1088
+ return interceptorPromise.then(() => {
1089
+ if (Object.keys(localVarFormParams).length) {
1090
+ if (localVarUseFormData) {
1091
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1092
+ } else {
1093
+ localVarRequestOptions.form = localVarFormParams;
1094
+ }
1095
+ }
1096
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1097
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1098
+ if (error) {
1099
+ reject(error);
1100
+ } else {
1101
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1102
+ body = ObjectSerializer.deserialize(body, "any");
1103
+ resolve({ response: response, body: body });
1104
+ } else {
1105
+ reject(new HttpError(response, body, response.statusCode));
1106
+ }
1107
+ }
1108
+ });
1109
+ });
1110
+ });
1111
+ }
1112
+ /**
1113
+ *
1114
+ * @summary Fetch outbound SMS
1115
+ * @param phoneNumberID
1116
+ * @param toPhoneNumber
1117
+ * @param paymentObjectBroadcastID
1118
+ */
1119
+ public async fetchOutboundSMS (phoneNumberID: string, toPhoneNumber?: string, paymentObjectBroadcastID?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1120
+ const localVarPath = this.basePath + '/v1/sms/outbound/{phoneNumberID}'
1121
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1122
+ let localVarQueryParameters: any = {};
1123
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1124
+ const produces = ['application/json'];
1125
+ // give precedence to 'application/json'
1126
+ if (produces.indexOf('application/json') >= 0) {
1127
+ localVarHeaderParams.Accept = 'application/json';
1128
+ } else {
1129
+ localVarHeaderParams.Accept = produces.join(',');
1130
+ }
1131
+ let localVarFormParams: any = {};
1132
+
1133
+ // verify required parameter 'phoneNumberID' is not null or undefined
1134
+ if (phoneNumberID === null || phoneNumberID === undefined) {
1135
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchOutboundSMS.');
1136
+ }
1137
+
1138
+ if (toPhoneNumber !== undefined) {
1139
+ localVarQueryParameters['toPhoneNumber'] = ObjectSerializer.serialize(toPhoneNumber, "string");
1140
+ }
1141
+
1142
+ if (paymentObjectBroadcastID !== undefined) {
1143
+ localVarQueryParameters['paymentObjectBroadcastID'] = ObjectSerializer.serialize(paymentObjectBroadcastID, "string");
1144
+ }
1145
+
1146
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1147
+
1148
+ let localVarUseFormData = false;
1149
+
1150
+ let localVarRequestOptions: localVarRequest.Options = {
1151
+ method: 'GET',
1152
+ qs: localVarQueryParameters,
1153
+ headers: localVarHeaderParams,
1154
+ uri: localVarPath,
1155
+ useQuerystring: this._useQuerystring,
1156
+ json: true,
1157
+ };
1158
+
1159
+ let authenticationPromise = Promise.resolve();
1160
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1161
+
1162
+ let interceptorPromise = authenticationPromise;
1163
+ for (const interceptor of this.interceptors) {
1164
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1165
+ }
1166
+
1167
+ return interceptorPromise.then(() => {
1168
+ if (Object.keys(localVarFormParams).length) {
1169
+ if (localVarUseFormData) {
1170
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1171
+ } else {
1172
+ localVarRequestOptions.form = localVarFormParams;
1173
+ }
1174
+ }
1175
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1176
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1177
+ if (error) {
1178
+ reject(error);
1179
+ } else {
1180
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1181
+ body = ObjectSerializer.deserialize(body, "any");
1182
+ resolve({ response: response, body: body });
1183
+ } else {
1184
+ reject(new HttpError(response, body, response.statusCode));
1185
+ }
1186
+ }
1187
+ });
1188
+ });
1189
+ });
1190
+ }
1191
+ /**
1192
+ *
1193
+ * @summary Fetch payment object broadcasts
1194
+ * @param phoneNumberID
1195
+ */
1196
+ public async fetchPaymentObjectBroadcasts (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1197
+ const localVarPath = this.basePath + '/v1/sms/paymentObjectBroadcasts/{phoneNumberID}'
1198
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1199
+ let localVarQueryParameters: any = {};
1200
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1201
+ const produces = ['application/json'];
1202
+ // give precedence to 'application/json'
1203
+ if (produces.indexOf('application/json') >= 0) {
1204
+ localVarHeaderParams.Accept = 'application/json';
1205
+ } else {
1206
+ localVarHeaderParams.Accept = produces.join(',');
1207
+ }
1208
+ let localVarFormParams: any = {};
1209
+
1210
+ // verify required parameter 'phoneNumberID' is not null or undefined
1211
+ if (phoneNumberID === null || phoneNumberID === undefined) {
1212
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling fetchPaymentObjectBroadcasts.');
1213
+ }
1214
+
1215
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1216
+
1217
+ let localVarUseFormData = false;
1218
+
1219
+ let localVarRequestOptions: localVarRequest.Options = {
1220
+ method: 'GET',
1221
+ qs: localVarQueryParameters,
1222
+ headers: localVarHeaderParams,
1223
+ uri: localVarPath,
1224
+ useQuerystring: this._useQuerystring,
1225
+ json: true,
1226
+ };
1227
+
1228
+ let authenticationPromise = Promise.resolve();
1229
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1230
+
1231
+ let interceptorPromise = authenticationPromise;
1232
+ for (const interceptor of this.interceptors) {
1233
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1234
+ }
1235
+
1236
+ return interceptorPromise.then(() => {
1237
+ if (Object.keys(localVarFormParams).length) {
1238
+ if (localVarUseFormData) {
1239
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1240
+ } else {
1241
+ localVarRequestOptions.form = localVarFormParams;
1242
+ }
1243
+ }
1244
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1245
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1246
+ if (error) {
1247
+ reject(error);
1248
+ } else {
1249
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1250
+ body = ObjectSerializer.deserialize(body, "any");
1251
+ resolve({ response: response, body: body });
1252
+ } else {
1253
+ reject(new HttpError(response, body, response.statusCode));
1254
+ }
1255
+ }
1256
+ });
1257
+ });
1258
+ });
1259
+ }
1260
+ /**
1261
+ *
1262
+ * @summary Fetch SMS agreement
1263
+ */
1264
+ public async fetchSMSAgreement (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1265
+ const localVarPath = this.basePath + '/v1/sms/agreement';
1266
+ let localVarQueryParameters: any = {};
1267
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1268
+ const produces = ['application/json'];
1269
+ // give precedence to 'application/json'
1270
+ if (produces.indexOf('application/json') >= 0) {
1271
+ localVarHeaderParams.Accept = 'application/json';
1272
+ } else {
1273
+ localVarHeaderParams.Accept = produces.join(',');
1274
+ }
1275
+ let localVarFormParams: any = {};
1276
+
1277
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1278
+
1279
+ let localVarUseFormData = false;
1280
+
1281
+ let localVarRequestOptions: localVarRequest.Options = {
1282
+ method: 'GET',
1283
+ qs: localVarQueryParameters,
1284
+ headers: localVarHeaderParams,
1285
+ uri: localVarPath,
1286
+ useQuerystring: this._useQuerystring,
1287
+ json: true,
1288
+ };
1289
+
1290
+ let authenticationPromise = Promise.resolve();
1291
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1292
+
1293
+ let interceptorPromise = authenticationPromise;
1294
+ for (const interceptor of this.interceptors) {
1295
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1296
+ }
1297
+
1298
+ return interceptorPromise.then(() => {
1299
+ if (Object.keys(localVarFormParams).length) {
1300
+ if (localVarUseFormData) {
1301
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1302
+ } else {
1303
+ localVarRequestOptions.form = localVarFormParams;
1304
+ }
1305
+ }
1306
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1307
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1308
+ if (error) {
1309
+ reject(error);
1310
+ } else {
1311
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1312
+ body = ObjectSerializer.deserialize(body, "any");
1313
+ resolve({ response: response, body: body });
1314
+ } else {
1315
+ reject(new HttpError(response, body, response.statusCode));
1316
+ }
1317
+ }
1318
+ });
1319
+ });
1320
+ });
1321
+ }
1322
+ /**
1323
+ *
1324
+ * @summary Import imported list recipients
1325
+ * @param importedListID
1326
+ * @param inlineObject62
1327
+ */
1328
+ public async importImportedListRecipients (importedListID: string, inlineObject62: InlineObject62, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
1329
+ const localVarPath = this.basePath + '/v1/sms/importedList/recipients/import/{importedListID}'
1330
+ .replace('{' + 'importedListID' + '}', encodeURIComponent(String(importedListID)));
1331
+ let localVarQueryParameters: any = {};
1332
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1333
+ const produces = ['application/json'];
1334
+ // give precedence to 'application/json'
1335
+ if (produces.indexOf('application/json') >= 0) {
1336
+ localVarHeaderParams.Accept = 'application/json';
1337
+ } else {
1338
+ localVarHeaderParams.Accept = produces.join(',');
1339
+ }
1340
+ let localVarFormParams: any = {};
1341
+
1342
+ // verify required parameter 'importedListID' is not null or undefined
1343
+ if (importedListID === null || importedListID === undefined) {
1344
+ throw new Error('Required parameter importedListID was null or undefined when calling importImportedListRecipients.');
1345
+ }
1346
+
1347
+ // verify required parameter 'inlineObject62' is not null or undefined
1348
+ if (inlineObject62 === null || inlineObject62 === undefined) {
1349
+ throw new Error('Required parameter inlineObject62 was null or undefined when calling importImportedListRecipients.');
1350
+ }
1351
+
1352
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1353
+
1354
+ let localVarUseFormData = false;
1355
+
1356
+ let localVarRequestOptions: localVarRequest.Options = {
1357
+ method: 'POST',
1358
+ qs: localVarQueryParameters,
1359
+ headers: localVarHeaderParams,
1360
+ uri: localVarPath,
1361
+ useQuerystring: this._useQuerystring,
1362
+ json: true,
1363
+ body: ObjectSerializer.serialize(inlineObject62, "InlineObject62")
1364
+ };
1365
+
1366
+ let authenticationPromise = Promise.resolve();
1367
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1368
+
1369
+ let interceptorPromise = authenticationPromise;
1370
+ for (const interceptor of this.interceptors) {
1371
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1372
+ }
1373
+
1374
+ return interceptorPromise.then(() => {
1375
+ if (Object.keys(localVarFormParams).length) {
1376
+ if (localVarUseFormData) {
1377
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1378
+ } else {
1379
+ localVarRequestOptions.form = localVarFormParams;
1380
+ }
1381
+ }
1382
+ return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
1383
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1384
+ if (error) {
1385
+ reject(error);
1386
+ } else {
1387
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1388
+ body = ObjectSerializer.deserialize(body, "string");
1389
+ resolve({ response: response, body: body });
1390
+ } else {
1391
+ reject(new HttpError(response, body, response.statusCode));
1392
+ }
1393
+ }
1394
+ });
1395
+ });
1396
+ });
1397
+ }
1398
+ /**
1399
+ *
1400
+ * @summary Import opt in list subscribers
1401
+ * @param listID
1402
+ * @param inlineObject59
1403
+ */
1404
+ public async importOptInListSubscribers (listID: string, inlineObject59: InlineObject59, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
1405
+ const localVarPath = this.basePath + '/v1/sms/optInList/subscribers/import/{listID}'
1406
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1407
+ let localVarQueryParameters: any = {};
1408
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1409
+ const produces = ['application/json'];
1410
+ // give precedence to 'application/json'
1411
+ if (produces.indexOf('application/json') >= 0) {
1412
+ localVarHeaderParams.Accept = 'application/json';
1413
+ } else {
1414
+ localVarHeaderParams.Accept = produces.join(',');
1415
+ }
1416
+ let localVarFormParams: any = {};
1417
+
1418
+ // verify required parameter 'listID' is not null or undefined
1419
+ if (listID === null || listID === undefined) {
1420
+ throw new Error('Required parameter listID was null or undefined when calling importOptInListSubscribers.');
1421
+ }
1422
+
1423
+ // verify required parameter 'inlineObject59' is not null or undefined
1424
+ if (inlineObject59 === null || inlineObject59 === undefined) {
1425
+ throw new Error('Required parameter inlineObject59 was null or undefined when calling importOptInListSubscribers.');
1426
+ }
1427
+
1428
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1429
+
1430
+ let localVarUseFormData = false;
1431
+
1432
+ let localVarRequestOptions: localVarRequest.Options = {
1433
+ method: 'POST',
1434
+ qs: localVarQueryParameters,
1435
+ headers: localVarHeaderParams,
1436
+ uri: localVarPath,
1437
+ useQuerystring: this._useQuerystring,
1438
+ json: true,
1439
+ body: ObjectSerializer.serialize(inlineObject59, "InlineObject59")
1440
+ };
1441
+
1442
+ let authenticationPromise = Promise.resolve();
1443
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1444
+
1445
+ let interceptorPromise = authenticationPromise;
1446
+ for (const interceptor of this.interceptors) {
1447
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1448
+ }
1449
+
1450
+ return interceptorPromise.then(() => {
1451
+ if (Object.keys(localVarFormParams).length) {
1452
+ if (localVarUseFormData) {
1453
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1454
+ } else {
1455
+ localVarRequestOptions.form = localVarFormParams;
1456
+ }
1457
+ }
1458
+ return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
1459
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1460
+ if (error) {
1461
+ reject(error);
1462
+ } else {
1463
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1464
+ body = ObjectSerializer.deserialize(body, "string");
1465
+ resolve({ response: response, body: body });
1466
+ } else {
1467
+ reject(new HttpError(response, body, response.statusCode));
1468
+ }
1469
+ }
1470
+ });
1471
+ });
1472
+ });
1473
+ }
1474
+ /**
1475
+ *
1476
+ * @summary Restore phone number
1477
+ * @param phoneNumberID
1478
+ */
1479
+ public async restorePhoneNumber (phoneNumberID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PhoneNumber; }> {
1480
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/{phoneNumberID}'
1481
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1482
+ let localVarQueryParameters: any = {};
1483
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1484
+ const produces = ['application/json'];
1485
+ // give precedence to 'application/json'
1486
+ if (produces.indexOf('application/json') >= 0) {
1487
+ localVarHeaderParams.Accept = 'application/json';
1488
+ } else {
1489
+ localVarHeaderParams.Accept = produces.join(',');
1490
+ }
1491
+ let localVarFormParams: any = {};
1492
+
1493
+ // verify required parameter 'phoneNumberID' is not null or undefined
1494
+ if (phoneNumberID === null || phoneNumberID === undefined) {
1495
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling restorePhoneNumber.');
1496
+ }
1497
+
1498
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1499
+
1500
+ let localVarUseFormData = false;
1501
+
1502
+ let localVarRequestOptions: localVarRequest.Options = {
1503
+ method: 'PATCH',
1504
+ qs: localVarQueryParameters,
1505
+ headers: localVarHeaderParams,
1506
+ uri: localVarPath,
1507
+ useQuerystring: this._useQuerystring,
1508
+ json: true,
1509
+ };
1510
+
1511
+ let authenticationPromise = Promise.resolve();
1512
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1513
+
1514
+ let interceptorPromise = authenticationPromise;
1515
+ for (const interceptor of this.interceptors) {
1516
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1517
+ }
1518
+
1519
+ return interceptorPromise.then(() => {
1520
+ if (Object.keys(localVarFormParams).length) {
1521
+ if (localVarUseFormData) {
1522
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1523
+ } else {
1524
+ localVarRequestOptions.form = localVarFormParams;
1525
+ }
1526
+ }
1527
+ return new Promise<{ response: http.IncomingMessage; body: PhoneNumber; }>((resolve, reject) => {
1528
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1529
+ if (error) {
1530
+ reject(error);
1531
+ } else {
1532
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1533
+ body = ObjectSerializer.deserialize(body, "PhoneNumber");
1534
+ resolve({ response: response, body: body });
1535
+ } else {
1536
+ reject(new HttpError(response, body, response.statusCode));
1537
+ }
1538
+ }
1539
+ });
1540
+ });
1541
+ });
1542
+ }
1543
+ /**
1544
+ *
1545
+ * @summary Save imported list
1546
+ * @param listID
1547
+ * @param inlineObject61
1548
+ */
1549
+ public async saveImportedList (listID: string, inlineObject61: InlineObject61, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1550
+ const localVarPath = this.basePath + '/v1/sms/importedList/{listID}'
1551
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1552
+ let localVarQueryParameters: any = {};
1553
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1554
+ const produces = ['application/json'];
1555
+ // give precedence to 'application/json'
1556
+ if (produces.indexOf('application/json') >= 0) {
1557
+ localVarHeaderParams.Accept = 'application/json';
1558
+ } else {
1559
+ localVarHeaderParams.Accept = produces.join(',');
1560
+ }
1561
+ let localVarFormParams: any = {};
1562
+
1563
+ // verify required parameter 'listID' is not null or undefined
1564
+ if (listID === null || listID === undefined) {
1565
+ throw new Error('Required parameter listID was null or undefined when calling saveImportedList.');
1566
+ }
1567
+
1568
+ // verify required parameter 'inlineObject61' is not null or undefined
1569
+ if (inlineObject61 === null || inlineObject61 === undefined) {
1570
+ throw new Error('Required parameter inlineObject61 was null or undefined when calling saveImportedList.');
1571
+ }
1572
+
1573
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1574
+
1575
+ let localVarUseFormData = false;
1576
+
1577
+ let localVarRequestOptions: localVarRequest.Options = {
1578
+ method: 'PUT',
1579
+ qs: localVarQueryParameters,
1580
+ headers: localVarHeaderParams,
1581
+ uri: localVarPath,
1582
+ useQuerystring: this._useQuerystring,
1583
+ json: true,
1584
+ body: ObjectSerializer.serialize(inlineObject61, "InlineObject61")
1585
+ };
1586
+
1587
+ let authenticationPromise = Promise.resolve();
1588
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1589
+
1590
+ let interceptorPromise = authenticationPromise;
1591
+ for (const interceptor of this.interceptors) {
1592
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1593
+ }
1594
+
1595
+ return interceptorPromise.then(() => {
1596
+ if (Object.keys(localVarFormParams).length) {
1597
+ if (localVarUseFormData) {
1598
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1599
+ } else {
1600
+ localVarRequestOptions.form = localVarFormParams;
1601
+ }
1602
+ }
1603
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1604
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1605
+ if (error) {
1606
+ reject(error);
1607
+ } else {
1608
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1609
+ body = ObjectSerializer.deserialize(body, "any");
1610
+ resolve({ response: response, body: body });
1611
+ } else {
1612
+ reject(new HttpError(response, body, response.statusCode));
1613
+ }
1614
+ }
1615
+ });
1616
+ });
1617
+ });
1618
+ }
1619
+ /**
1620
+ *
1621
+ * @summary Save opt in list
1622
+ * @param listID
1623
+ * @param inlineObject55
1624
+ */
1625
+ public async saveOptInList (listID: string, inlineObject55: InlineObject55, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1626
+ const localVarPath = this.basePath + '/v1/sms/optInList/{listID}'
1627
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1628
+ let localVarQueryParameters: any = {};
1629
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1630
+ const produces = ['application/json'];
1631
+ // give precedence to 'application/json'
1632
+ if (produces.indexOf('application/json') >= 0) {
1633
+ localVarHeaderParams.Accept = 'application/json';
1634
+ } else {
1635
+ localVarHeaderParams.Accept = produces.join(',');
1636
+ }
1637
+ let localVarFormParams: any = {};
1638
+
1639
+ // verify required parameter 'listID' is not null or undefined
1640
+ if (listID === null || listID === undefined) {
1641
+ throw new Error('Required parameter listID was null or undefined when calling saveOptInList.');
1642
+ }
1643
+
1644
+ // verify required parameter 'inlineObject55' is not null or undefined
1645
+ if (inlineObject55 === null || inlineObject55 === undefined) {
1646
+ throw new Error('Required parameter inlineObject55 was null or undefined when calling saveOptInList.');
1647
+ }
1648
+
1649
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1650
+
1651
+ let localVarUseFormData = false;
1652
+
1653
+ let localVarRequestOptions: localVarRequest.Options = {
1654
+ method: 'PUT',
1655
+ qs: localVarQueryParameters,
1656
+ headers: localVarHeaderParams,
1657
+ uri: localVarPath,
1658
+ useQuerystring: this._useQuerystring,
1659
+ json: true,
1660
+ body: ObjectSerializer.serialize(inlineObject55, "InlineObject55")
1661
+ };
1662
+
1663
+ let authenticationPromise = Promise.resolve();
1664
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1665
+
1666
+ let interceptorPromise = authenticationPromise;
1667
+ for (const interceptor of this.interceptors) {
1668
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1669
+ }
1670
+
1671
+ return interceptorPromise.then(() => {
1672
+ if (Object.keys(localVarFormParams).length) {
1673
+ if (localVarUseFormData) {
1674
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1675
+ } else {
1676
+ localVarRequestOptions.form = localVarFormParams;
1677
+ }
1678
+ }
1679
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1680
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1681
+ if (error) {
1682
+ reject(error);
1683
+ } else {
1684
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1685
+ body = ObjectSerializer.deserialize(body, "any");
1686
+ resolve({ response: response, body: body });
1687
+ } else {
1688
+ reject(new HttpError(response, body, response.statusCode));
1689
+ }
1690
+ }
1691
+ });
1692
+ });
1693
+ });
1694
+ }
1695
+ /**
1696
+ *
1697
+ * @summary Save opt in list source
1698
+ * @param sourceID
1699
+ * @param inlineObject58
1700
+ */
1701
+ public async saveOptInListSource (sourceID: string, inlineObject58: InlineObject58, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: OptInListSource; }> {
1702
+ const localVarPath = this.basePath + '/v1/sms/optInListSource/{sourceID}'
1703
+ .replace('{' + 'sourceID' + '}', encodeURIComponent(String(sourceID)));
1704
+ let localVarQueryParameters: any = {};
1705
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1706
+ const produces = ['application/json'];
1707
+ // give precedence to 'application/json'
1708
+ if (produces.indexOf('application/json') >= 0) {
1709
+ localVarHeaderParams.Accept = 'application/json';
1710
+ } else {
1711
+ localVarHeaderParams.Accept = produces.join(',');
1712
+ }
1713
+ let localVarFormParams: any = {};
1714
+
1715
+ // verify required parameter 'sourceID' is not null or undefined
1716
+ if (sourceID === null || sourceID === undefined) {
1717
+ throw new Error('Required parameter sourceID was null or undefined when calling saveOptInListSource.');
1718
+ }
1719
+
1720
+ // verify required parameter 'inlineObject58' is not null or undefined
1721
+ if (inlineObject58 === null || inlineObject58 === undefined) {
1722
+ throw new Error('Required parameter inlineObject58 was null or undefined when calling saveOptInListSource.');
1723
+ }
1724
+
1725
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1726
+
1727
+ let localVarUseFormData = false;
1728
+
1729
+ let localVarRequestOptions: localVarRequest.Options = {
1730
+ method: 'PUT',
1731
+ qs: localVarQueryParameters,
1732
+ headers: localVarHeaderParams,
1733
+ uri: localVarPath,
1734
+ useQuerystring: this._useQuerystring,
1735
+ json: true,
1736
+ body: ObjectSerializer.serialize(inlineObject58, "InlineObject58")
1737
+ };
1738
+
1739
+ let authenticationPromise = Promise.resolve();
1740
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1741
+
1742
+ let interceptorPromise = authenticationPromise;
1743
+ for (const interceptor of this.interceptors) {
1744
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1745
+ }
1746
+
1747
+ return interceptorPromise.then(() => {
1748
+ if (Object.keys(localVarFormParams).length) {
1749
+ if (localVarUseFormData) {
1750
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1751
+ } else {
1752
+ localVarRequestOptions.form = localVarFormParams;
1753
+ }
1754
+ }
1755
+ return new Promise<{ response: http.IncomingMessage; body: OptInListSource; }>((resolve, reject) => {
1756
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1757
+ if (error) {
1758
+ reject(error);
1759
+ } else {
1760
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1761
+ body = ObjectSerializer.deserialize(body, "OptInListSource");
1762
+ resolve({ response: response, body: body });
1763
+ } else {
1764
+ reject(new HttpError(response, body, response.statusCode));
1765
+ }
1766
+ }
1767
+ });
1768
+ });
1769
+ });
1770
+ }
1771
+ /**
1772
+ *
1773
+ * @summary Request phone number verification
1774
+ * @param phoneNumberID
1775
+ * @param inlineObject53
1776
+ */
1777
+ public async sendPhoneNumberForVerification (phoneNumberID: string, inlineObject53: InlineObject53, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
1778
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/verification/{phoneNumberID}'
1779
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1780
+ let localVarQueryParameters: any = {};
1781
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1782
+ const produces = ['application/json'];
1783
+ // give precedence to 'application/json'
1784
+ if (produces.indexOf('application/json') >= 0) {
1785
+ localVarHeaderParams.Accept = 'application/json';
1786
+ } else {
1787
+ localVarHeaderParams.Accept = produces.join(',');
1788
+ }
1789
+ let localVarFormParams: any = {};
1790
+
1791
+ // verify required parameter 'phoneNumberID' is not null or undefined
1792
+ if (phoneNumberID === null || phoneNumberID === undefined) {
1793
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling sendPhoneNumberForVerification.');
1794
+ }
1795
+
1796
+ // verify required parameter 'inlineObject53' is not null or undefined
1797
+ if (inlineObject53 === null || inlineObject53 === undefined) {
1798
+ throw new Error('Required parameter inlineObject53 was null or undefined when calling sendPhoneNumberForVerification.');
1799
+ }
1800
+
1801
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1802
+
1803
+ let localVarUseFormData = false;
1804
+
1805
+ let localVarRequestOptions: localVarRequest.Options = {
1806
+ method: 'PUT',
1807
+ qs: localVarQueryParameters,
1808
+ headers: localVarHeaderParams,
1809
+ uri: localVarPath,
1810
+ useQuerystring: this._useQuerystring,
1811
+ json: true,
1812
+ body: ObjectSerializer.serialize(inlineObject53, "InlineObject53")
1813
+ };
1814
+
1815
+ let authenticationPromise = Promise.resolve();
1816
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1817
+
1818
+ let interceptorPromise = authenticationPromise;
1819
+ for (const interceptor of this.interceptors) {
1820
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1821
+ }
1822
+
1823
+ return interceptorPromise.then(() => {
1824
+ if (Object.keys(localVarFormParams).length) {
1825
+ if (localVarUseFormData) {
1826
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1827
+ } else {
1828
+ localVarRequestOptions.form = localVarFormParams;
1829
+ }
1830
+ }
1831
+ return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
1832
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1833
+ if (error) {
1834
+ reject(error);
1835
+ } else {
1836
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1837
+ body = ObjectSerializer.deserialize(body, "string");
1838
+ resolve({ response: response, body: body });
1839
+ } else {
1840
+ reject(new HttpError(response, body, response.statusCode));
1841
+ }
1842
+ }
1843
+ });
1844
+ });
1845
+ });
1846
+ }
1847
+ /**
1848
+ *
1849
+ * @summary Send SMS to opt in list
1850
+ * @param listID
1851
+ * @param inlineObject56
1852
+ */
1853
+ public async sendSMSToOptInList (listID: string, inlineObject56: InlineObject56, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<OutboundSMS>; }> {
1854
+ const localVarPath = this.basePath + '/v1/sms/optInList/send/{listID}'
1855
+ .replace('{' + 'listID' + '}', encodeURIComponent(String(listID)));
1856
+ let localVarQueryParameters: any = {};
1857
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1858
+ const produces = ['application/json'];
1859
+ // give precedence to 'application/json'
1860
+ if (produces.indexOf('application/json') >= 0) {
1861
+ localVarHeaderParams.Accept = 'application/json';
1862
+ } else {
1863
+ localVarHeaderParams.Accept = produces.join(',');
1864
+ }
1865
+ let localVarFormParams: any = {};
1866
+
1867
+ // verify required parameter 'listID' is not null or undefined
1868
+ if (listID === null || listID === undefined) {
1869
+ throw new Error('Required parameter listID was null or undefined when calling sendSMSToOptInList.');
1870
+ }
1871
+
1872
+ // verify required parameter 'inlineObject56' is not null or undefined
1873
+ if (inlineObject56 === null || inlineObject56 === undefined) {
1874
+ throw new Error('Required parameter inlineObject56 was null or undefined when calling sendSMSToOptInList.');
1875
+ }
1876
+
1877
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1878
+
1879
+ let localVarUseFormData = false;
1880
+
1881
+ let localVarRequestOptions: localVarRequest.Options = {
1882
+ method: 'POST',
1883
+ qs: localVarQueryParameters,
1884
+ headers: localVarHeaderParams,
1885
+ uri: localVarPath,
1886
+ useQuerystring: this._useQuerystring,
1887
+ json: true,
1888
+ body: ObjectSerializer.serialize(inlineObject56, "InlineObject56")
1889
+ };
1890
+
1891
+ let authenticationPromise = Promise.resolve();
1892
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1893
+
1894
+ let interceptorPromise = authenticationPromise;
1895
+ for (const interceptor of this.interceptors) {
1896
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1897
+ }
1898
+
1899
+ return interceptorPromise.then(() => {
1900
+ if (Object.keys(localVarFormParams).length) {
1901
+ if (localVarUseFormData) {
1902
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1903
+ } else {
1904
+ localVarRequestOptions.form = localVarFormParams;
1905
+ }
1906
+ }
1907
+ return new Promise<{ response: http.IncomingMessage; body: Array<OutboundSMS>; }>((resolve, reject) => {
1908
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1909
+ if (error) {
1910
+ reject(error);
1911
+ } else {
1912
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1913
+ body = ObjectSerializer.deserialize(body, "Array<OutboundSMS>");
1914
+ resolve({ response: response, body: body });
1915
+ } else {
1916
+ reject(new HttpError(response, body, response.statusCode));
1917
+ }
1918
+ }
1919
+ });
1920
+ });
1921
+ });
1922
+ }
1923
+ /**
1924
+ *
1925
+ * @summary Update phone number
1926
+ * @param phoneNumberID
1927
+ * @param inlineObject54
1928
+ */
1929
+ public async updatePhoneNumber (phoneNumberID: string, inlineObject54: InlineObject54, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
1930
+ const localVarPath = this.basePath + '/v1/sms/phoneNumber/{phoneNumberID}'
1931
+ .replace('{' + 'phoneNumberID' + '}', encodeURIComponent(String(phoneNumberID)));
1932
+ let localVarQueryParameters: any = {};
1933
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1934
+ const produces = ['application/json'];
1935
+ // give precedence to 'application/json'
1936
+ if (produces.indexOf('application/json') >= 0) {
1937
+ localVarHeaderParams.Accept = 'application/json';
1938
+ } else {
1939
+ localVarHeaderParams.Accept = produces.join(',');
1940
+ }
1941
+ let localVarFormParams: any = {};
1942
+
1943
+ // verify required parameter 'phoneNumberID' is not null or undefined
1944
+ if (phoneNumberID === null || phoneNumberID === undefined) {
1945
+ throw new Error('Required parameter phoneNumberID was null or undefined when calling updatePhoneNumber.');
1946
+ }
1947
+
1948
+ // verify required parameter 'inlineObject54' is not null or undefined
1949
+ if (inlineObject54 === null || inlineObject54 === undefined) {
1950
+ throw new Error('Required parameter inlineObject54 was null or undefined when calling updatePhoneNumber.');
1951
+ }
1952
+
1953
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1954
+
1955
+ let localVarUseFormData = false;
1956
+
1957
+ let localVarRequestOptions: localVarRequest.Options = {
1958
+ method: 'PUT',
1959
+ qs: localVarQueryParameters,
1960
+ headers: localVarHeaderParams,
1961
+ uri: localVarPath,
1962
+ useQuerystring: this._useQuerystring,
1963
+ json: true,
1964
+ body: ObjectSerializer.serialize(inlineObject54, "InlineObject54")
1965
+ };
1966
+
1967
+ let authenticationPromise = Promise.resolve();
1968
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1969
+
1970
+ let interceptorPromise = authenticationPromise;
1971
+ for (const interceptor of this.interceptors) {
1972
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1973
+ }
1974
+
1975
+ return interceptorPromise.then(() => {
1976
+ if (Object.keys(localVarFormParams).length) {
1977
+ if (localVarUseFormData) {
1978
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1979
+ } else {
1980
+ localVarRequestOptions.form = localVarFormParams;
1981
+ }
1982
+ }
1983
+ return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
1984
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1985
+ if (error) {
1986
+ reject(error);
1987
+ } else {
1988
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1989
+ body = ObjectSerializer.deserialize(body, "any");
1990
+ resolve({ response: response, body: body });
1991
+ } else {
1992
+ reject(new HttpError(response, body, response.statusCode));
1993
+ }
1994
+ }
1995
+ });
1996
+ });
1997
+ });
1998
+ }
1999
+ }