@gofynd/fdk-client-javascript 1.2.0 → 1.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 (262) hide show
  1. package/README.md +44 -7
  2. package/package.json +1 -2
  3. package/sdk/application/ApplicationAPIClient.d.ts +3 -3
  4. package/sdk/application/ApplicationAPIClient.js +6 -4
  5. package/sdk/application/ApplicationClient.d.ts +2 -3
  6. package/sdk/application/ApplicationClient.js +1 -45
  7. package/sdk/application/ApplicationConfig.d.ts +46 -6
  8. package/sdk/application/ApplicationConfig.js +15 -16
  9. package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
  10. package/sdk/application/Cart/CartApplicationClient.js +225 -134
  11. package/sdk/application/Cart/CartApplicationModel.d.ts +4 -4
  12. package/sdk/application/Cart/CartApplicationModel.js +4 -4
  13. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
  14. package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
  15. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
  16. package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
  17. package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
  18. package/sdk/application/Common/CommonApplicationClient.js +13 -11
  19. package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
  20. package/sdk/application/Common/CommonApplicationModel.js +2 -58
  21. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
  22. package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
  23. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
  24. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
  27. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
  28. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
  29. package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
  30. package/sdk/application/Content/ContentApplicationClient.js +159 -80
  31. package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
  32. package/sdk/application/Content/ContentApplicationModel.js +11 -763
  33. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
  34. package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
  35. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
  36. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
  37. package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
  38. package/sdk/application/Lead/LeadApplicationClient.js +50 -31
  39. package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
  40. package/sdk/application/Lead/LeadApplicationModel.js +21 -481
  41. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
  42. package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
  43. package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
  44. package/sdk/application/Order/OrderApplicationClient.js +88 -56
  45. package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
  46. package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
  47. package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
  48. package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
  49. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
  50. package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
  51. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
  52. package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
  53. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
  54. package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
  55. package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
  56. package/sdk/application/Share/ShareApplicationClient.js +51 -31
  57. package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
  58. package/sdk/application/Share/ShareApplicationModel.js +0 -38
  59. package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
  60. package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
  61. package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
  62. package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
  63. package/sdk/application/User/UserApplicationClient.d.ts +74 -35
  64. package/sdk/application/User/UserApplicationClient.js +252 -161
  65. package/sdk/application/User/UserApplicationModel.d.ts +3 -401
  66. package/sdk/application/User/UserApplicationModel.js +2 -490
  67. package/sdk/common/AxiosHelper.js +1 -2
  68. package/sdk/common/FDKError.d.ts +3 -0
  69. package/sdk/common/FDKError.js +8 -0
  70. package/sdk/common/utils.d.ts +3 -0
  71. package/sdk/common/utils.js +29 -0
  72. package/sdk/partner/PartnerAPIClient.d.ts +5 -4
  73. package/sdk/partner/PartnerAPIClient.js +7 -4
  74. package/sdk/partner/PartnerClient.d.ts +2 -0
  75. package/sdk/partner/PartnerClient.js +3 -0
  76. package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
  77. package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
  78. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
  79. package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
  80. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
  81. package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
  82. package/sdk/partner/index.d.ts +3 -1
  83. package/sdk/partner/index.js +3 -1
  84. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  85. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
  86. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
  87. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
  88. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
  89. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
  90. package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
  91. package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
  92. package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
  93. package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
  94. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
  95. package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
  96. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
  97. package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
  98. package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
  99. package/sdk/platform/Cart/CartPlatformModel.js +104 -54
  100. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
  101. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
  102. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
  103. package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
  104. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
  105. package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
  106. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
  107. package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
  108. package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
  109. package/sdk/platform/Common/CommonPlatformClient.js +13 -11
  110. package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
  111. package/sdk/platform/Common/CommonPlatformModel.js +23 -57
  112. package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
  113. package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
  114. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
  115. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
  116. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
  117. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
  118. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  119. package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
  120. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
  121. package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
  122. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
  123. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
  124. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
  125. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
  127. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
  128. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
  129. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
  130. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
  131. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
  132. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  133. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
  134. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
  135. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
  136. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
  137. package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
  138. package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
  139. package/sdk/platform/Content/ContentPlatformModel.js +8 -231
  140. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
  141. package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
  142. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
  143. package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
  144. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
  145. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
  146. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
  147. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
  148. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
  149. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
  150. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
  151. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
  152. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
  153. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
  154. package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
  155. package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
  156. package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
  157. package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
  158. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
  159. package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
  160. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
  161. package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
  162. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
  163. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
  164. package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
  165. package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
  166. package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
  167. package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
  168. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
  169. package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
  170. package/sdk/platform/OAuthClient.js +6 -2
  171. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
  172. package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
  173. package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
  174. package/sdk/platform/Order/OrderPlatformClient.js +738 -205
  175. package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
  176. package/sdk/platform/Order/OrderPlatformModel.js +225 -2
  177. package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
  178. package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
  179. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
  180. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
  181. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
  182. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
  183. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
  184. package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
  185. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
  186. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
  187. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
  188. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
  189. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
  190. package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
  191. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
  192. package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
  193. package/sdk/platform/PlatformAPIClient.d.ts +3 -3
  194. package/sdk/platform/PlatformAPIClient.js +2 -2
  195. package/sdk/platform/PlatformClient.d.ts +2 -2
  196. package/sdk/platform/PlatformClient.js +4 -4
  197. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
  198. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
  199. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
  200. package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
  201. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
  202. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
  203. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
  204. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
  205. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
  206. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
  207. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
  208. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
  209. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
  210. package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
  211. package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
  212. package/sdk/platform/Share/SharePlatformModel.js +4 -4
  213. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
  214. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
  215. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
  216. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
  217. package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
  218. package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
  219. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
  220. package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
  221. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
  222. package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
  223. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
  224. package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
  225. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
  226. package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
  227. package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
  228. package/sdk/platform/User/UserPlatformModel.js +3 -899
  229. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
  230. package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
  231. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
  232. package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
  233. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +96 -9
  234. package/sdk/platform/Webhook/WebhookPlatformValidator.js +117 -5
  235. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
  236. package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
  237. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
  238. package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
  239. package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
  240. package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
  241. package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
  242. package/sdk/public/Partner/PartnerPublicClient.js +110 -0
  243. package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
  244. package/sdk/public/Partner/PartnerPublicModel.js +280 -0
  245. package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
  246. package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
  247. package/sdk/public/PublicAPIClient.d.ts +14 -1
  248. package/sdk/public/PublicAPIClient.js +7 -1
  249. package/sdk/public/PublicClient.d.ts +2 -0
  250. package/sdk/public/PublicClient.js +4 -0
  251. package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
  252. package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
  253. package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
  254. package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
  255. package/sdk/public/index.d.ts +1 -0
  256. package/sdk/public/index.js +2 -0
  257. package/sdk/application/ApplicationModels.d.ts +0 -48
  258. package/sdk/application/ApplicationModels.js +0 -38
  259. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
  260. package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
  261. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
  262. package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
