@getbrevo/brevo 2.2.0 → 2.3.0

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 (816) hide show
  1. package/.openapi-generator/FILES +113 -24
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +5 -5
  4. package/api/accountApi.ts +6 -1
  5. package/api/apis.ts +9 -3
  6. package/api/balanceApi.ts +1725 -0
  7. package/api/companiesApi.ts +247 -69
  8. package/api/contactsApi.ts +119 -25
  9. package/api/dealsApi.ts +181 -1
  10. package/api/ecommerceApi.ts +29 -14
  11. package/api/emailCampaignsApi.ts +2 -2
  12. package/api/masterAccountApi.ts +233 -4
  13. package/api/programApi.ts +992 -0
  14. package/api/rewardApi.ts +975 -0
  15. package/api/tierApi.ts +952 -0
  16. package/api/transactionalEmailsApi.ts +78 -1
  17. package/api/transactionalSMSApi.ts +60 -0
  18. package/api/userApi.ts +2 -2
  19. package/dist/api/accountApi.d.ts +1 -2
  20. package/dist/api/accountApi.js +9 -5
  21. package/dist/api/accountApi.js.map +1 -1
  22. package/dist/api/apis.d.ts +9 -4
  23. package/dist/api/apis.js +9 -3
  24. package/dist/api/apis.js.map +1 -1
  25. package/dist/api/balanceApi.d.ts +187 -0
  26. package/dist/api/balanceApi.js +1434 -0
  27. package/dist/api/balanceApi.js.map +1 -0
  28. package/dist/api/companiesApi.d.ts +29 -10
  29. package/dist/api/companiesApi.js +204 -55
  30. package/dist/api/companiesApi.js.map +1 -1
  31. package/dist/api/contactsApi.d.ts +13 -6
  32. package/dist/api/contactsApi.js +142 -65
  33. package/dist/api/contactsApi.js.map +1 -1
  34. package/dist/api/conversationsApi.d.ts +0 -1
  35. package/dist/api/conversationsApi.js +19 -19
  36. package/dist/api/conversationsApi.js.map +1 -1
  37. package/dist/api/couponsApi.d.ts +0 -1
  38. package/dist/api/couponsApi.js +11 -11
  39. package/dist/api/couponsApi.js.map +1 -1
  40. package/dist/api/dealsApi.d.ts +21 -2
  41. package/dist/api/dealsApi.js +170 -21
  42. package/dist/api/dealsApi.js.map +1 -1
  43. package/dist/api/domainsApi.d.ts +0 -1
  44. package/dist/api/domainsApi.js +11 -11
  45. package/dist/api/domainsApi.js.map +1 -1
  46. package/dist/api/ecommerceApi.d.ts +3 -4
  47. package/dist/api/ecommerceApi.js +45 -36
  48. package/dist/api/ecommerceApi.js.map +1 -1
  49. package/dist/api/emailCampaignsApi.d.ts +1 -2
  50. package/dist/api/emailCampaignsApi.js +28 -28
  51. package/dist/api/emailCampaignsApi.js.map +1 -1
  52. package/dist/api/eventsApi.d.ts +0 -1
  53. package/dist/api/eventsApi.js +3 -3
  54. package/dist/api/eventsApi.js.map +1 -1
  55. package/dist/api/externalFeedsApi.d.ts +0 -1
  56. package/dist/api/externalFeedsApi.js +11 -11
  57. package/dist/api/externalFeedsApi.js.map +1 -1
  58. package/dist/api/filesApi.d.ts +0 -1
  59. package/dist/api/filesApi.js +11 -11
  60. package/dist/api/filesApi.js.map +1 -1
  61. package/dist/api/inboundParsingApi.d.ts +0 -2
  62. package/dist/api/inboundParsingApi.js +7 -7
  63. package/dist/api/inboundParsingApi.js.map +1 -1
  64. package/dist/api/masterAccountApi.d.ts +27 -2
  65. package/dist/api/masterAccountApi.js +250 -49
  66. package/dist/api/masterAccountApi.js.map +1 -1
  67. package/dist/api/notesApi.d.ts +0 -1
  68. package/dist/api/notesApi.js +11 -11
  69. package/dist/api/notesApi.js.map +1 -1
  70. package/dist/api/paymentsApi.d.ts +0 -1
  71. package/dist/api/paymentsApi.js +7 -7
  72. package/dist/api/paymentsApi.js.map +1 -1
  73. package/dist/api/processApi.d.ts +0 -1
  74. package/dist/api/processApi.js +5 -5
  75. package/dist/api/processApi.js.map +1 -1
  76. package/dist/api/programApi.d.ts +125 -0
  77. package/dist/api/programApi.js +847 -0
  78. package/dist/api/programApi.js.map +1 -0
  79. package/dist/api/resellerApi.d.ts +0 -1
  80. package/dist/api/resellerApi.js +33 -33
  81. package/dist/api/resellerApi.js.map +1 -1
  82. package/dist/api/rewardApi.d.ts +119 -0
  83. package/dist/api/rewardApi.js +814 -0
  84. package/dist/api/rewardApi.js.map +1 -0
  85. package/dist/api/sMSCampaignsApi.d.ts +0 -1
  86. package/dist/api/sMSCampaignsApi.js +21 -21
  87. package/dist/api/sMSCampaignsApi.js.map +1 -1
  88. package/dist/api/sendersApi.d.ts +0 -1
  89. package/dist/api/sendersApi.js +15 -15
  90. package/dist/api/sendersApi.js.map +1 -1
  91. package/dist/api/tasksApi.d.ts +0 -1
  92. package/dist/api/tasksApi.js +13 -13
  93. package/dist/api/tasksApi.js.map +1 -1
  94. package/dist/api/tierApi.d.ts +116 -0
  95. package/dist/api/tierApi.js +801 -0
  96. package/dist/api/tierApi.js.map +1 -0
  97. package/dist/api/transactionalEmailsApi.d.ts +10 -1
  98. package/dist/api/transactionalEmailsApi.js +112 -45
  99. package/dist/api/transactionalEmailsApi.js.map +1 -1
  100. package/dist/api/transactionalSMSApi.d.ts +8 -1
  101. package/dist/api/transactionalSMSApi.js +64 -9
  102. package/dist/api/transactionalSMSApi.js.map +1 -1
  103. package/dist/api/transactionalWhatsAppApi.d.ts +0 -1
  104. package/dist/api/transactionalWhatsAppApi.js +5 -5
  105. package/dist/api/transactionalWhatsAppApi.js.map +1 -1
  106. package/dist/api/userApi.d.ts +0 -1
  107. package/dist/api/userApi.js +13 -13
  108. package/dist/api/userApi.js.map +1 -1
  109. package/dist/api/webhooksApi.d.ts +0 -1
  110. package/dist/api/webhooksApi.js +13 -13
  111. package/dist/api/webhooksApi.js.map +1 -1
  112. package/dist/api/whatsAppCampaignsApi.d.ts +0 -1
  113. package/dist/api/whatsAppCampaignsApi.js +19 -19
  114. package/dist/api/whatsAppCampaignsApi.js.map +1 -1
  115. package/dist/base.d.ts +66 -0
  116. package/dist/base.js +65 -0
  117. package/dist/base.js.map +1 -0
  118. package/dist/common.d.ts +65 -0
  119. package/dist/common.js +161 -0
  120. package/dist/common.js.map +1 -0
  121. package/dist/configuration.d.ts +91 -0
  122. package/dist/configuration.js +44 -0
  123. package/dist/configuration.js.map +1 -0
  124. package/dist/index.d.ts +13 -0
  125. package/dist/index.js +31 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/model/abTestCampaignResult.js +1 -1
  128. package/dist/model/abTestCampaignResult.js.map +1 -1
  129. package/dist/model/addContactToList.d.ts +1 -0
  130. package/dist/model/addContactToList.js +5 -0
  131. package/dist/model/addContactToList.js.map +1 -1
  132. package/dist/model/addSubscriptionMemberPayload.d.ts +16 -0
  133. package/dist/model/addSubscriptionMemberPayload.js +28 -0
  134. package/dist/model/addSubscriptionMemberPayload.js.map +1 -0
  135. package/dist/model/aggregateBalance.d.ts +15 -0
  136. package/dist/model/aggregateBalance.js +23 -0
  137. package/dist/model/aggregateBalance.js.map +1 -0
  138. package/dist/model/balance.d.ts +22 -0
  139. package/dist/model/balance.js +58 -0
  140. package/dist/model/balance.js.map +1 -0
  141. package/dist/model/balanceDataPerContact.d.ts +17 -0
  142. package/dist/model/balanceDataPerContact.js +33 -0
  143. package/dist/model/balanceDataPerContact.js.map +1 -0
  144. package/dist/model/balanceDefinition.d.ts +42 -0
  145. package/dist/model/balanceDefinition.js +121 -0
  146. package/dist/model/balanceDefinition.js.map +1 -0
  147. package/dist/model/balanceDefinitionPage.d.ts +15 -0
  148. package/dist/model/balanceDefinitionPage.js +18 -0
  149. package/dist/model/balanceDefinitionPage.js.map +1 -0
  150. package/dist/model/balanceLimit.d.ts +23 -0
  151. package/dist/model/balanceLimit.js +63 -0
  152. package/dist/model/balanceLimit.js.map +1 -0
  153. package/dist/model/balanceOrder.d.ts +27 -0
  154. package/dist/model/balanceOrder.js +73 -0
  155. package/dist/model/balanceOrder.js.map +1 -0
  156. package/dist/model/cart.js +1 -1
  157. package/dist/model/cart.js.map +1 -1
  158. package/dist/model/companiesIdPatchRequest.d.ts +2 -0
  159. package/dist/model/companiesIdPatchRequest.js +10 -0
  160. package/dist/model/companiesIdPatchRequest.js.map +1 -1
  161. package/dist/model/companiesImportPost200Response.d.ts +14 -0
  162. package/dist/model/companiesImportPost200Response.js +18 -0
  163. package/dist/model/companiesImportPost200Response.js.map +1 -0
  164. package/dist/model/companiesImportPost400Response.d.ts +14 -0
  165. package/dist/model/companiesImportPost400Response.js +18 -0
  166. package/dist/model/companiesImportPost400Response.js.map +1 -0
  167. package/dist/model/contactBalancesResp.d.ts +18 -0
  168. package/dist/model/contactBalancesResp.js +33 -0
  169. package/dist/model/contactBalancesResp.js.map +1 -0
  170. package/dist/model/contactErrorModel.d.ts +27 -0
  171. package/dist/model/contactErrorModel.js +40 -0
  172. package/dist/model/contactErrorModel.js.map +1 -0
  173. package/dist/model/conversationsMessage.d.ts +20 -0
  174. package/dist/model/conversationsMessage.js +76 -1
  175. package/dist/model/conversationsMessage.js.map +1 -1
  176. package/dist/model/conversationsMessageAttachmentsInner.d.ts +19 -0
  177. package/dist/model/conversationsMessageAttachmentsInner.js +43 -0
  178. package/dist/model/conversationsMessageAttachmentsInner.js.map +1 -0
  179. package/dist/model/conversationsMessageForwardedToSourceStatus.d.ts +15 -0
  180. package/dist/model/conversationsMessageForwardedToSourceStatus.js +23 -0
  181. package/dist/model/conversationsMessageForwardedToSourceStatus.js.map +1 -0
  182. package/dist/model/conversationsMessageFrom.d.ts +15 -0
  183. package/dist/model/conversationsMessageFrom.js +23 -0
  184. package/dist/model/conversationsMessageFrom.js.map +1 -0
  185. package/dist/model/conversationsMessageReplyTo.d.ts +15 -0
  186. package/dist/model/conversationsMessageReplyTo.js +23 -0
  187. package/dist/model/conversationsMessageReplyTo.js.map +1 -0
  188. package/dist/model/conversationsMessageToInner.d.ts +15 -0
  189. package/dist/model/conversationsMessageToInner.js +23 -0
  190. package/dist/model/conversationsMessageToInner.js.map +1 -0
  191. package/dist/model/conversionSourceMetrics.d.ts +5 -2
  192. package/dist/model/conversionSourceMetrics.js +5 -2
  193. package/dist/model/conversionSourceMetrics.js.map +1 -1
  194. package/dist/model/corporateUserEmailPermissionsPutRequest.d.ts +16 -0
  195. package/dist/model/corporateUserEmailPermissionsPutRequest.js +23 -0
  196. package/dist/model/corporateUserEmailPermissionsPutRequest.js.map +1 -0
  197. package/dist/model/corporateUserEmailPermissionsPutRequestPrivilegesInner.d.ts +38 -0
  198. package/dist/model/corporateUserEmailPermissionsPutRequestPrivilegesInner.js +48 -0
  199. package/dist/model/corporateUserEmailPermissionsPutRequestPrivilegesInner.js.map +1 -0
  200. package/dist/model/createAttribute.d.ts +3 -1
  201. package/dist/model/createAttribute.js +7 -1
  202. package/dist/model/createAttribute.js.map +1 -1
  203. package/dist/model/createBalanceDefinitionPayload.d.ts +75 -0
  204. package/dist/model/createBalanceDefinitionPayload.js +145 -0
  205. package/dist/model/createBalanceDefinitionPayload.js.map +1 -0
  206. package/dist/model/createBalanceLimitPayload.d.ts +35 -0
  207. package/dist/model/createBalanceLimitPayload.js +62 -0
  208. package/dist/model/createBalanceLimitPayload.js.map +1 -0
  209. package/dist/model/createBalancePayload.d.ts +14 -0
  210. package/dist/model/createBalancePayload.js +18 -0
  211. package/dist/model/createBalancePayload.js.map +1 -0
  212. package/dist/model/createChild.js +1 -1
  213. package/dist/model/createChild.js.map +1 -1
  214. package/dist/model/createContact.d.ts +3 -1
  215. package/dist/model/createContact.js +1 -1
  216. package/dist/model/createContact.js.map +1 -1
  217. package/dist/model/createDoiContact.d.ts +3 -1
  218. package/dist/model/createDoiContact.js +1 -1
  219. package/dist/model/createDoiContact.js.map +1 -1
  220. package/dist/model/createEmailCampaign.d.ts +2 -0
  221. package/dist/model/createEmailCampaign.js +6 -1
  222. package/dist/model/createEmailCampaign.js.map +1 -1
  223. package/dist/model/createEmailCampaignEmailExpirationDate.d.ts +22 -0
  224. package/dist/model/createEmailCampaignEmailExpirationDate.js +31 -0
  225. package/dist/model/createEmailCampaignEmailExpirationDate.js.map +1 -0
  226. package/dist/model/createEmailCampaignRecipients.d.ts +1 -0
  227. package/dist/model/createEmailCampaignRecipients.js +5 -0
  228. package/dist/model/createEmailCampaignRecipients.js.map +1 -1
  229. package/dist/model/createExternalFeed.js +1 -1
  230. package/dist/model/createExternalFeed.js.map +1 -1
  231. package/dist/model/createLoyaltyProgramPayload.d.ts +19 -0
  232. package/dist/model/createLoyaltyProgramPayload.js +33 -0
  233. package/dist/model/createLoyaltyProgramPayload.js.map +1 -0
  234. package/dist/model/createOrderPayload.d.ts +22 -0
  235. package/dist/model/createOrderPayload.js +48 -0
  236. package/dist/model/createOrderPayload.js.map +1 -0
  237. package/dist/model/createSmsCampaign.js.map +1 -1
  238. package/dist/model/createSubAccount.js +1 -1
  239. package/dist/model/createSubAccount.js.map +1 -1
  240. package/dist/model/createSubscriptionPayload.d.ts +16 -0
  241. package/dist/model/createSubscriptionPayload.js +28 -0
  242. package/dist/model/createSubscriptionPayload.js.map +1 -0
  243. package/dist/model/createSubscriptionResponse.d.ts +20 -0
  244. package/dist/model/createSubscriptionResponse.js +48 -0
  245. package/dist/model/createSubscriptionResponse.js.map +1 -0
  246. package/dist/model/createTierGroupRequest.d.ts +29 -0
  247. package/dist/model/createTierGroupRequest.js +51 -0
  248. package/dist/model/createTierGroupRequest.js.map +1 -0
  249. package/dist/model/createTransactionPayload.d.ts +24 -0
  250. package/dist/model/createTransactionPayload.js +58 -0
  251. package/dist/model/createTransactionPayload.js.map +1 -0
  252. package/dist/model/createUpdateCategory.js.map +1 -1
  253. package/dist/model/createUpdateProduct.js.map +1 -1
  254. package/dist/model/createWebhook.d.ts +5 -0
  255. package/dist/model/createWebhook.js +12 -1
  256. package/dist/model/createWebhook.js.map +1 -1
  257. package/dist/model/createWhatsAppTemplate.js +1 -1
  258. package/dist/model/createWhatsAppTemplate.js.map +1 -1
  259. package/dist/model/crmAttributesPost200Response.d.ts +14 -0
  260. package/dist/model/crmAttributesPost200Response.js +18 -0
  261. package/dist/model/crmAttributesPost200Response.js.map +1 -0
  262. package/dist/model/crmAttributesPostRequest.d.ts +33 -0
  263. package/dist/model/crmAttributesPostRequest.js +55 -0
  264. package/dist/model/crmAttributesPostRequest.js.map +1 -0
  265. package/dist/model/crmDealsIdPatchRequest.d.ts +2 -0
  266. package/dist/model/crmDealsIdPatchRequest.js +10 -0
  267. package/dist/model/crmDealsIdPatchRequest.js.map +1 -1
  268. package/dist/model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.d.ts +5 -2
  269. package/dist/model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.js +5 -2
  270. package/dist/model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.js.map +1 -1
  271. package/dist/model/emailExportRecipients.js +1 -1
  272. package/dist/model/emailExportRecipients.js.map +1 -1
  273. package/dist/model/errorModel.d.ts +0 -1
  274. package/dist/model/errorModel.js +1 -2
  275. package/dist/model/errorModel.js.map +1 -1
  276. package/dist/model/errorResponse.d.ts +14 -0
  277. package/dist/model/errorResponse.js +18 -0
  278. package/dist/model/errorResponse.js.map +1 -0
  279. package/dist/model/exportWebhooksHistory.js +1 -1
  280. package/dist/model/exportWebhooksHistory.js.map +1 -1
  281. package/dist/model/fetchTemplatePreview.d.ts +16 -0
  282. package/dist/model/fetchTemplatePreview.js +28 -0
  283. package/dist/model/fetchTemplatePreview.js.map +1 -0
  284. package/dist/model/getAccountAllOfPlan.d.ts +1 -3
  285. package/dist/model/getAccountAllOfPlan.js +1 -7
  286. package/dist/model/getAccountAllOfPlan.js.map +1 -1
  287. package/dist/model/getAllExternalFeedsFeedsInner.js +1 -1
  288. package/dist/model/getAllExternalFeedsFeedsInner.js.map +1 -1
  289. package/dist/model/getAttributesAttributesInner.d.ts +4 -1
  290. package/dist/model/getAttributesAttributesInner.js +8 -1
  291. package/dist/model/getAttributesAttributesInner.js.map +1 -1
  292. package/dist/model/getCampaignOverview.js +1 -1
  293. package/dist/model/getCampaignOverview.js.map +1 -1
  294. package/dist/model/getCampaignStats.d.ts +2 -0
  295. package/dist/model/getCampaignStats.js +10 -0
  296. package/dist/model/getCampaignStats.js.map +1 -1
  297. package/dist/model/getContactCampaignStats.d.ts +6 -6
  298. package/dist/model/getContactCampaignStats.js +5 -5
  299. package/dist/model/getContactCampaignStats.js.map +1 -1
  300. package/dist/model/getContactCampaignStatsClickedInner.d.ts +2 -2
  301. package/dist/model/getContactCampaignStatsClickedInner.js +1 -1
  302. package/dist/model/getContactCampaignStatsUnsubscriptions.d.ts +4 -4
  303. package/dist/model/getContactCampaignStatsUnsubscriptions.js +2 -2
  304. package/dist/model/getContactCampaignStatsUnsubscriptions.js.map +1 -1
  305. package/dist/model/getCorporateInvitedUsersListUsersInnerFeatureAccess.d.ts +5 -0
  306. package/dist/model/getCorporateInvitedUsersListUsersInnerFeatureAccess.js +25 -0
  307. package/dist/model/getCorporateInvitedUsersListUsersInnerFeatureAccess.js.map +1 -1
  308. package/dist/model/getCorporateUserPermissionFeatureAccess.d.ts +5 -0
  309. package/dist/model/getCorporateUserPermissionFeatureAccess.js +25 -0
  310. package/dist/model/getCorporateUserPermissionFeatureAccess.js.map +1 -1
  311. package/dist/model/getEmailCampaign.d.ts +2 -4
  312. package/dist/model/getEmailCampaign.js +3 -3
  313. package/dist/model/getEmailCampaign.js.map +1 -1
  314. package/dist/model/getEmailCampaignsCampaignsInner.js +1 -1
  315. package/dist/model/getEmailCampaignsCampaignsInner.js.map +1 -1
  316. package/dist/model/getEmailEventReportEventsInner.js +1 -1
  317. package/dist/model/getEmailEventReportEventsInner.js.map +1 -1
  318. package/dist/model/getExtendedCampaignOverview.js +1 -1
  319. package/dist/model/getExtendedCampaignOverview.js.map +1 -1
  320. package/dist/model/getExtendedCampaignStats.js.map +1 -1
  321. package/dist/model/getExternalFeedByUUID.js +1 -1
  322. package/dist/model/getExternalFeedByUUID.js.map +1 -1
  323. package/dist/model/getInboundEmailEventsByUuidLogsInner.js +1 -1
  324. package/dist/model/getInboundEmailEventsByUuidLogsInner.js.map +1 -1
  325. package/dist/model/getOrdersOrdersInner.d.ts +6 -1
  326. package/dist/model/getOrdersOrdersInner.js +15 -5
  327. package/dist/model/getOrdersOrdersInner.js.map +1 -1
  328. package/dist/model/getPaymentRequest.js +1 -1
  329. package/dist/model/getPaymentRequest.js.map +1 -1
  330. package/dist/model/getProcess.js +1 -1
  331. package/dist/model/getProcess.js.map +1 -1
  332. package/dist/model/getScheduledEmailByBatchIdBatchesInner.js +1 -1
  333. package/dist/model/getScheduledEmailByBatchIdBatchesInner.js.map +1 -1
  334. package/dist/model/getScheduledEmailByMessageId.js +1 -1
  335. package/dist/model/getScheduledEmailByMessageId.js.map +1 -1
  336. package/dist/model/getSegment.d.ts +17 -0
  337. package/dist/model/getSegment.js +33 -0
  338. package/dist/model/getSegment.js.map +1 -0
  339. package/dist/model/getSegments.d.ts +2 -2
  340. package/dist/model/getSegments.js +1 -1
  341. package/dist/model/getSegments.js.map +1 -1
  342. package/dist/model/getSmsCampaign.d.ts +2 -4
  343. package/dist/model/getSmsCampaign.js +3 -3
  344. package/dist/model/getSmsCampaign.js.map +1 -1
  345. package/dist/model/getSmsCampaignOverview.js +1 -1
  346. package/dist/model/getSmsCampaignOverview.js.map +1 -1
  347. package/dist/model/getSmsCampaignsCampaignsInner.js +1 -1
  348. package/dist/model/getSmsCampaignsCampaignsInner.js.map +1 -1
  349. package/dist/model/getSmsEventReportEventsInner.js +1 -1
  350. package/dist/model/getSmsEventReportEventsInner.js.map +1 -1
  351. package/dist/model/getTransacBlockedContactsContactsInnerReason.js +1 -1
  352. package/dist/model/getTransacBlockedContactsContactsInnerReason.js.map +1 -1
  353. package/dist/model/getWebhook.js +1 -1
  354. package/dist/model/getWebhook.js.map +1 -1
  355. package/dist/model/getWhatsAppConfig.js +1 -1
  356. package/dist/model/getWhatsAppConfig.js.map +1 -1
  357. package/dist/model/getWhatsappCampaignOverview.js +1 -1
  358. package/dist/model/getWhatsappCampaignOverview.js.map +1 -1
  359. package/dist/model/getWhatsappCampaignsCampaignsInner.js +1 -1
  360. package/dist/model/getWhatsappCampaignsCampaignsInner.js.map +1 -1
  361. package/dist/model/getWhatsappEventReportEventsInner.js +1 -1
  362. package/dist/model/getWhatsappEventReportEventsInner.js.map +1 -1
  363. package/dist/model/inviteAdminUserPrivilegesInner.d.ts +11 -2
  364. package/dist/model/inviteAdminUserPrivilegesInner.js +10 -1
  365. package/dist/model/inviteAdminUserPrivilegesInner.js.map +1 -1
  366. package/dist/model/inviteuserPrivilegesInner.d.ts +5 -3
  367. package/dist/model/inviteuserPrivilegesInner.js +6 -4
  368. package/dist/model/inviteuserPrivilegesInner.js.map +1 -1
  369. package/dist/model/loyaltyProgram.d.ts +33 -0
  370. package/dist/model/loyaltyProgram.js +80 -0
  371. package/dist/model/loyaltyProgram.js.map +1 -0
  372. package/dist/model/loyaltyProgramPage.d.ts +15 -0
  373. package/dist/model/loyaltyProgramPage.js +18 -0
  374. package/dist/model/loyaltyProgramPage.js.map +1 -0
  375. package/dist/model/loyaltyProgramValidationError.d.ts +16 -0
  376. package/dist/model/loyaltyProgramValidationError.js +28 -0
  377. package/dist/model/loyaltyProgramValidationError.js.map +1 -0
  378. package/dist/model/loyaltyTierPage.d.ts +15 -0
  379. package/dist/model/loyaltyTierPage.js +18 -0
  380. package/dist/model/loyaltyTierPage.js.map +1 -0
  381. package/dist/model/mainAttributeRewardPayload.d.ts +22 -0
  382. package/dist/model/mainAttributeRewardPayload.js +48 -0
  383. package/dist/model/mainAttributeRewardPayload.js.map +1 -0
  384. package/dist/model/mainBillingPayload.d.ts +20 -0
  385. package/dist/model/mainBillingPayload.js +48 -0
  386. package/dist/model/mainBillingPayload.js.map +1 -0
  387. package/dist/model/mainCodeCountHttpResponse.d.ts +14 -0
  388. package/dist/model/mainCodeCountHttpResponse.js +18 -0
  389. package/dist/model/mainCodeCountHttpResponse.js.map +1 -0
  390. package/dist/model/mainCreateRedeemPayload.d.ts +24 -0
  391. package/dist/model/mainCreateRedeemPayload.js +53 -0
  392. package/dist/model/mainCreateRedeemPayload.js.map +1 -0
  393. package/dist/model/mainCreateRewardPayload.d.ts +17 -0
  394. package/dist/model/mainCreateRewardPayload.js +33 -0
  395. package/dist/model/mainCreateRewardPayload.js.map +1 -0
  396. package/dist/model/mainCreateRewardResponse.d.ts +21 -0
  397. package/dist/model/mainCreateRewardResponse.js +53 -0
  398. package/dist/model/mainCreateRewardResponse.js.map +1 -0
  399. package/dist/model/mainErrorResponse.d.ts +14 -0
  400. package/dist/model/mainErrorResponse.js +18 -0
  401. package/dist/model/mainErrorResponse.js.map +1 -0
  402. package/dist/model/mainFilter.d.ts +15 -0
  403. package/dist/model/mainFilter.js +23 -0
  404. package/dist/model/mainFilter.js.map +1 -0
  405. package/dist/model/mainGenerator.d.ts +19 -0
  406. package/dist/model/mainGenerator.js +43 -0
  407. package/dist/model/mainGenerator.js.map +1 -0
  408. package/dist/model/mainGetContactRewardsPayload.d.ts +31 -0
  409. package/dist/model/mainGetContactRewardsPayload.js +60 -0
  410. package/dist/model/mainGetContactRewardsPayload.js.map +1 -0
  411. package/dist/model/mainIdentifiersPayload.d.ts +15 -0
  412. package/dist/model/mainIdentifiersPayload.js +23 -0
  413. package/dist/model/mainIdentifiersPayload.js.map +1 -0
  414. package/dist/model/mainLimit.d.ts +21 -0
  415. package/dist/model/mainLimit.js +53 -0
  416. package/dist/model/mainLimit.js.map +1 -0
  417. package/dist/model/mainModelContactReward.d.ts +25 -0
  418. package/dist/model/mainModelContactReward.js +63 -0
  419. package/dist/model/mainModelContactReward.js.map +1 -0
  420. package/dist/model/mainModelContactRewardsResp.d.ts +19 -0
  421. package/dist/model/mainModelContactRewardsResp.js +38 -0
  422. package/dist/model/mainModelContactRewardsResp.js.map +1 -0
  423. package/dist/model/mainNodeResponse.d.ts +21 -0
  424. package/dist/model/mainNodeResponse.js +53 -0
  425. package/dist/model/mainNodeResponse.js.map +1 -0
  426. package/dist/model/mainOrderPayload.d.ts +28 -0
  427. package/dist/model/mainOrderPayload.js +73 -0
  428. package/dist/model/mainOrderPayload.js.map +1 -0
  429. package/dist/model/mainProduct.d.ts +17 -0
  430. package/dist/model/mainProduct.js +33 -0
  431. package/dist/model/mainProduct.js.map +1 -0
  432. package/dist/model/mainProductPayload.d.ts +18 -0
  433. package/dist/model/mainProductPayload.js +38 -0
  434. package/dist/model/mainProductPayload.js.map +1 -0
  435. package/dist/model/mainRedeem.d.ts +29 -0
  436. package/dist/model/mainRedeem.js +83 -0
  437. package/dist/model/mainRedeem.js.map +1 -0
  438. package/dist/model/mainResultParameterResponse.d.ts +16 -0
  439. package/dist/model/mainResultParameterResponse.js +23 -0
  440. package/dist/model/mainResultParameterResponse.js.map +1 -0
  441. package/dist/model/mainReward.d.ts +67 -0
  442. package/dist/model/mainReward.js +224 -0
  443. package/dist/model/mainReward.js.map +1 -0
  444. package/dist/model/mainRewardAttribution.d.ts +26 -0
  445. package/dist/model/mainRewardAttribution.js +68 -0
  446. package/dist/model/mainRewardAttribution.js.map +1 -0
  447. package/dist/model/mainRewardConfigurations.d.ts +16 -0
  448. package/dist/model/mainRewardConfigurations.js +28 -0
  449. package/dist/model/mainRewardConfigurations.js.map +1 -0
  450. package/dist/model/mainRewardPage.d.ts +16 -0
  451. package/dist/model/mainRewardPage.js +23 -0
  452. package/dist/model/mainRewardPage.js.map +1 -0
  453. package/dist/model/mainRewardPageObj.d.ts +22 -0
  454. package/dist/model/mainRewardPageObj.js +58 -0
  455. package/dist/model/mainRewardPageObj.js.map +1 -0
  456. package/dist/model/mainRewardValidate.d.ts +14 -0
  457. package/dist/model/mainRewardValidate.js +18 -0
  458. package/dist/model/mainRewardValidate.js.map +1 -0
  459. package/dist/model/mainRule.d.ts +31 -0
  460. package/dist/model/mainRule.js +78 -0
  461. package/dist/model/mainRule.js.map +1 -0
  462. package/dist/model/mainRuleConditionResponse.d.ts +19 -0
  463. package/dist/model/mainRuleConditionResponse.js +38 -0
  464. package/dist/model/mainRuleConditionResponse.js.map +1 -0
  465. package/dist/model/mainRuleEventResponse.d.ts +15 -0
  466. package/dist/model/mainRuleEventResponse.js +23 -0
  467. package/dist/model/mainRuleEventResponse.js.map +1 -0
  468. package/dist/model/mainRuleResultResponse.d.ts +17 -0
  469. package/dist/model/mainRuleResultResponse.js +28 -0
  470. package/dist/model/mainRuleResultResponse.js.map +1 -0
  471. package/dist/model/mainValidateRewardPayload.d.ts +19 -0
  472. package/dist/model/mainValidateRewardPayload.js +43 -0
  473. package/dist/model/mainValidateRewardPayload.js.map +1 -0
  474. package/dist/model/mainValueResponse.d.ts +22 -0
  475. package/dist/model/mainValueResponse.js +53 -0
  476. package/dist/model/mainValueResponse.js.map +1 -0
  477. package/dist/model/mainVoucherRevokePayload.d.ts +14 -0
  478. package/dist/model/mainVoucherRevokePayload.js +18 -0
  479. package/dist/model/mainVoucherRevokePayload.js.map +1 -0
  480. package/dist/model/masterDetailsResponsePlanInfo.js +1 -1
  481. package/dist/model/masterDetailsResponsePlanInfo.js.map +1 -1
  482. package/dist/model/memberContact.d.ts +16 -0
  483. package/dist/model/memberContact.js +28 -0
  484. package/dist/model/memberContact.js.map +1 -0
  485. package/dist/model/modelSubscriptionBalanceResp.d.ts +15 -0
  486. package/dist/model/modelSubscriptionBalanceResp.js +18 -0
  487. package/dist/model/modelSubscriptionBalanceResp.js.map +1 -0
  488. package/dist/model/models.d.ts +109 -25
  489. package/dist/model/models.js +412 -75
  490. package/dist/model/models.js.map +1 -1
  491. package/dist/model/notification.js +1 -1
  492. package/dist/model/notification.js.map +1 -1
  493. package/dist/model/order.d.ts +6 -1
  494. package/dist/model/order.js +15 -5
  495. package/dist/model/order.js.map +1 -1
  496. package/dist/model/orderBatch.js.map +1 -1
  497. package/dist/model/orderIdentifiers.d.ts +17 -0
  498. package/dist/model/orderIdentifiers.js +33 -0
  499. package/dist/model/orderIdentifiers.js.map +1 -0
  500. package/dist/model/patchLoyaltyProgramPayload.d.ts +16 -0
  501. package/dist/model/patchLoyaltyProgramPayload.js +28 -0
  502. package/dist/model/patchLoyaltyProgramPayload.js.map +1 -0
  503. package/dist/model/removeContactFromList.d.ts +1 -0
  504. package/dist/model/removeContactFromList.js +5 -0
  505. package/dist/model/removeContactFromList.js.map +1 -1
  506. package/dist/model/requestContactExport.d.ts +4 -0
  507. package/dist/model/requestContactExport.js +24 -0
  508. package/dist/model/requestContactExport.js.map +1 -1
  509. package/dist/model/requestContactExportCustomContactFilter.d.ts +1 -0
  510. package/dist/model/requestContactExportCustomContactFilter.js +6 -1
  511. package/dist/model/requestContactExportCustomContactFilter.js.map +1 -1
  512. package/dist/model/requestContactImport.js.map +1 -1
  513. package/dist/model/requestSmsRecipientExport.js +1 -1
  514. package/dist/model/requestSmsRecipientExport.js.map +1 -1
  515. package/dist/model/sendReport.js +1 -1
  516. package/dist/model/sendReport.js.map +1 -1
  517. package/dist/model/sendTransacSms.d.ts +2 -1
  518. package/dist/model/sendTransacSms.js +2 -2
  519. package/dist/model/sendTransacSms.js.map +1 -1
  520. package/dist/model/sendTransacSmsTag.d.ts +14 -0
  521. package/dist/model/sendTransacSmsTag.js +18 -0
  522. package/dist/model/sendTransacSmsTag.js.map +1 -0
  523. package/dist/model/ssoTokenRequest.js +1 -1
  524. package/dist/model/ssoTokenRequest.js.map +1 -1
  525. package/dist/model/subAccountDetailsResponsePlanInfoCredits.d.ts +4 -0
  526. package/dist/model/subAccountDetailsResponsePlanInfoCredits.js +10 -0
  527. package/dist/model/subAccountDetailsResponsePlanInfoCredits.js.map +1 -1
  528. package/dist/model/subAccountDetailsResponsePlanInfoCreditsExternalFeeds.d.ts +15 -0
  529. package/dist/model/subAccountDetailsResponsePlanInfoCreditsExternalFeeds.js +23 -0
  530. package/dist/model/subAccountDetailsResponsePlanInfoCreditsExternalFeeds.js.map +1 -0
  531. package/dist/model/subAccountDetailsResponsePlanInfoCreditsWhatsapp.d.ts +15 -0
  532. package/dist/model/subAccountDetailsResponsePlanInfoCreditsWhatsapp.js +23 -0
  533. package/dist/model/subAccountDetailsResponsePlanInfoCreditsWhatsapp.js.map +1 -0
  534. package/dist/model/subAccountDetailsResponsePlanInfoFeatures.d.ts +2 -0
  535. package/dist/model/subAccountDetailsResponsePlanInfoFeatures.js +5 -0
  536. package/dist/model/subAccountDetailsResponsePlanInfoFeatures.js.map +1 -1
  537. package/dist/model/subAccountDetailsResponsePlanInfoFeaturesSalesUsers.d.ts +15 -0
  538. package/dist/model/subAccountDetailsResponsePlanInfoFeaturesSalesUsers.js +23 -0
  539. package/dist/model/subAccountDetailsResponsePlanInfoFeaturesSalesUsers.js.map +1 -0
  540. package/dist/model/subAccountUpdatePlanRequestCredits.d.ts +2 -0
  541. package/dist/model/subAccountUpdatePlanRequestCredits.js +10 -0
  542. package/dist/model/subAccountUpdatePlanRequestCredits.js.map +1 -1
  543. package/dist/model/subAccountUpdatePlanRequestFeatures.d.ts +1 -0
  544. package/dist/model/subAccountUpdatePlanRequestFeatures.js +5 -0
  545. package/dist/model/subAccountUpdatePlanRequestFeatures.js.map +1 -1
  546. package/dist/model/subAccountsUpdatePlanRequest.d.ts +18 -0
  547. package/dist/model/subAccountsUpdatePlanRequest.js +28 -0
  548. package/dist/model/subAccountsUpdatePlanRequest.js.map +1 -0
  549. package/dist/model/subAccountsUpdatePlanRequestCredits.d.ts +18 -0
  550. package/dist/model/subAccountsUpdatePlanRequestCredits.js +38 -0
  551. package/dist/model/subAccountsUpdatePlanRequestCredits.js.map +1 -0
  552. package/dist/model/subAccountsUpdatePlanRequestFeatures.d.ts +16 -0
  553. package/dist/model/subAccountsUpdatePlanRequestFeatures.js +28 -0
  554. package/dist/model/subAccountsUpdatePlanRequestFeatures.js.map +1 -0
  555. package/dist/model/subscription.d.ts +20 -0
  556. package/dist/model/subscription.js +48 -0
  557. package/dist/model/subscription.js.map +1 -0
  558. package/dist/model/subscriptionAggregateBalance.d.ts +15 -0
  559. package/dist/model/subscriptionAggregateBalance.js +23 -0
  560. package/dist/model/subscriptionAggregateBalance.js.map +1 -0
  561. package/dist/model/subscriptionAttributedReward.d.ts +24 -0
  562. package/dist/model/subscriptionAttributedReward.js +58 -0
  563. package/dist/model/subscriptionAttributedReward.js.map +1 -0
  564. package/dist/model/subscriptionBalances.d.ts +17 -0
  565. package/dist/model/subscriptionBalances.js +28 -0
  566. package/dist/model/subscriptionBalances.js.map +1 -0
  567. package/dist/model/subscriptionHandlerInfo.d.ts +21 -0
  568. package/dist/model/subscriptionHandlerInfo.js +33 -0
  569. package/dist/model/subscriptionHandlerInfo.js.map +1 -0
  570. package/dist/model/subscriptionMember.d.ts +18 -0
  571. package/dist/model/subscriptionMember.js +38 -0
  572. package/dist/model/subscriptionMember.js.map +1 -0
  573. package/dist/model/subscriptionTier.d.ts +22 -0
  574. package/dist/model/subscriptionTier.js +48 -0
  575. package/dist/model/subscriptionTier.js.map +1 -0
  576. package/dist/model/taskReminder.js +1 -1
  577. package/dist/model/taskReminder.js.map +1 -1
  578. package/dist/model/templatePreview.d.ts +19 -0
  579. package/dist/model/templatePreview.js +43 -0
  580. package/dist/model/templatePreview.js.map +1 -0
  581. package/dist/model/tier.d.ts +24 -0
  582. package/dist/model/tier.js +58 -0
  583. package/dist/model/tier.js.map +1 -0
  584. package/dist/model/tierAccessConditionsInner.d.ts +17 -0
  585. package/dist/model/tierAccessConditionsInner.js +33 -0
  586. package/dist/model/tierAccessConditionsInner.js.map +1 -0
  587. package/dist/model/tierForContact.d.ts +22 -0
  588. package/dist/model/tierForContact.js +48 -0
  589. package/dist/model/tierForContact.js.map +1 -0
  590. package/dist/model/tierGroup.d.ts +33 -0
  591. package/dist/model/tierGroup.js +71 -0
  592. package/dist/model/tierGroup.js.map +1 -0
  593. package/dist/model/tierGroupPage.d.ts +15 -0
  594. package/dist/model/tierGroupPage.js +18 -0
  595. package/dist/model/tierGroupPage.js.map +1 -0
  596. package/dist/model/tierRequest.d.ts +19 -0
  597. package/dist/model/tierRequest.js +33 -0
  598. package/dist/model/tierRequest.js.map +1 -0
  599. package/dist/model/tierRequestAccessConditionsInner.d.ts +15 -0
  600. package/dist/model/tierRequestAccessConditionsInner.js +23 -0
  601. package/dist/model/tierRequestAccessConditionsInner.js.map +1 -0
  602. package/dist/model/tierRequestPutPayload.d.ts +19 -0
  603. package/dist/model/tierRequestPutPayload.js +33 -0
  604. package/dist/model/tierRequestPutPayload.js.map +1 -0
  605. package/dist/model/tierRequestTierRewardsInner.d.ts +14 -0
  606. package/dist/model/tierRequestTierRewardsInner.js +18 -0
  607. package/dist/model/tierRequestTierRewardsInner.js.map +1 -0
  608. package/dist/model/tierTierRewardsInner.d.ts +16 -0
  609. package/dist/model/tierTierRewardsInner.js +28 -0
  610. package/dist/model/tierTierRewardsInner.js.map +1 -0
  611. package/dist/model/transaction.d.ts +30 -0
  612. package/dist/model/transaction.js +88 -0
  613. package/dist/model/transaction.js.map +1 -0
  614. package/dist/model/transactionHistory.d.ts +25 -0
  615. package/dist/model/transactionHistory.js +63 -0
  616. package/dist/model/transactionHistory.js.map +1 -0
  617. package/dist/model/transactionHistoryResp.d.ts +19 -0
  618. package/dist/model/transactionHistoryResp.js +38 -0
  619. package/dist/model/transactionHistoryResp.js.map +1 -0
  620. package/dist/model/unauthorizedResponse.d.ts +14 -0
  621. package/dist/model/unauthorizedResponse.js +18 -0
  622. package/dist/model/unauthorizedResponse.js.map +1 -0
  623. package/dist/model/updateAttribute.d.ts +1 -0
  624. package/dist/model/updateAttribute.js +5 -0
  625. package/dist/model/updateAttribute.js.map +1 -1
  626. package/dist/model/updateBalanceDefinitionPayload.d.ts +77 -0
  627. package/dist/model/updateBalanceDefinitionPayload.js +145 -0
  628. package/dist/model/updateBalanceDefinitionPayload.js.map +1 -0
  629. package/dist/model/updateBalanceLimitPayload.d.ts +35 -0
  630. package/dist/model/updateBalanceLimitPayload.js +62 -0
  631. package/dist/model/updateBalanceLimitPayload.js.map +1 -0
  632. package/dist/model/updateCampaignStatus.js +1 -1
  633. package/dist/model/updateCampaignStatus.js.map +1 -1
  634. package/dist/model/updateContact.d.ts +3 -1
  635. package/dist/model/updateContact.js +1 -1
  636. package/dist/model/updateContact.js.map +1 -1
  637. package/dist/model/updateEmailCampaign.d.ts +2 -0
  638. package/dist/model/updateEmailCampaign.js +6 -1
  639. package/dist/model/updateEmailCampaign.js.map +1 -1
  640. package/dist/model/updateEmailCampaignEmailExpirationDate.d.ts +22 -0
  641. package/dist/model/updateEmailCampaignEmailExpirationDate.js +31 -0
  642. package/dist/model/updateEmailCampaignEmailExpirationDate.js.map +1 -0
  643. package/dist/model/updateEmailCampaignRecipients.d.ts +1 -0
  644. package/dist/model/updateEmailCampaignRecipients.js +5 -0
  645. package/dist/model/updateEmailCampaignRecipients.js.map +1 -1
  646. package/dist/model/updateExternalFeed.js +1 -1
  647. package/dist/model/updateExternalFeed.js.map +1 -1
  648. package/dist/model/updateLoyaltyProgramPayload.d.ts +16 -0
  649. package/dist/model/updateLoyaltyProgramPayload.js +28 -0
  650. package/dist/model/updateLoyaltyProgramPayload.js.map +1 -0
  651. package/dist/model/updateSmsCampaign.js.map +1 -1
  652. package/dist/model/updateTierGroupRequest.d.ts +29 -0
  653. package/dist/model/updateTierGroupRequest.js +51 -0
  654. package/dist/model/updateTierGroupRequest.js.map +1 -0
  655. package/dist/model/updateWebhook.js +1 -1
  656. package/dist/model/updateWebhook.js.map +1 -1
  657. package/dist/model/updateWhatsAppCampaign.js +1 -1
  658. package/dist/model/updateWhatsAppCampaign.js.map +1 -1
  659. package/model/addContactToList.ts +11 -2
  660. package/model/addSubscriptionMemberPayload.ts +52 -0
  661. package/model/aggregateBalance.ts +43 -0
  662. package/model/balance.ts +106 -0
  663. package/model/balanceDataPerContact.ts +49 -0
  664. package/model/balanceDefinition.ts +212 -0
  665. package/model/balanceDefinitionPage.ts +35 -0
  666. package/model/balanceLimit.ts +115 -0
  667. package/model/balanceOrder.ts +136 -0
  668. package/model/companiesIdPatchRequest.ts +18 -0
  669. package/model/companiesImportPost200Response.ts +34 -0
  670. package/model/companiesImportPost400Response.ts +31 -0
  671. package/model/contactBalancesResp.ts +50 -0
  672. package/model/contactErrorModel.ts +63 -0
  673. package/model/conversationsMessage.ts +131 -0
  674. package/model/conversationsMessageAttachmentsInner.ts +79 -0
  675. package/model/conversationsMessageForwardedToSourceStatus.ts +40 -0
  676. package/model/conversationsMessageFrom.ts +40 -0
  677. package/model/conversationsMessageReplyTo.ts +40 -0
  678. package/model/conversationsMessageToInner.ts +37 -0
  679. package/model/conversionSourceMetrics.ts +6 -3
  680. package/model/corporateUserEmailPermissionsPutRequest.ts +41 -0
  681. package/model/corporateUserEmailPermissionsPutRequestPrivilegesInner.ts +69 -0
  682. package/model/createAttribute.ts +13 -3
  683. package/model/createBalanceDefinitionPayload.ts +218 -0
  684. package/model/createBalanceLimitPayload.ts +98 -0
  685. package/model/createBalancePayload.ts +37 -0
  686. package/model/createContact.ts +4 -4
  687. package/model/createDoiContact.ts +3 -3
  688. package/model/createEmailCampaign.ts +7 -0
  689. package/model/createEmailCampaignEmailExpirationDate.ts +53 -0
  690. package/model/createEmailCampaignRecipients.ts +9 -0
  691. package/model/createLoyaltyProgramPayload.ts +61 -0
  692. package/model/createOrderPayload.ts +91 -0
  693. package/model/createSubscriptionPayload.ts +52 -0
  694. package/model/createSubscriptionResponse.ts +88 -0
  695. package/model/createTierGroupRequest.ts +73 -0
  696. package/model/createTransactionPayload.ts +109 -0
  697. package/model/createUpdateProduct.ts +1 -1
  698. package/model/createUpdateProducts.ts +1 -1
  699. package/model/createWebhook.ts +14 -1
  700. package/model/crmAttributesPost200Response.ts +34 -0
  701. package/model/crmAttributesPostRequest.ts +85 -0
  702. package/model/crmDealsIdPatchRequest.ts +18 -0
  703. package/model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ts +6 -3
  704. package/model/errorModel.ts +0 -1
  705. package/model/errorResponse.ts +31 -0
  706. package/model/fetchTemplatePreview.ts +52 -0
  707. package/model/getAccountAllOfPlan.ts +3 -13
  708. package/model/getAttributesAttributesInner.ts +12 -1
  709. package/model/getCampaignStats.ts +18 -0
  710. package/model/getContactCampaignStats.ts +11 -11
  711. package/model/getContactCampaignStatsClickedInner.ts +3 -3
  712. package/model/getContactCampaignStatsUnsubscriptions.ts +6 -6
  713. package/model/getCorporateInvitedUsersListUsersInnerFeatureAccess.ts +45 -0
  714. package/model/getCorporateUserPermissionFeatureAccess.ts +45 -0
  715. package/model/getEmailCampaign.ts +4 -6
  716. package/model/getExtendedCampaignStats.ts +3 -0
  717. package/model/getOrdersOrdersInner.ts +24 -8
  718. package/model/getSegment.ts +61 -0
  719. package/model/getSegments.ts +3 -3
  720. package/model/getSmsCampaign.ts +4 -6
  721. package/model/inviteAdminUserPrivilegesInner.ts +11 -2
  722. package/model/inviteuserPrivilegesInner.ts +5 -3
  723. package/model/loyaltyProgram.ts +139 -0
  724. package/model/loyaltyProgramPage.ts +35 -0
  725. package/model/loyaltyProgramValidationError.ts +52 -0
  726. package/model/loyaltyTierPage.ts +32 -0
  727. package/model/mainAttributeRewardPayload.ts +88 -0
  728. package/model/mainBillingPayload.ts +88 -0
  729. package/model/mainCodeCountHttpResponse.ts +34 -0
  730. package/model/mainCreateRedeemPayload.ts +98 -0
  731. package/model/mainCreateRewardPayload.ts +61 -0
  732. package/model/mainCreateRewardResponse.ts +97 -0
  733. package/model/mainErrorResponse.ts +34 -0
  734. package/model/mainFilter.ts +43 -0
  735. package/model/mainGenerator.ts +79 -0
  736. package/model/mainGetContactRewardsPayload.ts +99 -0
  737. package/model/mainIdentifiersPayload.ts +43 -0
  738. package/model/mainLimit.ts +97 -0
  739. package/model/mainModelContactReward.ts +115 -0
  740. package/model/mainModelContactRewardsResp.ts +71 -0
  741. package/model/mainNodeResponse.ts +97 -0
  742. package/model/mainOrderPayload.ts +136 -0
  743. package/model/mainProduct.ts +61 -0
  744. package/model/mainProductPayload.ts +70 -0
  745. package/model/mainRedeem.ts +151 -0
  746. package/model/mainResultParameterResponse.ts +44 -0
  747. package/model/mainReward.ts +397 -0
  748. package/model/mainRewardAttribution.ts +124 -0
  749. package/model/mainRewardConfigurations.ts +52 -0
  750. package/model/mainRewardPage.ts +44 -0
  751. package/model/mainRewardPageObj.ts +106 -0
  752. package/model/mainRewardValidate.ts +34 -0
  753. package/model/mainRule.ts +145 -0
  754. package/model/mainRuleConditionResponse.ts +71 -0
  755. package/model/mainRuleEventResponse.ts +43 -0
  756. package/model/mainRuleResultResponse.ts +53 -0
  757. package/model/mainValidateRewardPayload.ts +79 -0
  758. package/model/mainValueResponse.ts +98 -0
  759. package/model/mainVoucherRevokePayload.ts +34 -0
  760. package/model/memberContact.ts +52 -0
  761. package/model/modelSubscriptionBalanceResp.ts +32 -0
  762. package/model/models.ts +419 -77
  763. package/model/order.ts +24 -8
  764. package/model/orderBilling.ts +1 -1
  765. package/model/orderIdentifiers.ts +64 -0
  766. package/model/patchLoyaltyProgramPayload.ts +52 -0
  767. package/model/removeContactFromList.ts +12 -3
  768. package/model/requestContactExport.ts +37 -1
  769. package/model/requestContactExportCustomContactFilter.ts +10 -1
  770. package/model/sendSmtpEmail.ts +1 -1
  771. package/model/sendTransacSms.ts +3 -5
  772. package/model/sendTransacSmsTag.ts +37 -0
  773. package/model/subAccountDetailsResponsePlanInfoCredits.ts +14 -0
  774. package/model/subAccountDetailsResponsePlanInfoCreditsExternalFeeds.ts +46 -0
  775. package/model/subAccountDetailsResponsePlanInfoCreditsWhatsapp.ts +46 -0
  776. package/model/subAccountDetailsResponsePlanInfoFeatures.ts +7 -0
  777. package/model/subAccountDetailsResponsePlanInfoFeaturesSalesUsers.ts +46 -0
  778. package/model/subAccountDetailsResponsePlanInfoFeaturesUsers.ts +3 -3
  779. package/model/subAccountUpdatePlanRequestCredits.ts +20 -2
  780. package/model/subAccountUpdatePlanRequestFeatures.ts +10 -1
  781. package/model/subAccountsUpdatePlanRequest.ts +51 -0
  782. package/model/subAccountsUpdatePlanRequestCredits.ts +73 -0
  783. package/model/subAccountsUpdatePlanRequestFeatures.ts +55 -0
  784. package/model/subscription.ts +88 -0
  785. package/model/subscriptionAggregateBalance.ts +43 -0
  786. package/model/subscriptionAttributedReward.ts +106 -0
  787. package/model/subscriptionBalances.ts +53 -0
  788. package/model/subscriptionHandlerInfo.ts +65 -0
  789. package/model/subscriptionMember.ts +70 -0
  790. package/model/subscriptionTier.ts +88 -0
  791. package/model/templatePreview.ts +76 -0
  792. package/model/tier.ts +102 -0
  793. package/model/tierAccessConditionsInner.ts +55 -0
  794. package/model/tierForContact.ts +82 -0
  795. package/model/tierGroup.ts +109 -0
  796. package/model/tierGroupPage.ts +32 -0
  797. package/model/tierRequest.ts +57 -0
  798. package/model/tierRequestAccessConditionsInner.ts +43 -0
  799. package/model/tierRequestPutPayload.ts +57 -0
  800. package/model/tierRequestTierRewardsInner.ts +34 -0
  801. package/model/tierTierRewardsInner.ts +46 -0
  802. package/model/transaction.ts +163 -0
  803. package/model/transactionHistory.ts +118 -0
  804. package/model/transactionHistoryResp.ts +74 -0
  805. package/model/unauthorizedResponse.ts +34 -0
  806. package/model/updateAttribute.ts +10 -1
  807. package/model/updateBalanceDefinitionPayload.ts +218 -0
  808. package/model/updateBalanceLimitPayload.ts +98 -0
  809. package/model/updateContact.ts +3 -3
  810. package/model/updateEmailCampaign.ts +7 -0
  811. package/model/updateEmailCampaignEmailExpirationDate.ts +53 -0
  812. package/model/updateEmailCampaignRecipients.ts +9 -0
  813. package/model/updateLoyaltyProgramPayload.ts +52 -0
  814. package/model/updateTierGroupRequest.ts +73 -0
  815. package/package.json +5 -6
  816. package/tsconfig.json +0 -1
@@ -0,0 +1,1725 @@
1
+ /**
2
+ * Brevo API
3
+ * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
4
+ *
5
+ * The version of the OpenAPI document: 3.0.0
6
+ * Contact: contact@brevo.com
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 { Balance } from '../model/balance';
19
+ import { BalanceDefinition } from '../model/balanceDefinition';
20
+ import { BalanceDefinitionPage } from '../model/balanceDefinitionPage';
21
+ import { BalanceLimit } from '../model/balanceLimit';
22
+ import { BalanceOrder } from '../model/balanceOrder';
23
+ import { ContactBalancesResp } from '../model/contactBalancesResp';
24
+ import { CreateBalanceDefinitionPayload } from '../model/createBalanceDefinitionPayload';
25
+ import { CreateBalanceLimitPayload } from '../model/createBalanceLimitPayload';
26
+ import { CreateBalancePayload } from '../model/createBalancePayload';
27
+ import { CreateOrderPayload } from '../model/createOrderPayload';
28
+ import { CreateTransactionPayload } from '../model/createTransactionPayload';
29
+ import { ErrorResponse } from '../model/errorResponse';
30
+ import { ModelSubscriptionBalanceResp } from '../model/modelSubscriptionBalanceResp';
31
+ import { Transaction } from '../model/transaction';
32
+ import { TransactionHistoryResp } from '../model/transactionHistoryResp';
33
+ import { UpdateBalanceDefinitionPayload } from '../model/updateBalanceDefinitionPayload';
34
+ import { UpdateBalanceLimitPayload } from '../model/updateBalanceLimitPayload';
35
+
36
+ import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
37
+ import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
38
+
39
+ import { HttpError, RequestFile } from './apis';
40
+
41
+ let defaultBasePath = 'https://api.brevo.com/v3';
42
+
43
+ // ===============================================
44
+ // This file is autogenerated - Please do not edit
45
+ // ===============================================
46
+
47
+ export enum BalanceApiApiKeys {
48
+ apiKey,
49
+ partnerKey,
50
+ }
51
+
52
+ export class BalanceApi {
53
+ protected _basePath = defaultBasePath;
54
+ protected _defaultHeaders : any = {};
55
+ protected _useQuerystring : boolean = false;
56
+
57
+ protected authentications = {
58
+ 'default': <Authentication>new VoidAuth(),
59
+ 'apiKey': new ApiKeyAuth('header', 'api-key'),
60
+ 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
61
+ }
62
+
63
+ protected interceptors: Interceptor[] = [];
64
+
65
+ constructor(basePath?: string);
66
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
67
+ if (password) {
68
+ if (basePath) {
69
+ this.basePath = basePath;
70
+ }
71
+ } else {
72
+ if (basePathOrUsername) {
73
+ this.basePath = basePathOrUsername
74
+ }
75
+ }
76
+ }
77
+
78
+ set useQuerystring(value: boolean) {
79
+ this._useQuerystring = value;
80
+ }
81
+
82
+ set basePath(basePath: string) {
83
+ this._basePath = basePath;
84
+ }
85
+
86
+ set defaultHeaders(defaultHeaders: any) {
87
+ this._defaultHeaders = defaultHeaders;
88
+ }
89
+
90
+ get defaultHeaders() {
91
+ return this._defaultHeaders;
92
+ }
93
+
94
+ get basePath() {
95
+ return this._basePath;
96
+ }
97
+
98
+ public setDefaultAuthentication(auth: Authentication) {
99
+ this.authentications.default = auth;
100
+ }
101
+
102
+ public setApiKey(key: BalanceApiApiKeys, value: string) {
103
+ (this.authentications as any)[BalanceApiApiKeys[key]].apiKey = value;
104
+ }
105
+
106
+ public addInterceptor(interceptor: Interceptor) {
107
+ this.interceptors.push(interceptor);
108
+ }
109
+
110
+ /**
111
+ * Creates new transaction and returns information
112
+ * @summary Create new transaction
113
+ * @param pid Loyalty Program Id
114
+ * @param body Transaction Payload
115
+ */
116
+ public async beginTransaction (pid: string, body: CreateTransactionPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transaction; }> {
117
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transactions'
118
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
119
+ let localVarQueryParameters: any = {};
120
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
121
+ const produces = ['application/json'];
122
+ // give precedence to 'application/json'
123
+ if (produces.indexOf('application/json') >= 0) {
124
+ localVarHeaderParams.Accept = 'application/json';
125
+ } else {
126
+ localVarHeaderParams.Accept = produces.join(',');
127
+ }
128
+ let localVarFormParams: any = {};
129
+
130
+ // verify required parameter 'pid' is not null or undefined
131
+ if (pid === null || pid === undefined) {
132
+ throw new Error('Required parameter pid was null or undefined when calling beginTransaction.');
133
+ }
134
+
135
+ // verify required parameter 'body' is not null or undefined
136
+ if (body === null || body === undefined) {
137
+ throw new Error('Required parameter body was null or undefined when calling beginTransaction.');
138
+ }
139
+
140
+ (<any>Object).assign(localVarHeaderParams, options.headers);
141
+
142
+ let localVarUseFormData = false;
143
+
144
+ let localVarRequestOptions: localVarRequest.Options = {
145
+ method: 'POST',
146
+ qs: localVarQueryParameters,
147
+ headers: localVarHeaderParams,
148
+ uri: localVarPath,
149
+ useQuerystring: this._useQuerystring,
150
+ json: true,
151
+ body: ObjectSerializer.serialize(body, "CreateTransactionPayload")
152
+ };
153
+
154
+ let authenticationPromise = Promise.resolve();
155
+ if (this.authentications.apiKey.apiKey) {
156
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
157
+ }
158
+ if (this.authentications.partnerKey.apiKey) {
159
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
160
+ }
161
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
162
+
163
+ let interceptorPromise = authenticationPromise;
164
+ for (const interceptor of this.interceptors) {
165
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
166
+ }
167
+
168
+ return interceptorPromise.then(() => {
169
+ if (Object.keys(localVarFormParams).length) {
170
+ if (localVarUseFormData) {
171
+ (<any>localVarRequestOptions).formData = localVarFormParams;
172
+ } else {
173
+ localVarRequestOptions.form = localVarFormParams;
174
+ }
175
+ }
176
+ return new Promise<{ response: http.IncomingMessage; body: Transaction; }>((resolve, reject) => {
177
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
178
+ if (error) {
179
+ reject(error);
180
+ } else {
181
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
182
+ body = ObjectSerializer.deserialize(body, "Transaction");
183
+ resolve({ response: response, body: body });
184
+ } else {
185
+ reject(new HttpError(response, body, response.statusCode));
186
+ }
187
+ }
188
+ });
189
+ });
190
+ });
191
+ }
192
+ /**
193
+ * Cancels transaction
194
+ * @summary Cancel transaction
195
+ * @param pid Loyalty Program Id
196
+ * @param tid Transaction Id
197
+ */
198
+ public async cancelTransaction (pid: string, tid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transaction; }> {
199
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transactions/{tid}/cancel'
200
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
201
+ .replace('{' + 'tid' + '}', encodeURIComponent(String(tid)));
202
+ let localVarQueryParameters: any = {};
203
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
204
+ const produces = ['application/json'];
205
+ // give precedence to 'application/json'
206
+ if (produces.indexOf('application/json') >= 0) {
207
+ localVarHeaderParams.Accept = 'application/json';
208
+ } else {
209
+ localVarHeaderParams.Accept = produces.join(',');
210
+ }
211
+ let localVarFormParams: any = {};
212
+
213
+ // verify required parameter 'pid' is not null or undefined
214
+ if (pid === null || pid === undefined) {
215
+ throw new Error('Required parameter pid was null or undefined when calling cancelTransaction.');
216
+ }
217
+
218
+ // verify required parameter 'tid' is not null or undefined
219
+ if (tid === null || tid === undefined) {
220
+ throw new Error('Required parameter tid was null or undefined when calling cancelTransaction.');
221
+ }
222
+
223
+ (<any>Object).assign(localVarHeaderParams, options.headers);
224
+
225
+ let localVarUseFormData = false;
226
+
227
+ let localVarRequestOptions: localVarRequest.Options = {
228
+ method: 'POST',
229
+ qs: localVarQueryParameters,
230
+ headers: localVarHeaderParams,
231
+ uri: localVarPath,
232
+ useQuerystring: this._useQuerystring,
233
+ json: true,
234
+ };
235
+
236
+ let authenticationPromise = Promise.resolve();
237
+ if (this.authentications.apiKey.apiKey) {
238
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
239
+ }
240
+ if (this.authentications.partnerKey.apiKey) {
241
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
242
+ }
243
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
244
+
245
+ let interceptorPromise = authenticationPromise;
246
+ for (const interceptor of this.interceptors) {
247
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
248
+ }
249
+
250
+ return interceptorPromise.then(() => {
251
+ if (Object.keys(localVarFormParams).length) {
252
+ if (localVarUseFormData) {
253
+ (<any>localVarRequestOptions).formData = localVarFormParams;
254
+ } else {
255
+ localVarRequestOptions.form = localVarFormParams;
256
+ }
257
+ }
258
+ return new Promise<{ response: http.IncomingMessage; body: Transaction; }>((resolve, reject) => {
259
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
260
+ if (error) {
261
+ reject(error);
262
+ } else {
263
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
264
+ body = ObjectSerializer.deserialize(body, "Transaction");
265
+ resolve({ response: response, body: body });
266
+ } else {
267
+ reject(new HttpError(response, body, response.statusCode));
268
+ }
269
+ }
270
+ });
271
+ });
272
+ });
273
+ }
274
+ /**
275
+ * Completes transaction
276
+ * @summary Complete transaction
277
+ * @param pid Loyalty Program Id
278
+ * @param tid Transaction Id
279
+ */
280
+ public async completeTransaction (pid: string, tid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transaction; }> {
281
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transactions/{tid}/complete'
282
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
283
+ .replace('{' + 'tid' + '}', encodeURIComponent(String(tid)));
284
+ let localVarQueryParameters: any = {};
285
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
286
+ const produces = ['application/json'];
287
+ // give precedence to 'application/json'
288
+ if (produces.indexOf('application/json') >= 0) {
289
+ localVarHeaderParams.Accept = 'application/json';
290
+ } else {
291
+ localVarHeaderParams.Accept = produces.join(',');
292
+ }
293
+ let localVarFormParams: any = {};
294
+
295
+ // verify required parameter 'pid' is not null or undefined
296
+ if (pid === null || pid === undefined) {
297
+ throw new Error('Required parameter pid was null or undefined when calling completeTransaction.');
298
+ }
299
+
300
+ // verify required parameter 'tid' is not null or undefined
301
+ if (tid === null || tid === undefined) {
302
+ throw new Error('Required parameter tid was null or undefined when calling completeTransaction.');
303
+ }
304
+
305
+ (<any>Object).assign(localVarHeaderParams, options.headers);
306
+
307
+ let localVarUseFormData = false;
308
+
309
+ let localVarRequestOptions: localVarRequest.Options = {
310
+ method: 'POST',
311
+ qs: localVarQueryParameters,
312
+ headers: localVarHeaderParams,
313
+ uri: localVarPath,
314
+ useQuerystring: this._useQuerystring,
315
+ json: true,
316
+ };
317
+
318
+ let authenticationPromise = Promise.resolve();
319
+ if (this.authentications.apiKey.apiKey) {
320
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
321
+ }
322
+ if (this.authentications.partnerKey.apiKey) {
323
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
324
+ }
325
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
326
+
327
+ let interceptorPromise = authenticationPromise;
328
+ for (const interceptor of this.interceptors) {
329
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
330
+ }
331
+
332
+ return interceptorPromise.then(() => {
333
+ if (Object.keys(localVarFormParams).length) {
334
+ if (localVarUseFormData) {
335
+ (<any>localVarRequestOptions).formData = localVarFormParams;
336
+ } else {
337
+ localVarRequestOptions.form = localVarFormParams;
338
+ }
339
+ }
340
+ return new Promise<{ response: http.IncomingMessage; body: Transaction; }>((resolve, reject) => {
341
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
342
+ if (error) {
343
+ reject(error);
344
+ } else {
345
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
346
+ body = ObjectSerializer.deserialize(body, "Transaction");
347
+ resolve({ response: response, body: body });
348
+ } else {
349
+ reject(new HttpError(response, body, response.statusCode));
350
+ }
351
+ }
352
+ });
353
+ });
354
+ });
355
+ }
356
+ /**
357
+ * Creates balance limit and sends the created UUID along with the data
358
+ * @summary Create balance limits
359
+ * @param pid Loyalty Program Id
360
+ * @param bdid Balance Definition Id
361
+ * @param body Balance Definition Payload
362
+ */
363
+ public async createBalanceLimit (pid: string, bdid: string, body: CreateBalanceLimitPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
364
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits'
365
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
366
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
367
+ let localVarQueryParameters: any = {};
368
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
369
+ const produces = ['application/json'];
370
+ // give precedence to 'application/json'
371
+ if (produces.indexOf('application/json') >= 0) {
372
+ localVarHeaderParams.Accept = 'application/json';
373
+ } else {
374
+ localVarHeaderParams.Accept = produces.join(',');
375
+ }
376
+ let localVarFormParams: any = {};
377
+
378
+ // verify required parameter 'pid' is not null or undefined
379
+ if (pid === null || pid === undefined) {
380
+ throw new Error('Required parameter pid was null or undefined when calling createBalanceLimit.');
381
+ }
382
+
383
+ // verify required parameter 'bdid' is not null or undefined
384
+ if (bdid === null || bdid === undefined) {
385
+ throw new Error('Required parameter bdid was null or undefined when calling createBalanceLimit.');
386
+ }
387
+
388
+ // verify required parameter 'body' is not null or undefined
389
+ if (body === null || body === undefined) {
390
+ throw new Error('Required parameter body was null or undefined when calling createBalanceLimit.');
391
+ }
392
+
393
+ (<any>Object).assign(localVarHeaderParams, options.headers);
394
+
395
+ let localVarUseFormData = false;
396
+
397
+ let localVarRequestOptions: localVarRequest.Options = {
398
+ method: 'POST',
399
+ qs: localVarQueryParameters,
400
+ headers: localVarHeaderParams,
401
+ uri: localVarPath,
402
+ useQuerystring: this._useQuerystring,
403
+ json: true,
404
+ body: ObjectSerializer.serialize(body, "CreateBalanceLimitPayload")
405
+ };
406
+
407
+ let authenticationPromise = Promise.resolve();
408
+ if (this.authentications.apiKey.apiKey) {
409
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
410
+ }
411
+ if (this.authentications.partnerKey.apiKey) {
412
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
413
+ }
414
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
415
+
416
+ let interceptorPromise = authenticationPromise;
417
+ for (const interceptor of this.interceptors) {
418
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
419
+ }
420
+
421
+ return interceptorPromise.then(() => {
422
+ if (Object.keys(localVarFormParams).length) {
423
+ if (localVarUseFormData) {
424
+ (<any>localVarRequestOptions).formData = localVarFormParams;
425
+ } else {
426
+ localVarRequestOptions.form = localVarFormParams;
427
+ }
428
+ }
429
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
430
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
431
+ if (error) {
432
+ reject(error);
433
+ } else {
434
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
435
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
436
+ resolve({ response: response, body: body });
437
+ } else {
438
+ reject(new HttpError(response, body, response.statusCode));
439
+ }
440
+ }
441
+ });
442
+ });
443
+ });
444
+ }
445
+ /**
446
+ * Returns created order
447
+ * @summary Create balance order
448
+ * @param pid Loyalty Program Id
449
+ * @param body Order Payload
450
+ */
451
+ public async createBalanceOrder (pid: string, body: CreateOrderPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceOrder; }> {
452
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/create-order'
453
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
454
+ let localVarQueryParameters: any = {};
455
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
456
+ const produces = ['application/json'];
457
+ // give precedence to 'application/json'
458
+ if (produces.indexOf('application/json') >= 0) {
459
+ localVarHeaderParams.Accept = 'application/json';
460
+ } else {
461
+ localVarHeaderParams.Accept = produces.join(',');
462
+ }
463
+ let localVarFormParams: any = {};
464
+
465
+ // verify required parameter 'pid' is not null or undefined
466
+ if (pid === null || pid === undefined) {
467
+ throw new Error('Required parameter pid was null or undefined when calling createBalanceOrder.');
468
+ }
469
+
470
+ // verify required parameter 'body' is not null or undefined
471
+ if (body === null || body === undefined) {
472
+ throw new Error('Required parameter body was null or undefined when calling createBalanceOrder.');
473
+ }
474
+
475
+ (<any>Object).assign(localVarHeaderParams, options.headers);
476
+
477
+ let localVarUseFormData = false;
478
+
479
+ let localVarRequestOptions: localVarRequest.Options = {
480
+ method: 'POST',
481
+ qs: localVarQueryParameters,
482
+ headers: localVarHeaderParams,
483
+ uri: localVarPath,
484
+ useQuerystring: this._useQuerystring,
485
+ json: true,
486
+ body: ObjectSerializer.serialize(body, "CreateOrderPayload")
487
+ };
488
+
489
+ let authenticationPromise = Promise.resolve();
490
+ if (this.authentications.apiKey.apiKey) {
491
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
492
+ }
493
+ if (this.authentications.partnerKey.apiKey) {
494
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
495
+ }
496
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
497
+
498
+ let interceptorPromise = authenticationPromise;
499
+ for (const interceptor of this.interceptors) {
500
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
501
+ }
502
+
503
+ return interceptorPromise.then(() => {
504
+ if (Object.keys(localVarFormParams).length) {
505
+ if (localVarUseFormData) {
506
+ (<any>localVarRequestOptions).formData = localVarFormParams;
507
+ } else {
508
+ localVarRequestOptions.form = localVarFormParams;
509
+ }
510
+ }
511
+ return new Promise<{ response: http.IncomingMessage; body: BalanceOrder; }>((resolve, reject) => {
512
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
513
+ if (error) {
514
+ reject(error);
515
+ } else {
516
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
517
+ body = ObjectSerializer.deserialize(body, "BalanceOrder");
518
+ resolve({ response: response, body: body });
519
+ } else {
520
+ reject(new HttpError(response, body, response.statusCode));
521
+ }
522
+ }
523
+ });
524
+ });
525
+ });
526
+ }
527
+ /**
528
+ * Delete Balance definition
529
+ * @summary Delete balance definition
530
+ * @param pid Loyalty Program Id
531
+ * @param bdid Balance Definition Id
532
+ */
533
+ public async deleteBalanceDefinition (pid: string, bdid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
534
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'
535
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
536
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
537
+ let localVarQueryParameters: any = {};
538
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
539
+ const produces = ['application/json'];
540
+ // give precedence to 'application/json'
541
+ if (produces.indexOf('application/json') >= 0) {
542
+ localVarHeaderParams.Accept = 'application/json';
543
+ } else {
544
+ localVarHeaderParams.Accept = produces.join(',');
545
+ }
546
+ let localVarFormParams: any = {};
547
+
548
+ // verify required parameter 'pid' is not null or undefined
549
+ if (pid === null || pid === undefined) {
550
+ throw new Error('Required parameter pid was null or undefined when calling deleteBalanceDefinition.');
551
+ }
552
+
553
+ // verify required parameter 'bdid' is not null or undefined
554
+ if (bdid === null || bdid === undefined) {
555
+ throw new Error('Required parameter bdid was null or undefined when calling deleteBalanceDefinition.');
556
+ }
557
+
558
+ (<any>Object).assign(localVarHeaderParams, options.headers);
559
+
560
+ let localVarUseFormData = false;
561
+
562
+ let localVarRequestOptions: localVarRequest.Options = {
563
+ method: 'DELETE',
564
+ qs: localVarQueryParameters,
565
+ headers: localVarHeaderParams,
566
+ uri: localVarPath,
567
+ useQuerystring: this._useQuerystring,
568
+ json: true,
569
+ };
570
+
571
+ let authenticationPromise = Promise.resolve();
572
+ if (this.authentications.apiKey.apiKey) {
573
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
574
+ }
575
+ if (this.authentications.partnerKey.apiKey) {
576
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
577
+ }
578
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
579
+
580
+ let interceptorPromise = authenticationPromise;
581
+ for (const interceptor of this.interceptors) {
582
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
583
+ }
584
+
585
+ return interceptorPromise.then(() => {
586
+ if (Object.keys(localVarFormParams).length) {
587
+ if (localVarUseFormData) {
588
+ (<any>localVarRequestOptions).formData = localVarFormParams;
589
+ } else {
590
+ localVarRequestOptions.form = localVarFormParams;
591
+ }
592
+ }
593
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
594
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
595
+ if (error) {
596
+ reject(error);
597
+ } else {
598
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
599
+ resolve({ response: response, body: body });
600
+ } else {
601
+ reject(new HttpError(response, body, response.statusCode));
602
+ }
603
+ }
604
+ });
605
+ });
606
+ });
607
+ }
608
+ /**
609
+ * Delete balance limit
610
+ * @summary Delete balance limit
611
+ * @param pid Loyalty Program Id
612
+ * @param bdid Balance Definition Id
613
+ * @param blid Balance Limit Id
614
+ */
615
+ public async deleteBalanceLimit (pid: string, bdid: string, blid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
616
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'
617
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
618
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)))
619
+ .replace('{' + 'blid' + '}', encodeURIComponent(String(blid)));
620
+ let localVarQueryParameters: any = {};
621
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
622
+ const produces = ['application/json'];
623
+ // give precedence to 'application/json'
624
+ if (produces.indexOf('application/json') >= 0) {
625
+ localVarHeaderParams.Accept = 'application/json';
626
+ } else {
627
+ localVarHeaderParams.Accept = produces.join(',');
628
+ }
629
+ let localVarFormParams: any = {};
630
+
631
+ // verify required parameter 'pid' is not null or undefined
632
+ if (pid === null || pid === undefined) {
633
+ throw new Error('Required parameter pid was null or undefined when calling deleteBalanceLimit.');
634
+ }
635
+
636
+ // verify required parameter 'bdid' is not null or undefined
637
+ if (bdid === null || bdid === undefined) {
638
+ throw new Error('Required parameter bdid was null or undefined when calling deleteBalanceLimit.');
639
+ }
640
+
641
+ // verify required parameter 'blid' is not null or undefined
642
+ if (blid === null || blid === undefined) {
643
+ throw new Error('Required parameter blid was null or undefined when calling deleteBalanceLimit.');
644
+ }
645
+
646
+ (<any>Object).assign(localVarHeaderParams, options.headers);
647
+
648
+ let localVarUseFormData = false;
649
+
650
+ let localVarRequestOptions: localVarRequest.Options = {
651
+ method: 'DELETE',
652
+ qs: localVarQueryParameters,
653
+ headers: localVarHeaderParams,
654
+ uri: localVarPath,
655
+ useQuerystring: this._useQuerystring,
656
+ json: true,
657
+ };
658
+
659
+ let authenticationPromise = Promise.resolve();
660
+ if (this.authentications.apiKey.apiKey) {
661
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
662
+ }
663
+ if (this.authentications.partnerKey.apiKey) {
664
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
665
+ }
666
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
667
+
668
+ let interceptorPromise = authenticationPromise;
669
+ for (const interceptor of this.interceptors) {
670
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
671
+ }
672
+
673
+ return interceptorPromise.then(() => {
674
+ if (Object.keys(localVarFormParams).length) {
675
+ if (localVarUseFormData) {
676
+ (<any>localVarRequestOptions).formData = localVarFormParams;
677
+ } else {
678
+ localVarRequestOptions.form = localVarFormParams;
679
+ }
680
+ }
681
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
682
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
683
+ if (error) {
684
+ reject(error);
685
+ } else {
686
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
687
+ resolve({ response: response, body: body });
688
+ } else {
689
+ reject(new HttpError(response, body, response.statusCode));
690
+ }
691
+ }
692
+ });
693
+ });
694
+ });
695
+ }
696
+ /**
697
+ * Returns balance definition
698
+ * @summary Get balance definition
699
+ * @param pid Loyalty Program Id
700
+ * @param bdid Balance Definition Id
701
+ * @param version Version
702
+ */
703
+ public async getBalanceDefinition (pid: string, bdid: string, version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }> {
704
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'
705
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
706
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
707
+ let localVarQueryParameters: any = {};
708
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
709
+ const produces = ['application/json'];
710
+ // give precedence to 'application/json'
711
+ if (produces.indexOf('application/json') >= 0) {
712
+ localVarHeaderParams.Accept = 'application/json';
713
+ } else {
714
+ localVarHeaderParams.Accept = produces.join(',');
715
+ }
716
+ let localVarFormParams: any = {};
717
+
718
+ // verify required parameter 'pid' is not null or undefined
719
+ if (pid === null || pid === undefined) {
720
+ throw new Error('Required parameter pid was null or undefined when calling getBalanceDefinition.');
721
+ }
722
+
723
+ // verify required parameter 'bdid' is not null or undefined
724
+ if (bdid === null || bdid === undefined) {
725
+ throw new Error('Required parameter bdid was null or undefined when calling getBalanceDefinition.');
726
+ }
727
+
728
+ if (version !== undefined) {
729
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
730
+ }
731
+
732
+ (<any>Object).assign(localVarHeaderParams, options.headers);
733
+
734
+ let localVarUseFormData = false;
735
+
736
+ let localVarRequestOptions: localVarRequest.Options = {
737
+ method: 'GET',
738
+ qs: localVarQueryParameters,
739
+ headers: localVarHeaderParams,
740
+ uri: localVarPath,
741
+ useQuerystring: this._useQuerystring,
742
+ json: true,
743
+ };
744
+
745
+ let authenticationPromise = Promise.resolve();
746
+ if (this.authentications.apiKey.apiKey) {
747
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
748
+ }
749
+ if (this.authentications.partnerKey.apiKey) {
750
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
751
+ }
752
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
753
+
754
+ let interceptorPromise = authenticationPromise;
755
+ for (const interceptor of this.interceptors) {
756
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
757
+ }
758
+
759
+ return interceptorPromise.then(() => {
760
+ if (Object.keys(localVarFormParams).length) {
761
+ if (localVarUseFormData) {
762
+ (<any>localVarRequestOptions).formData = localVarFormParams;
763
+ } else {
764
+ localVarRequestOptions.form = localVarFormParams;
765
+ }
766
+ }
767
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }>((resolve, reject) => {
768
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
769
+ if (error) {
770
+ reject(error);
771
+ } else {
772
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
773
+ body = ObjectSerializer.deserialize(body, "BalanceDefinition");
774
+ resolve({ response: response, body: body });
775
+ } else {
776
+ reject(new HttpError(response, body, response.statusCode));
777
+ }
778
+ }
779
+ });
780
+ });
781
+ });
782
+ }
783
+ /**
784
+ * Returns balance definition page
785
+ * @summary Get balance definition list
786
+ * @param pid Loyalty Program Id
787
+ * @param limit Limit the number of records returned
788
+ * @param offset Offset to paginate records
789
+ * @param sortField Field to sort by
790
+ * @param sort Sort direction
791
+ * @param version Version
792
+ */
793
+ public async getBalanceDefinitionList (pid: string, limit?: number, offset?: number, sortField?: 'name' | 'created_at' | 'updated_at', sort?: 'asc' | 'desc', version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinitionPage; }> {
794
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions'
795
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
796
+ let localVarQueryParameters: any = {};
797
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
798
+ const produces = ['application/json'];
799
+ // give precedence to 'application/json'
800
+ if (produces.indexOf('application/json') >= 0) {
801
+ localVarHeaderParams.Accept = 'application/json';
802
+ } else {
803
+ localVarHeaderParams.Accept = produces.join(',');
804
+ }
805
+ let localVarFormParams: any = {};
806
+
807
+ // verify required parameter 'pid' is not null or undefined
808
+ if (pid === null || pid === undefined) {
809
+ throw new Error('Required parameter pid was null or undefined when calling getBalanceDefinitionList.');
810
+ }
811
+
812
+ if (limit !== undefined) {
813
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
814
+ }
815
+
816
+ if (offset !== undefined) {
817
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
818
+ }
819
+
820
+ if (sortField !== undefined) {
821
+ localVarQueryParameters['sortField'] = ObjectSerializer.serialize(sortField, "'name' | 'created_at' | 'updated_at'");
822
+ }
823
+
824
+ if (sort !== undefined) {
825
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'");
826
+ }
827
+
828
+ if (version !== undefined) {
829
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
830
+ }
831
+
832
+ (<any>Object).assign(localVarHeaderParams, options.headers);
833
+
834
+ let localVarUseFormData = false;
835
+
836
+ let localVarRequestOptions: localVarRequest.Options = {
837
+ method: 'GET',
838
+ qs: localVarQueryParameters,
839
+ headers: localVarHeaderParams,
840
+ uri: localVarPath,
841
+ useQuerystring: this._useQuerystring,
842
+ json: true,
843
+ };
844
+
845
+ let authenticationPromise = Promise.resolve();
846
+ if (this.authentications.apiKey.apiKey) {
847
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
848
+ }
849
+ if (this.authentications.partnerKey.apiKey) {
850
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
851
+ }
852
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
853
+
854
+ let interceptorPromise = authenticationPromise;
855
+ for (const interceptor of this.interceptors) {
856
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
857
+ }
858
+
859
+ return interceptorPromise.then(() => {
860
+ if (Object.keys(localVarFormParams).length) {
861
+ if (localVarUseFormData) {
862
+ (<any>localVarRequestOptions).formData = localVarFormParams;
863
+ } else {
864
+ localVarRequestOptions.form = localVarFormParams;
865
+ }
866
+ }
867
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinitionPage; }>((resolve, reject) => {
868
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
869
+ if (error) {
870
+ reject(error);
871
+ } else {
872
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
873
+ body = ObjectSerializer.deserialize(body, "BalanceDefinitionPage");
874
+ resolve({ response: response, body: body });
875
+ } else {
876
+ reject(new HttpError(response, body, response.statusCode));
877
+ }
878
+ }
879
+ });
880
+ });
881
+ });
882
+ }
883
+ /**
884
+ * Fetches balance limits and send the created UUID along with the data
885
+ * @summary Get balance limits
886
+ * @param pid Loyalty Program Id
887
+ * @param bdid Balance Definition Id
888
+ * @param blid Balance Limit Id
889
+ * @param version Version
890
+ */
891
+ public async getBalanceLimit (pid: string, bdid: string, blid: string, version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
892
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'
893
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
894
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)))
895
+ .replace('{' + 'blid' + '}', encodeURIComponent(String(blid)));
896
+ let localVarQueryParameters: any = {};
897
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
898
+ const produces = ['application/json'];
899
+ // give precedence to 'application/json'
900
+ if (produces.indexOf('application/json') >= 0) {
901
+ localVarHeaderParams.Accept = 'application/json';
902
+ } else {
903
+ localVarHeaderParams.Accept = produces.join(',');
904
+ }
905
+ let localVarFormParams: any = {};
906
+
907
+ // verify required parameter 'pid' is not null or undefined
908
+ if (pid === null || pid === undefined) {
909
+ throw new Error('Required parameter pid was null or undefined when calling getBalanceLimit.');
910
+ }
911
+
912
+ // verify required parameter 'bdid' is not null or undefined
913
+ if (bdid === null || bdid === undefined) {
914
+ throw new Error('Required parameter bdid was null or undefined when calling getBalanceLimit.');
915
+ }
916
+
917
+ // verify required parameter 'blid' is not null or undefined
918
+ if (blid === null || blid === undefined) {
919
+ throw new Error('Required parameter blid was null or undefined when calling getBalanceLimit.');
920
+ }
921
+
922
+ if (version !== undefined) {
923
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
924
+ }
925
+
926
+ (<any>Object).assign(localVarHeaderParams, options.headers);
927
+
928
+ let localVarUseFormData = false;
929
+
930
+ let localVarRequestOptions: localVarRequest.Options = {
931
+ method: 'GET',
932
+ qs: localVarQueryParameters,
933
+ headers: localVarHeaderParams,
934
+ uri: localVarPath,
935
+ useQuerystring: this._useQuerystring,
936
+ json: true,
937
+ };
938
+
939
+ let authenticationPromise = Promise.resolve();
940
+ if (this.authentications.apiKey.apiKey) {
941
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
942
+ }
943
+ if (this.authentications.partnerKey.apiKey) {
944
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
945
+ }
946
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
947
+
948
+ let interceptorPromise = authenticationPromise;
949
+ for (const interceptor of this.interceptors) {
950
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
951
+ }
952
+
953
+ return interceptorPromise.then(() => {
954
+ if (Object.keys(localVarFormParams).length) {
955
+ if (localVarUseFormData) {
956
+ (<any>localVarRequestOptions).formData = localVarFormParams;
957
+ } else {
958
+ localVarRequestOptions.form = localVarFormParams;
959
+ }
960
+ }
961
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
962
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
963
+ if (error) {
964
+ reject(error);
965
+ } else {
966
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
967
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
968
+ resolve({ response: response, body: body });
969
+ } else {
970
+ reject(new HttpError(response, body, response.statusCode));
971
+ }
972
+ }
973
+ });
974
+ });
975
+ });
976
+ }
977
+ /**
978
+ * Returns balance list
979
+ * @summary Get balance list
980
+ * @param pid Loyalty Program Id
981
+ */
982
+ public async getContactBalances (pid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ContactBalancesResp; }> {
983
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/contact-balances'
984
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
985
+ let localVarQueryParameters: any = {};
986
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
987
+ const produces = ['application/json'];
988
+ // give precedence to 'application/json'
989
+ if (produces.indexOf('application/json') >= 0) {
990
+ localVarHeaderParams.Accept = 'application/json';
991
+ } else {
992
+ localVarHeaderParams.Accept = produces.join(',');
993
+ }
994
+ let localVarFormParams: any = {};
995
+
996
+ // verify required parameter 'pid' is not null or undefined
997
+ if (pid === null || pid === undefined) {
998
+ throw new Error('Required parameter pid was null or undefined when calling getContactBalances.');
999
+ }
1000
+
1001
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1002
+
1003
+ let localVarUseFormData = false;
1004
+
1005
+ let localVarRequestOptions: localVarRequest.Options = {
1006
+ method: 'GET',
1007
+ qs: localVarQueryParameters,
1008
+ headers: localVarHeaderParams,
1009
+ uri: localVarPath,
1010
+ useQuerystring: this._useQuerystring,
1011
+ json: true,
1012
+ };
1013
+
1014
+ let authenticationPromise = Promise.resolve();
1015
+ if (this.authentications.apiKey.apiKey) {
1016
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1017
+ }
1018
+ if (this.authentications.partnerKey.apiKey) {
1019
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1020
+ }
1021
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1022
+
1023
+ let interceptorPromise = authenticationPromise;
1024
+ for (const interceptor of this.interceptors) {
1025
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1026
+ }
1027
+
1028
+ return interceptorPromise.then(() => {
1029
+ if (Object.keys(localVarFormParams).length) {
1030
+ if (localVarUseFormData) {
1031
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1032
+ } else {
1033
+ localVarRequestOptions.form = localVarFormParams;
1034
+ }
1035
+ }
1036
+ return new Promise<{ response: http.IncomingMessage; body: ContactBalancesResp; }>((resolve, reject) => {
1037
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1038
+ if (error) {
1039
+ reject(error);
1040
+ } else {
1041
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1042
+ body = ObjectSerializer.deserialize(body, "ContactBalancesResp");
1043
+ resolve({ response: response, body: body });
1044
+ } else {
1045
+ reject(new HttpError(response, body, response.statusCode));
1046
+ }
1047
+ }
1048
+ });
1049
+ });
1050
+ });
1051
+ }
1052
+ /**
1053
+ * Returns subscription balances
1054
+ * @summary Get subscription balances
1055
+ * @param cid Contact Id
1056
+ * @param pid Loyalty Program Id
1057
+ */
1058
+ public async getSubscriptionBalances (cid: number, pid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ModelSubscriptionBalanceResp; }> {
1059
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances'
1060
+ .replace('{' + 'cid' + '}', encodeURIComponent(String(cid)))
1061
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
1062
+ let localVarQueryParameters: any = {};
1063
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1064
+ const produces = ['application/json'];
1065
+ // give precedence to 'application/json'
1066
+ if (produces.indexOf('application/json') >= 0) {
1067
+ localVarHeaderParams.Accept = 'application/json';
1068
+ } else {
1069
+ localVarHeaderParams.Accept = produces.join(',');
1070
+ }
1071
+ let localVarFormParams: any = {};
1072
+
1073
+ // verify required parameter 'cid' is not null or undefined
1074
+ if (cid === null || cid === undefined) {
1075
+ throw new Error('Required parameter cid was null or undefined when calling getSubscriptionBalances.');
1076
+ }
1077
+
1078
+ // verify required parameter 'pid' is not null or undefined
1079
+ if (pid === null || pid === undefined) {
1080
+ throw new Error('Required parameter pid was null or undefined when calling getSubscriptionBalances.');
1081
+ }
1082
+
1083
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1084
+
1085
+ let localVarUseFormData = false;
1086
+
1087
+ let localVarRequestOptions: localVarRequest.Options = {
1088
+ method: 'GET',
1089
+ qs: localVarQueryParameters,
1090
+ headers: localVarHeaderParams,
1091
+ uri: localVarPath,
1092
+ useQuerystring: this._useQuerystring,
1093
+ json: true,
1094
+ };
1095
+
1096
+ let authenticationPromise = Promise.resolve();
1097
+ if (this.authentications.apiKey.apiKey) {
1098
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1099
+ }
1100
+ if (this.authentications.partnerKey.apiKey) {
1101
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1102
+ }
1103
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1104
+
1105
+ let interceptorPromise = authenticationPromise;
1106
+ for (const interceptor of this.interceptors) {
1107
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1108
+ }
1109
+
1110
+ return interceptorPromise.then(() => {
1111
+ if (Object.keys(localVarFormParams).length) {
1112
+ if (localVarUseFormData) {
1113
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1114
+ } else {
1115
+ localVarRequestOptions.form = localVarFormParams;
1116
+ }
1117
+ }
1118
+ return new Promise<{ response: http.IncomingMessage; body: ModelSubscriptionBalanceResp; }>((resolve, reject) => {
1119
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1120
+ if (error) {
1121
+ reject(error);
1122
+ } else {
1123
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1124
+ body = ObjectSerializer.deserialize(body, "ModelSubscriptionBalanceResp");
1125
+ resolve({ response: response, body: body });
1126
+ } else {
1127
+ reject(new HttpError(response, body, response.statusCode));
1128
+ }
1129
+ }
1130
+ });
1131
+ });
1132
+ });
1133
+ }
1134
+ /**
1135
+ * Returns Active Balances
1136
+ * @summary Get Active Balances API
1137
+ * @param pid Loyalty Program Id
1138
+ * @param contactId Contact ID
1139
+ * @param balanceDefinitionId Balance Definition ID
1140
+ * @param limit Limit
1141
+ * @param offset Offset
1142
+ * @param sortField Sort Field
1143
+ * @param sort Sort Order
1144
+ */
1145
+ public async loyaltyBalanceProgramsPidActiveBalanceGet (pid: string, contactId: number, balanceDefinitionId: string, limit?: number, offset?: number, sortField?: string, sort?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
1146
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/active-balance'
1147
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
1148
+ let localVarQueryParameters: any = {};
1149
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1150
+ const produces = ['application/json'];
1151
+ // give precedence to 'application/json'
1152
+ if (produces.indexOf('application/json') >= 0) {
1153
+ localVarHeaderParams.Accept = 'application/json';
1154
+ } else {
1155
+ localVarHeaderParams.Accept = produces.join(',');
1156
+ }
1157
+ let localVarFormParams: any = {};
1158
+
1159
+ // verify required parameter 'pid' is not null or undefined
1160
+ if (pid === null || pid === undefined) {
1161
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidActiveBalanceGet.');
1162
+ }
1163
+
1164
+ // verify required parameter 'contactId' is not null or undefined
1165
+ if (contactId === null || contactId === undefined) {
1166
+ throw new Error('Required parameter contactId was null or undefined when calling loyaltyBalanceProgramsPidActiveBalanceGet.');
1167
+ }
1168
+
1169
+ // verify required parameter 'balanceDefinitionId' is not null or undefined
1170
+ if (balanceDefinitionId === null || balanceDefinitionId === undefined) {
1171
+ throw new Error('Required parameter balanceDefinitionId was null or undefined when calling loyaltyBalanceProgramsPidActiveBalanceGet.');
1172
+ }
1173
+
1174
+ if (limit !== undefined) {
1175
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
1176
+ }
1177
+
1178
+ if (offset !== undefined) {
1179
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
1180
+ }
1181
+
1182
+ if (sortField !== undefined) {
1183
+ localVarQueryParameters['sort_field'] = ObjectSerializer.serialize(sortField, "string");
1184
+ }
1185
+
1186
+ if (sort !== undefined) {
1187
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "string");
1188
+ }
1189
+
1190
+ if (contactId !== undefined) {
1191
+ localVarQueryParameters['contact_id'] = ObjectSerializer.serialize(contactId, "number");
1192
+ }
1193
+
1194
+ if (balanceDefinitionId !== undefined) {
1195
+ localVarQueryParameters['balance_definition_id'] = ObjectSerializer.serialize(balanceDefinitionId, "string");
1196
+ }
1197
+
1198
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1199
+
1200
+ let localVarUseFormData = false;
1201
+
1202
+ let localVarRequestOptions: localVarRequest.Options = {
1203
+ method: 'GET',
1204
+ qs: localVarQueryParameters,
1205
+ headers: localVarHeaderParams,
1206
+ uri: localVarPath,
1207
+ useQuerystring: this._useQuerystring,
1208
+ json: true,
1209
+ };
1210
+
1211
+ let authenticationPromise = Promise.resolve();
1212
+ if (this.authentications.apiKey.apiKey) {
1213
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1214
+ }
1215
+ if (this.authentications.partnerKey.apiKey) {
1216
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1217
+ }
1218
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1219
+
1220
+ let interceptorPromise = authenticationPromise;
1221
+ for (const interceptor of this.interceptors) {
1222
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1223
+ }
1224
+
1225
+ return interceptorPromise.then(() => {
1226
+ if (Object.keys(localVarFormParams).length) {
1227
+ if (localVarUseFormData) {
1228
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1229
+ } else {
1230
+ localVarRequestOptions.form = localVarFormParams;
1231
+ }
1232
+ }
1233
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
1234
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1235
+ if (error) {
1236
+ reject(error);
1237
+ } else {
1238
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1239
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
1240
+ resolve({ response: response, body: body });
1241
+ } else {
1242
+ reject(new HttpError(response, body, response.statusCode));
1243
+ }
1244
+ }
1245
+ });
1246
+ });
1247
+ });
1248
+ }
1249
+ /**
1250
+ * Creates balance definition and returns information
1251
+ * @summary Create balance definition
1252
+ * @param pid Loyalty Program Id
1253
+ * @param body Create Balance Definition Payload
1254
+ */
1255
+ public async loyaltyBalanceProgramsPidBalanceDefinitionsPost (pid: string, body: CreateBalanceDefinitionPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }> {
1256
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions'
1257
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
1258
+ let localVarQueryParameters: any = {};
1259
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1260
+ const produces = ['application/json'];
1261
+ // give precedence to 'application/json'
1262
+ if (produces.indexOf('application/json') >= 0) {
1263
+ localVarHeaderParams.Accept = 'application/json';
1264
+ } else {
1265
+ localVarHeaderParams.Accept = produces.join(',');
1266
+ }
1267
+ let localVarFormParams: any = {};
1268
+
1269
+ // verify required parameter 'pid' is not null or undefined
1270
+ if (pid === null || pid === undefined) {
1271
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidBalanceDefinitionsPost.');
1272
+ }
1273
+
1274
+ // verify required parameter 'body' is not null or undefined
1275
+ if (body === null || body === undefined) {
1276
+ throw new Error('Required parameter body was null or undefined when calling loyaltyBalanceProgramsPidBalanceDefinitionsPost.');
1277
+ }
1278
+
1279
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1280
+
1281
+ let localVarUseFormData = false;
1282
+
1283
+ let localVarRequestOptions: localVarRequest.Options = {
1284
+ method: 'POST',
1285
+ qs: localVarQueryParameters,
1286
+ headers: localVarHeaderParams,
1287
+ uri: localVarPath,
1288
+ useQuerystring: this._useQuerystring,
1289
+ json: true,
1290
+ body: ObjectSerializer.serialize(body, "CreateBalanceDefinitionPayload")
1291
+ };
1292
+
1293
+ let authenticationPromise = Promise.resolve();
1294
+ if (this.authentications.apiKey.apiKey) {
1295
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1296
+ }
1297
+ if (this.authentications.partnerKey.apiKey) {
1298
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1299
+ }
1300
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1301
+
1302
+ let interceptorPromise = authenticationPromise;
1303
+ for (const interceptor of this.interceptors) {
1304
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1305
+ }
1306
+
1307
+ return interceptorPromise.then(() => {
1308
+ if (Object.keys(localVarFormParams).length) {
1309
+ if (localVarUseFormData) {
1310
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1311
+ } else {
1312
+ localVarRequestOptions.form = localVarFormParams;
1313
+ }
1314
+ }
1315
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }>((resolve, reject) => {
1316
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1317
+ if (error) {
1318
+ reject(error);
1319
+ } else {
1320
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1321
+ body = ObjectSerializer.deserialize(body, "BalanceDefinition");
1322
+ resolve({ response: response, body: body });
1323
+ } else {
1324
+ reject(new HttpError(response, body, response.statusCode));
1325
+ }
1326
+ }
1327
+ });
1328
+ });
1329
+ });
1330
+ }
1331
+ /**
1332
+ * Creates a balance for a contact
1333
+ * @summary Create subscription balances
1334
+ * @param pid Loyalty Program Id
1335
+ * @param cid Contact Id
1336
+ * @param body Create Balnce Payload
1337
+ */
1338
+ public async loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost (pid: string, cid: number, body: CreateBalancePayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Balance; }> {
1339
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances'
1340
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
1341
+ .replace('{' + 'cid' + '}', encodeURIComponent(String(cid)));
1342
+ let localVarQueryParameters: any = {};
1343
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1344
+ const produces = ['application/json'];
1345
+ // give precedence to 'application/json'
1346
+ if (produces.indexOf('application/json') >= 0) {
1347
+ localVarHeaderParams.Accept = 'application/json';
1348
+ } else {
1349
+ localVarHeaderParams.Accept = produces.join(',');
1350
+ }
1351
+ let localVarFormParams: any = {};
1352
+
1353
+ // verify required parameter 'pid' is not null or undefined
1354
+ if (pid === null || pid === undefined) {
1355
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost.');
1356
+ }
1357
+
1358
+ // verify required parameter 'cid' is not null or undefined
1359
+ if (cid === null || cid === undefined) {
1360
+ throw new Error('Required parameter cid was null or undefined when calling loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost.');
1361
+ }
1362
+
1363
+ // verify required parameter 'body' is not null or undefined
1364
+ if (body === null || body === undefined) {
1365
+ throw new Error('Required parameter body was null or undefined when calling loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost.');
1366
+ }
1367
+
1368
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1369
+
1370
+ let localVarUseFormData = false;
1371
+
1372
+ let localVarRequestOptions: localVarRequest.Options = {
1373
+ method: 'POST',
1374
+ qs: localVarQueryParameters,
1375
+ headers: localVarHeaderParams,
1376
+ uri: localVarPath,
1377
+ useQuerystring: this._useQuerystring,
1378
+ json: true,
1379
+ body: ObjectSerializer.serialize(body, "CreateBalancePayload")
1380
+ };
1381
+
1382
+ let authenticationPromise = Promise.resolve();
1383
+ if (this.authentications.apiKey.apiKey) {
1384
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1385
+ }
1386
+ if (this.authentications.partnerKey.apiKey) {
1387
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1388
+ }
1389
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1390
+
1391
+ let interceptorPromise = authenticationPromise;
1392
+ for (const interceptor of this.interceptors) {
1393
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1394
+ }
1395
+
1396
+ return interceptorPromise.then(() => {
1397
+ if (Object.keys(localVarFormParams).length) {
1398
+ if (localVarUseFormData) {
1399
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1400
+ } else {
1401
+ localVarRequestOptions.form = localVarFormParams;
1402
+ }
1403
+ }
1404
+ return new Promise<{ response: http.IncomingMessage; body: Balance; }>((resolve, reject) => {
1405
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1406
+ if (error) {
1407
+ reject(error);
1408
+ } else {
1409
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1410
+ body = ObjectSerializer.deserialize(body, "Balance");
1411
+ resolve({ response: response, body: body });
1412
+ } else {
1413
+ reject(new HttpError(response, body, response.statusCode));
1414
+ }
1415
+ }
1416
+ });
1417
+ });
1418
+ });
1419
+ }
1420
+ /**
1421
+ * Returns transaction history
1422
+ * @summary Get Transaction History API
1423
+ * @param pid Loyalty Program Id
1424
+ * @param contactId Contact ID
1425
+ * @param balanceDefinitionId Balance Definition ID
1426
+ * @param limit Limit the number of records returned
1427
+ * @param offset Skip a number of records
1428
+ * @param sortField Field to sort by
1429
+ * @param sort Sort order, either asc or desc
1430
+ * @param filters Filters to apply
1431
+ */
1432
+ public async loyaltyBalanceProgramsPidTransactionHistoryGet (pid: string, contactId: number, balanceDefinitionId: string, limit?: number, offset?: number, sortField?: 'name' | 'created_at' | 'updated_at', sort?: 'asc' | 'desc', filters?: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TransactionHistoryResp; }> {
1433
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transaction-history'
1434
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
1435
+ let localVarQueryParameters: any = {};
1436
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1437
+ const produces = ['application/json'];
1438
+ // give precedence to 'application/json'
1439
+ if (produces.indexOf('application/json') >= 0) {
1440
+ localVarHeaderParams.Accept = 'application/json';
1441
+ } else {
1442
+ localVarHeaderParams.Accept = produces.join(',');
1443
+ }
1444
+ let localVarFormParams: any = {};
1445
+
1446
+ // verify required parameter 'pid' is not null or undefined
1447
+ if (pid === null || pid === undefined) {
1448
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidTransactionHistoryGet.');
1449
+ }
1450
+
1451
+ // verify required parameter 'contactId' is not null or undefined
1452
+ if (contactId === null || contactId === undefined) {
1453
+ throw new Error('Required parameter contactId was null or undefined when calling loyaltyBalanceProgramsPidTransactionHistoryGet.');
1454
+ }
1455
+
1456
+ // verify required parameter 'balanceDefinitionId' is not null or undefined
1457
+ if (balanceDefinitionId === null || balanceDefinitionId === undefined) {
1458
+ throw new Error('Required parameter balanceDefinitionId was null or undefined when calling loyaltyBalanceProgramsPidTransactionHistoryGet.');
1459
+ }
1460
+
1461
+ if (limit !== undefined) {
1462
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
1463
+ }
1464
+
1465
+ if (offset !== undefined) {
1466
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
1467
+ }
1468
+
1469
+ if (sortField !== undefined) {
1470
+ localVarQueryParameters['sort_field'] = ObjectSerializer.serialize(sortField, "'name' | 'created_at' | 'updated_at'");
1471
+ }
1472
+
1473
+ if (sort !== undefined) {
1474
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'");
1475
+ }
1476
+
1477
+ if (contactId !== undefined) {
1478
+ localVarQueryParameters['contact_id'] = ObjectSerializer.serialize(contactId, "number");
1479
+ }
1480
+
1481
+ if (balanceDefinitionId !== undefined) {
1482
+ localVarQueryParameters['balance_definition_id'] = ObjectSerializer.serialize(balanceDefinitionId, "string");
1483
+ }
1484
+
1485
+ if (filters !== undefined) {
1486
+ localVarQueryParameters['filters'] = ObjectSerializer.serialize(filters, "Array<string>");
1487
+ }
1488
+
1489
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1490
+
1491
+ let localVarUseFormData = false;
1492
+
1493
+ let localVarRequestOptions: localVarRequest.Options = {
1494
+ method: 'GET',
1495
+ qs: localVarQueryParameters,
1496
+ headers: localVarHeaderParams,
1497
+ uri: localVarPath,
1498
+ useQuerystring: this._useQuerystring,
1499
+ json: true,
1500
+ };
1501
+
1502
+ let authenticationPromise = Promise.resolve();
1503
+ if (this.authentications.apiKey.apiKey) {
1504
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1505
+ }
1506
+ if (this.authentications.partnerKey.apiKey) {
1507
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1508
+ }
1509
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1510
+
1511
+ let interceptorPromise = authenticationPromise;
1512
+ for (const interceptor of this.interceptors) {
1513
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1514
+ }
1515
+
1516
+ return interceptorPromise.then(() => {
1517
+ if (Object.keys(localVarFormParams).length) {
1518
+ if (localVarUseFormData) {
1519
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1520
+ } else {
1521
+ localVarRequestOptions.form = localVarFormParams;
1522
+ }
1523
+ }
1524
+ return new Promise<{ response: http.IncomingMessage; body: TransactionHistoryResp; }>((resolve, reject) => {
1525
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1526
+ if (error) {
1527
+ reject(error);
1528
+ } else {
1529
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1530
+ body = ObjectSerializer.deserialize(body, "TransactionHistoryResp");
1531
+ resolve({ response: response, body: body });
1532
+ } else {
1533
+ reject(new HttpError(response, body, response.statusCode));
1534
+ }
1535
+ }
1536
+ });
1537
+ });
1538
+ });
1539
+ }
1540
+ /**
1541
+ * Updates Balance definition
1542
+ * @summary Update balance definition
1543
+ * @param pid Loyalty Program Id
1544
+ * @param bdid Balance Definition Id
1545
+ * @param body Update Balance Definition Payload
1546
+ */
1547
+ public async updateBalanceDefinition (pid: string, bdid: string, body: UpdateBalanceDefinitionPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }> {
1548
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'
1549
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
1550
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
1551
+ let localVarQueryParameters: any = {};
1552
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1553
+ const produces = ['application/json'];
1554
+ // give precedence to 'application/json'
1555
+ if (produces.indexOf('application/json') >= 0) {
1556
+ localVarHeaderParams.Accept = 'application/json';
1557
+ } else {
1558
+ localVarHeaderParams.Accept = produces.join(',');
1559
+ }
1560
+ let localVarFormParams: any = {};
1561
+
1562
+ // verify required parameter 'pid' is not null or undefined
1563
+ if (pid === null || pid === undefined) {
1564
+ throw new Error('Required parameter pid was null or undefined when calling updateBalanceDefinition.');
1565
+ }
1566
+
1567
+ // verify required parameter 'bdid' is not null or undefined
1568
+ if (bdid === null || bdid === undefined) {
1569
+ throw new Error('Required parameter bdid was null or undefined when calling updateBalanceDefinition.');
1570
+ }
1571
+
1572
+ // verify required parameter 'body' is not null or undefined
1573
+ if (body === null || body === undefined) {
1574
+ throw new Error('Required parameter body was null or undefined when calling updateBalanceDefinition.');
1575
+ }
1576
+
1577
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1578
+
1579
+ let localVarUseFormData = false;
1580
+
1581
+ let localVarRequestOptions: localVarRequest.Options = {
1582
+ method: 'PUT',
1583
+ qs: localVarQueryParameters,
1584
+ headers: localVarHeaderParams,
1585
+ uri: localVarPath,
1586
+ useQuerystring: this._useQuerystring,
1587
+ json: true,
1588
+ body: ObjectSerializer.serialize(body, "UpdateBalanceDefinitionPayload")
1589
+ };
1590
+
1591
+ let authenticationPromise = Promise.resolve();
1592
+ if (this.authentications.apiKey.apiKey) {
1593
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1594
+ }
1595
+ if (this.authentications.partnerKey.apiKey) {
1596
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1597
+ }
1598
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1599
+
1600
+ let interceptorPromise = authenticationPromise;
1601
+ for (const interceptor of this.interceptors) {
1602
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1603
+ }
1604
+
1605
+ return interceptorPromise.then(() => {
1606
+ if (Object.keys(localVarFormParams).length) {
1607
+ if (localVarUseFormData) {
1608
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1609
+ } else {
1610
+ localVarRequestOptions.form = localVarFormParams;
1611
+ }
1612
+ }
1613
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }>((resolve, reject) => {
1614
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1615
+ if (error) {
1616
+ reject(error);
1617
+ } else {
1618
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1619
+ body = ObjectSerializer.deserialize(body, "BalanceDefinition");
1620
+ resolve({ response: response, body: body });
1621
+ } else {
1622
+ reject(new HttpError(response, body, response.statusCode));
1623
+ }
1624
+ }
1625
+ });
1626
+ });
1627
+ });
1628
+ }
1629
+ /**
1630
+ * Updates balance limit
1631
+ * @summary Updates balance limit
1632
+ * @param pid Loyalty Program Id
1633
+ * @param bdid Balance Definition Id
1634
+ * @param blid Balance Limit Id
1635
+ * @param body Balance Limits Payload
1636
+ */
1637
+ public async updateBalanceLimit (pid: string, bdid: string, blid: string, body: UpdateBalanceLimitPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
1638
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'
1639
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
1640
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)))
1641
+ .replace('{' + 'blid' + '}', encodeURIComponent(String(blid)));
1642
+ let localVarQueryParameters: any = {};
1643
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
1644
+ const produces = ['application/json'];
1645
+ // give precedence to 'application/json'
1646
+ if (produces.indexOf('application/json') >= 0) {
1647
+ localVarHeaderParams.Accept = 'application/json';
1648
+ } else {
1649
+ localVarHeaderParams.Accept = produces.join(',');
1650
+ }
1651
+ let localVarFormParams: any = {};
1652
+
1653
+ // verify required parameter 'pid' is not null or undefined
1654
+ if (pid === null || pid === undefined) {
1655
+ throw new Error('Required parameter pid was null or undefined when calling updateBalanceLimit.');
1656
+ }
1657
+
1658
+ // verify required parameter 'bdid' is not null or undefined
1659
+ if (bdid === null || bdid === undefined) {
1660
+ throw new Error('Required parameter bdid was null or undefined when calling updateBalanceLimit.');
1661
+ }
1662
+
1663
+ // verify required parameter 'blid' is not null or undefined
1664
+ if (blid === null || blid === undefined) {
1665
+ throw new Error('Required parameter blid was null or undefined when calling updateBalanceLimit.');
1666
+ }
1667
+
1668
+ // verify required parameter 'body' is not null or undefined
1669
+ if (body === null || body === undefined) {
1670
+ throw new Error('Required parameter body was null or undefined when calling updateBalanceLimit.');
1671
+ }
1672
+
1673
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1674
+
1675
+ let localVarUseFormData = false;
1676
+
1677
+ let localVarRequestOptions: localVarRequest.Options = {
1678
+ method: 'PUT',
1679
+ qs: localVarQueryParameters,
1680
+ headers: localVarHeaderParams,
1681
+ uri: localVarPath,
1682
+ useQuerystring: this._useQuerystring,
1683
+ json: true,
1684
+ body: ObjectSerializer.serialize(body, "UpdateBalanceLimitPayload")
1685
+ };
1686
+
1687
+ let authenticationPromise = Promise.resolve();
1688
+ if (this.authentications.apiKey.apiKey) {
1689
+ authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
1690
+ }
1691
+ if (this.authentications.partnerKey.apiKey) {
1692
+ authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
1693
+ }
1694
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1695
+
1696
+ let interceptorPromise = authenticationPromise;
1697
+ for (const interceptor of this.interceptors) {
1698
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1699
+ }
1700
+
1701
+ return interceptorPromise.then(() => {
1702
+ if (Object.keys(localVarFormParams).length) {
1703
+ if (localVarUseFormData) {
1704
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1705
+ } else {
1706
+ localVarRequestOptions.form = localVarFormParams;
1707
+ }
1708
+ }
1709
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
1710
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1711
+ if (error) {
1712
+ reject(error);
1713
+ } else {
1714
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1715
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
1716
+ resolve({ response: response, body: body });
1717
+ } else {
1718
+ reject(new HttpError(response, body, response.statusCode));
1719
+ }
1720
+ }
1721
+ });
1722
+ });
1723
+ });
1724
+ }
1725
+ }