@@ -13,6 +13,7 @@ class Billing {
13
13
 
14
14
  /**
15
15
  * @param {BillingPlatformValidator.ActivateSubscriptionPlanParam} arg - Arg object
16
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
16
17
  * @param {import("../PlatformAPIClient").Options} - Options
17
18
  * @returns {Promise<BillingPlatformModel.SubscriptionActivateRes>} - Success response
18
19
  * @name activateSubscriptionPlan
@@ -20,8 +21,8 @@ class Billing {
20
21
  * @description: It will activate subscription plan for customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/activateSubscriptionPlan/).
21
22
  */
22
23
  async activateSubscriptionPlan(
23
- { body } = {},
24
- { headers } = { headers: false }
24
+ { body, requestHeaders } = { requestHeaders: {} },
25
+ { responseHeaders } = { responseHeaders: false }
25
26
  ) {
26
27
  const {
27
28
  error,
@@ -61,12 +62,12 @@ class Billing {
61
62
  `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/activate`,
62
63
  query_params,
63
64
  body,
64
- xHeaders,
65
- { headers }
65
+ { ...xHeaders, ...requestHeaders },
66
+ { responseHeaders }
66
67
  );
67
68
 
68
69
  let responseData = response;
69
- if (headers) {
70
+ if (responseHeaders) {
70
71
  responseData = response[0];
71
72
  }
72
73
 
@@ -89,6 +90,7 @@ class Billing {
89
90
 
90
91
  /**
91
92
  * @param {BillingPlatformValidator.CancelSubscriptionChargeParam} arg - Arg object
93
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
92
94
  * @param {import("../PlatformAPIClient").Options} - Options
93
95
  * @returns {Promise<BillingPlatformModel.EntitySubscription>} - Success response
94
96
  * @name cancelSubscriptionCharge
@@ -96,8 +98,8 @@ class Billing {
96
98
  * @description: Cancel subscription and attached charges. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/cancelSubscriptionCharge/).
97
99
  */
98
100
  async cancelSubscriptionCharge(
99
- { extensionId, subscriptionId } = {},
100
- { headers } = { headers: false }
101
+ { extensionId, subscriptionId, requestHeaders } = { requestHeaders: {} },
102
+ { responseHeaders } = { responseHeaders: false }
101
103
  ) {
102
104
  const {
103
105
  error,
@@ -139,12 +141,12 @@ class Billing {
139
141
  `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}/cancel`,
140
142
  query_params,
141
143
  undefined,
142
- xHeaders,
143
- { headers }
144
+ { ...xHeaders, ...requestHeaders },
145
+ { responseHeaders }
144
146
  );
145
147
 
146
148
  let responseData = response;
147
- if (headers) {
149
+ if (responseHeaders) {
148
150
  responseData = response[0];
149
151
  }
150
152
 
@@ -167,6 +169,7 @@ class Billing {
167
169
 
168
170
  /**
169
171
  * @param {BillingPlatformValidator.CancelSubscriptionPlanParam} arg - Arg object
172
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
170
173
  * @param {import("../PlatformAPIClient").Options} - Options
171
174
  * @returns {Promise<BillingPlatformModel.CancelSubscriptionRes>} - Success response
172
175
  * @name cancelSubscriptionPlan
@@ -174,8 +177,8 @@ class Billing {
174
177
  * @description: It will cancel current active subscription. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/cancelSubscriptionPlan/).
175
178
  */
176
179
  async cancelSubscriptionPlan(
177
- { body } = {},
178
- { headers } = { headers: false }
180
+ { body, requestHeaders } = { requestHeaders: {} },
181
+ { responseHeaders } = { responseHeaders: false }
179
182
  ) {
180
183
  const {
181
184
  error,
@@ -215,12 +218,12 @@ class Billing {
215
218
  `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/cancel`,
216
219
  query_params,
217
220
  body,
218
- xHeaders,
219
- { headers }
221
+ { ...xHeaders, ...requestHeaders },
222
+ { responseHeaders }
220
223
  );
221
224
 
222
225
  let responseData = response;
223
- if (headers) {
226
+ if (responseHeaders) {
224
227
  responseData = response[0];
225
228
  }
226
229
 
@@ -243,6 +246,7 @@ class Billing {
243
246
 
244
247
  /**
245
248
  * @param {BillingPlatformValidator.CheckCouponValidityParam} arg - Arg object
249
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
246
250
  * @param {import("../PlatformAPIClient").Options} - Options
247
251
  * @returns {Promise<BillingPlatformModel.CheckValidityResponse>} - Success response
248
252
  * @name checkCouponValidity
@@ -250,8 +254,8 @@ class Billing {
250
254
  * @description: Check coupon validity. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/checkCouponValidity/).
251
255
  */
252
256
  async checkCouponValidity(
253
- { plan, couponCode } = {},
254
- { headers } = { headers: false }
257
+ { plan, couponCode, requestHeaders } = { requestHeaders: {} },
258
+ { responseHeaders } = { responseHeaders: false }
255
259
  ) {
256
260
  const { error } = BillingPlatformValidator.checkCouponValidity().validate(
257
261
  {
@@ -293,12 +297,12 @@ class Billing {
293
297
  `/service/platform/billing/v1.0/company/${this.config.companyId}/coupon/check-validity`,
294
298
  query_params,
295
299
  undefined,
296
- xHeaders,
297
- { headers }
300
+ { ...xHeaders, ...requestHeaders },
301
+ { responseHeaders }
298
302
  );
299
303
 
300
304
  let responseData = response;
301
- if (headers) {
305
+ if (responseHeaders) {
302
306
  responseData = response[0];
303
307
  }
304
308
 
@@ -321,6 +325,7 @@ class Billing {
321
325
 
322
326
  /**
323
327
  * @param {BillingPlatformValidator.CreateOneTimeChargeParam} arg - Arg object
328
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
324
329
  * @param {import("../PlatformAPIClient").Options} - Options
325
330
  * @returns {Promise<BillingPlatformModel.CreateOneTimeChargeResponse>} -
326
331
  * Success response
@@ -329,8 +334,8 @@ class Billing {
329
334
  * @description: Register one time subscription charge for a seller of your extension. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/createOneTimeCharge/).
330
335
  */
331
336
  async createOneTimeCharge(
332
- { extensionId, body } = {},
333
- { headers } = { headers: false }
337
+ { extensionId, body, requestHeaders } = { requestHeaders: {} },
338
+ { responseHeaders } = { responseHeaders: false }
334
339
  ) {
335
340
  const { error } = BillingPlatformValidator.createOneTimeCharge().validate(
336
341
  {
@@ -370,12 +375,12 @@ class Billing {
370
375
  `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/one_time_charge`,
371
376
  query_params,
372
377
  body,
373
- xHeaders,
374
- { headers }
378
+ { ...xHeaders, ...requestHeaders },
379
+ { responseHeaders }
375
380
  );
376
381
 
377
382
  let responseData = response;
378
- if (headers) {
383
+ if (responseHeaders) {
379
384
  responseData = response[0];
380
385
  }
381
386
 
@@ -398,6 +403,7 @@ class Billing {
398
403
 
399
404
  /**
400
405
  * @param {BillingPlatformValidator.CreateSubscriptionChargeParam} arg - Arg object
406
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
401
407
  * @param {import("../PlatformAPIClient").Options} - Options
402
408
  * @returns {Promise<BillingPlatformModel.CreateSubscriptionResponse>} -
403
409
  * Success response
@@ -406,8 +412,8 @@ class Billing {
406
412
  * @description: Register subscription charge for a seller of your extension. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/createSubscriptionCharge/).
407
413
  */
408
414
  async createSubscriptionCharge(
409
- { extensionId, body } = {},
410
- { headers } = { headers: false }
415
+ { extensionId, body, requestHeaders } = { requestHeaders: {} },
416
+ { responseHeaders } = { responseHeaders: false }
411
417
  ) {
412
418
  const {
413
419
  error,
@@ -449,12 +455,12 @@ class Billing {
449
455
  `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
450
456
  query_params,
451
457
  body,
452
- xHeaders,
453
- { headers }
458
+ { ...xHeaders, ...requestHeaders },
459
+ { responseHeaders }
454
460
  );
455
461
 
456
462
  let responseData = response;
457
- if (headers) {
463
+ if (responseHeaders) {
458
464
  responseData = response[0];
459
465
  }
460
466
 
@@ -477,6 +483,7 @@ class Billing {
477
483
 
478
484
  /**
479
485
  * @param {BillingPlatformValidator.GetChargeDetailsParam} arg - Arg object
486
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
480
487
  * @param {import("../PlatformAPIClient").Options} - Options
481
488
  * @returns {Promise<BillingPlatformModel.OneTimeChargeEntity>} - Success response
482
489
  * @name getChargeDetails
@@ -484,8 +491,8 @@ class Billing {
484
491
  * @description: Get created subscription charge details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getChargeDetails/).
485
492
  */
486
493
  async getChargeDetails(
487
- { extensionId, chargeId } = {},
488
- { headers } = { headers: false }
494
+ { extensionId, chargeId, requestHeaders } = { requestHeaders: {} },
495
+ { responseHeaders } = { responseHeaders: false }
489
496
  ) {
490
497
  const { error } = BillingPlatformValidator.getChargeDetails().validate(
491
498
  {
@@ -525,12 +532,12 @@ class Billing {
525
532
  `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/charge/${chargeId}`,
526
533
  query_params,
527
534
  undefined,
528
- xHeaders,
529
- { headers }
535
+ { ...xHeaders, ...requestHeaders },
536
+ { responseHeaders }
530
537
  );
531
538
 
532
539
  let responseData = response;
533
- if (headers) {
540
+ if (responseHeaders) {
534
541
  responseData = response[0];
535
542
  }
536
543
 
@@ -553,13 +560,17 @@ class Billing {
553
560
 
554
561
  /**
555
562
  * @param {BillingPlatformValidator.GetCustomerDetailParam} arg - Arg object
563
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
556
564
  * @param {import("../PlatformAPIClient").Options} - Options
557
565
  * @returns {Promise<BillingPlatformModel.SubscriptionCustomer>} - Success response
558
566
  * @name getCustomerDetail
559
567
  * @summary: Get subscription customer detail
560
568
  * @description: Get subscription customer detail. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getCustomerDetail/).
561
569
  */
562
- async getCustomerDetail({ headers } = { headers: false }) {
570
+ async getCustomerDetail(
571
+ { requestHeaders } = { requestHeaders: {} },
572
+ { responseHeaders } = { responseHeaders: false }
573
+ ) {
563
574
  const { error } = BillingPlatformValidator.getCustomerDetail().validate(
564
575
  {},
565
576
  { abortEarly: false, allowUnknown: true }
@@ -592,12 +603,12 @@ class Billing {
592
603
  `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
593
604
  query_params,
594
605
  undefined,
595
- xHeaders,
596
- { headers }
606
+ { ...xHeaders, ...requestHeaders },
607
+ { responseHeaders }
597
608
  );
598
609
 
599
610
  let responseData = response;
600
- if (headers) {
611
+ if (responseHeaders) {
601
612
  responseData = response[0];
602
613
  }
603
614
 
@@ -618,15 +629,88 @@ class Billing {
618
629
  return response;
619
630
  }
620
631
 
632
+ /**
633
+ * @param {BillingPlatformValidator.GetEnterprisePlansParam} arg - Arg object
634
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
635
+ * @param {import("../PlatformAPIClient").Options} - Options
636
+ * @returns {Promise<BillingPlatformModel.Plan[]>} - Success response
637
+ * @name getEnterprisePlans
638
+ * @summary: Get Enterprise Plans
639
+ * @description: Get Enterprise Plans.
640
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getEnterprisePlans/).
641
+ */
642
+ async getEnterprisePlans(
643
+ { requestHeaders } = { requestHeaders: {} },
644
+ { responseHeaders } = { responseHeaders: false }
645
+ ) {
646
+ const { error } = BillingPlatformValidator.getEnterprisePlans().validate(
647
+ {},
648
+ { abortEarly: false, allowUnknown: true }
649
+ );
650
+ if (error) {
651
+ return Promise.reject(new FDKClientValidationError(error));
652
+ }
653
+
654
+ // Showing warrnings if extra unknown parameters are found
655
+ const {
656
+ error: warrning,
657
+ } = BillingPlatformValidator.getEnterprisePlans().validate(
658
+ {},
659
+ { abortEarly: false, allowUnknown: false }
660
+ );
661
+ if (warrning) {
662
+ Logger({
663
+ level: "WARN",
664
+ message: `Parameter Validation warrnings for platform > Billing > getEnterprisePlans \n ${warrning}`,
665
+ });
666
+ }
667
+
668
+ const query_params = {};
669
+
670
+ const xHeaders = {};
671
+
672
+ const response = await PlatformAPIClient.execute(
673
+ this.config,
674
+ "get",
675
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/plans`,
676
+ query_params,
677
+ undefined,
678
+ { ...xHeaders, ...requestHeaders },
679
+ { responseHeaders }
680
+ );
681
+
682
+ let responseData = response;
683
+ if (responseHeaders) {
684
+ responseData = response[0];
685
+ }
686
+
687
+ const { error: res_error } = Joi.array()
688
+ .items(BillingPlatformModel.Plan())
689
+ .validate(responseData, { abortEarly: false, allowUnknown: false });
690
+
691
+ if (res_error) {
692
+ Logger({
693
+ level: "WARN",
694
+ message: `Response Validation Warnnings for platform > Billing > getEnterprisePlans \n ${res_error}`,
695
+ });
696
+ }
697
+
698
+ return response;
699
+ }
700
+
621
701
  /**
622
702
  * @param {BillingPlatformValidator.GetFeatureLimitConfigParam} arg - Arg object
703
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
623
704
  * @param {import("../PlatformAPIClient").Options} - Options
624
705
  * @returns {Promise<BillingPlatformModel.SubscriptionLimit>} - Success response
625
706
  * @name getFeatureLimitConfig
626
707
  * @summary: Get subscription subscription limits
627
708
  * @description: Get subscription subscription limits. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getFeatureLimitConfig/).
628
709
  */
629
- async getFeatureLimitConfig({ headers } = { headers: false }) {
710
+ async getFeatureLimitConfig(
711
+ { requestHeaders } = { requestHeaders: {} },
712
+ { responseHeaders } = { responseHeaders: false }
713
+ ) {
630
714
  const { error } = BillingPlatformValidator.getFeatureLimitConfig().validate(
631
715
  {},
632
716
  { abortEarly: false, allowUnknown: true }
@@ -659,12 +743,12 @@ class Billing {
659
743
  `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current-limit`,
660
744
  query_params,
661
745
  undefined,
662
- xHeaders,
663
- { headers }
746
+ { ...xHeaders, ...requestHeaders },
747
+ { responseHeaders }
664
748
  );
665
749
 
666
750
  let responseData = response;
667
- if (headers) {
751
+ if (responseHeaders) {
668
752
  responseData = response[0];
669
753
  }
670
754
 
@@ -687,13 +771,17 @@ class Billing {
687
771
 
688
772
  /**
689
773
  * @param {BillingPlatformValidator.GetInvoiceByIdParam} arg - Arg object
774
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
690
775
  * @param {import("../PlatformAPIClient").Options} - Options
691
776
  * @returns {Promise<BillingPlatformModel.Invoice>} - Success response
692
777
  * @name getInvoiceById
693
778
  * @summary: Get invoice by id
694
779
  * @description: Get invoice by id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getInvoiceById/).
695
780
  */
696
- async getInvoiceById({ invoiceId } = {}, { headers } = { headers: false }) {
781
+ async getInvoiceById(
782
+ { invoiceId, requestHeaders } = { requestHeaders: {} },
783
+ { responseHeaders } = { responseHeaders: false }
784
+ ) {
697
785
  const { error } = BillingPlatformValidator.getInvoiceById().validate(
698
786
  {
699
787
  invoiceId,
@@ -730,12 +818,12 @@ class Billing {
730
818
  `/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/${invoiceId}`,
731
819
  query_params,
732
820
  undefined,
733
- xHeaders,
734
- { headers }
821
+ { ...xHeaders, ...requestHeaders },
822
+ { responseHeaders }
735
823
  );
736
824
 
737
825
  let responseData = response;
738
- if (headers) {
826
+ if (responseHeaders) {
739
827
  responseData = response[0];
740
828
  }
741
829
 
@@ -758,13 +846,17 @@ class Billing {
758
846
 
759
847
  /**
760
848
  * @param {BillingPlatformValidator.GetInvoicesParam} arg - Arg object
849
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
761
850
  * @param {import("../PlatformAPIClient").Options} - Options
762
851
  * @returns {Promise<BillingPlatformModel.Invoices>} - Success response
763
852
  * @name getInvoices
764
853
  * @summary: Get invoices
765
854
  * @description: Get invoices. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getInvoices/).
766
855
  */
767
- async getInvoices({ headers } = { headers: false }) {
856
+ async getInvoices(
857
+ { requestHeaders } = { requestHeaders: {} },
858
+ { responseHeaders } = { responseHeaders: false }
859
+ ) {
768
860
  const { error } = BillingPlatformValidator.getInvoices().validate(
769
861
  {},
770
862
  { abortEarly: false, allowUnknown: true }
@@ -795,12 +887,12 @@ class Billing {
795
887
  `/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/list`,
796
888
  query_params,
797
889
  undefined,
798
- xHeaders,
799
- { headers }
890
+ { ...xHeaders, ...requestHeaders },
891
+ { responseHeaders }
800
892
  );
801
893
 
802
894
  let responseData = response;
803
- if (headers) {
895
+ if (responseHeaders) {
804
896
  responseData = response[0];
805
897
  }
806
898
 
@@ -823,6 +915,7 @@ class Billing {
823
915
 
824
916
  /**
825
917
  * @param {BillingPlatformValidator.GetSubscriptionParam} arg - Arg object
918
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
826
919
  * @param {import("../PlatformAPIClient").Options} - Options
827
920
  * @returns {Promise<BillingPlatformModel.SubscriptionStatus>} - Success response
828
921
  * @name getSubscription
@@ -830,7 +923,10 @@ class Billing {
830
923
  * @description: If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message.
831
924
  * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getSubscription/).
832
925
  */
833
- async getSubscription({ headers } = { headers: false }) {
926
+ async getSubscription(
927
+ { requestHeaders } = { requestHeaders: {} },
928
+ { responseHeaders } = { responseHeaders: false }
929
+ ) {
834
930
  const { error } = BillingPlatformValidator.getSubscription().validate(
835
931
  {},
836
932
  { abortEarly: false, allowUnknown: true }
@@ -863,12 +959,12 @@ class Billing {
863
959
  `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current`,
864
960
  query_params,
865
961
  undefined,
866
- xHeaders,
867
- { headers }
962
+ { ...xHeaders, ...requestHeaders },
963
+ { responseHeaders }
868
964
  );
869
965
 
870
966
  let responseData = response;
871
- if (headers) {
967
+ if (responseHeaders) {
872
968
  responseData = response[0];
873
969
  }
874
970
 
@@ -891,6 +987,7 @@ class Billing {
891
987
 
892
988
  /**
893
989
  * @param {BillingPlatformValidator.GetSubscriptionChargeParam} arg - Arg object
990
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
894
991
  * @param {import("../PlatformAPIClient").Options} - Options
895
992
  * @returns {Promise<BillingPlatformModel.EntitySubscription>} - Success response
896
993
  * @name getSubscriptionCharge
@@ -898,8 +995,8 @@ class Billing {
898
995
  * @description: Get created subscription charge details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getSubscriptionCharge/).
899
996
  */
900
997
  async getSubscriptionCharge(
901
- { extensionId, subscriptionId } = {},
902
- { headers } = { headers: false }
998
+ { extensionId, subscriptionId, requestHeaders } = { requestHeaders: {} },
999
+ { responseHeaders } = { responseHeaders: false }
903
1000
  ) {
904
1001
  const { error } = BillingPlatformValidator.getSubscriptionCharge().validate(
905
1002
  {
@@ -939,12 +1036,12 @@ class Billing {
939
1036
  `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}`,
940
1037
  query_params,
941
1038
  undefined,
942
- xHeaders,
943
- { headers }
1039
+ { ...xHeaders, ...requestHeaders },
1040
+ { responseHeaders }
944
1041
  );
945
1042
 
946
1043
  let responseData = response;
947
- if (headers) {
1044
+ if (responseHeaders) {
948
1045
  responseData = response[0];
949
1046
  }
950
1047
 
@@ -965,15 +1062,169 @@ class Billing {
965
1062
  return response;
966
1063
  }
967
1064
 
1065
+ /**
1066
+ * @param {BillingPlatformValidator.PlanStatusUpdateParam} arg - Arg object
1067
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1068
+ * @param {import("../PlatformAPIClient").Options} - Options
1069
+ * @returns {Promise<BillingPlatformModel.Plan>} - Success response
1070
+ * @name planStatusUpdate
1071
+ * @summary: Update Status of The plan
1072
+ * @description: It will update the status of the plan - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/planStatusUpdate/).
1073
+ */
1074
+ async planStatusUpdate(
1075
+ { body, requestHeaders } = { requestHeaders: {} },
1076
+ { responseHeaders } = { responseHeaders: false }
1077
+ ) {
1078
+ const { error } = BillingPlatformValidator.planStatusUpdate().validate(
1079
+ {
1080
+ body,
1081
+ },
1082
+ { abortEarly: false, allowUnknown: true }
1083
+ );
1084
+ if (error) {
1085
+ return Promise.reject(new FDKClientValidationError(error));
1086
+ }
1087
+
1088
+ // Showing warrnings if extra unknown parameters are found
1089
+ const {
1090
+ error: warrning,
1091
+ } = BillingPlatformValidator.planStatusUpdate().validate(
1092
+ {
1093
+ body,
1094
+ },
1095
+ { abortEarly: false, allowUnknown: false }
1096
+ );
1097
+ if (warrning) {
1098
+ Logger({
1099
+ level: "WARN",
1100
+ message: `Parameter Validation warrnings for platform > Billing > planStatusUpdate \n ${warrning}`,
1101
+ });
1102
+ }
1103
+
1104
+ const query_params = {};
1105
+
1106
+ const xHeaders = {};
1107
+
1108
+ const response = await PlatformAPIClient.execute(
1109
+ this.config,
1110
+ "patch",
1111
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/plan/status`,
1112
+ query_params,
1113
+ body,
1114
+ { ...xHeaders, ...requestHeaders },
1115
+ { responseHeaders }
1116
+ );
1117
+
1118
+ let responseData = response;
1119
+ if (responseHeaders) {
1120
+ responseData = response[0];
1121
+ }
1122
+
1123
+ const {
1124
+ error: res_error,
1125
+ } = BillingPlatformModel.Plan().validate(responseData, {
1126
+ abortEarly: false,
1127
+ allowUnknown: false,
1128
+ });
1129
+
1130
+ if (res_error) {
1131
+ Logger({
1132
+ level: "WARN",
1133
+ message: `Response Validation Warnnings for platform > Billing > planStatusUpdate \n ${res_error}`,
1134
+ });
1135
+ }
1136
+
1137
+ return response;
1138
+ }
1139
+
1140
+ /**
1141
+ * @param {BillingPlatformValidator.SubscripePlanParam} arg - Arg object
1142
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1143
+ * @param {import("../PlatformAPIClient").Options} - Options
1144
+ * @returns {Promise<BillingPlatformModel.SubscribePlanRes>} - Success response
1145
+ * @name subscripePlan
1146
+ * @summary: Subscribe plan.
1147
+ * @description: It will subscribe a plan. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/subscripePlan/).
1148
+ */
1149
+ async subscripePlan(
1150
+ { body, requestHeaders } = { requestHeaders: {} },
1151
+ { responseHeaders } = { responseHeaders: false }
1152
+ ) {
1153
+ const { error } = BillingPlatformValidator.subscripePlan().validate(
1154
+ {
1155
+ body,
1156
+ },
1157
+ { abortEarly: false, allowUnknown: true }
1158
+ );
1159
+ if (error) {
1160
+ return Promise.reject(new FDKClientValidationError(error));
1161
+ }
1162
+
1163
+ // Showing warrnings if extra unknown parameters are found
1164
+ const {
1165
+ error: warrning,
1166
+ } = BillingPlatformValidator.subscripePlan().validate(
1167
+ {
1168
+ body,
1169
+ },
1170
+ { abortEarly: false, allowUnknown: false }
1171
+ );
1172
+ if (warrning) {
1173
+ Logger({
1174
+ level: "WARN",
1175
+ message: `Parameter Validation warrnings for platform > Billing > subscripePlan \n ${warrning}`,
1176
+ });
1177
+ }
1178
+
1179
+ const query_params = {};
1180
+
1181
+ const xHeaders = {};
1182
+
1183
+ const response = await PlatformAPIClient.execute(
1184
+ this.config,
1185
+ "post",
1186
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/payment/initiate`,
1187
+ query_params,
1188
+ body,
1189
+ { ...xHeaders, ...requestHeaders },
1190
+ { responseHeaders }
1191
+ );
1192
+
1193
+ let responseData = response;
1194
+ if (responseHeaders) {
1195
+ responseData = response[0];
1196
+ }
1197
+
1198
+ const {
1199
+ error: res_error,
1200
+ } = BillingPlatformModel.SubscribePlanRes().validate(responseData, {
1201
+ abortEarly: false,
1202
+ allowUnknown: false,
1203
+ });
1204
+
1205
+ if (res_error) {
1206
+ Logger({
1207
+ level: "WARN",
1208
+ message: `Response Validation Warnnings for platform > Billing > subscripePlan \n ${res_error}`,
1209
+ });
1210
+ }
1211
+
1212
+ return response;
1213
+ }
1214
+
968
1215
  /**
969
1216
  * @param {BillingPlatformValidator.UpsertCustomerDetailParam} arg - Arg object
1217
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
970
1218
  * @param {import("../PlatformAPIClient").Options} - Options
971
1219
  * @returns {Promise<BillingPlatformModel.SubscriptionCustomer>} - Success response
972
1220
  * @name upsertCustomerDetail
973
1221
  * @summary: Upsert subscription customer detail
974
1222
  * @description: Upsert subscription customer detail. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/upsertCustomerDetail/).
975
1223
  */
976
- async upsertCustomerDetail({ body } = {}, { headers } = { headers: false }) {
1224
+ async upsertCustomerDetail(
1225
+ { body, requestHeaders } = { requestHeaders: {} },
1226
+ { responseHeaders } = { responseHeaders: false }
1227
+ ) {
977
1228
  const { error } = BillingPlatformValidator.upsertCustomerDetail().validate(
978
1229
  {
979
1230
  body,
@@ -1010,12 +1261,12 @@ class Billing {
1010
1261
  `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
1011
1262
  query_params,
1012
1263
  body,
1013
- xHeaders,
1014
- { headers }
1264
+ { ...xHeaders, ...requestHeaders },
1265
+ { responseHeaders }
1015
1266
  );
1016
1267
 
1017
1268
  let responseData = response;
1018
- if (headers) {
1269
+ if (responseHeaders) {
1019
1270
  responseData = response[0];
1020
1271
  }
1021
1272