@equisoft/billing-sdk 0.0.2-snapshot.20250930230514

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 (189) hide show
  1. package/.openapi-generator/FILES +41 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +13 -0
  4. package/.tool-versions +3 -0
  5. package/README.md +46 -0
  6. package/dist/apis/DistributorV1Api.d.ts +37 -0
  7. package/dist/apis/DistributorV1Api.js +102 -0
  8. package/dist/apis/OrganizationV1Api.d.ts +180 -0
  9. package/dist/apis/OrganizationV1Api.js +566 -0
  10. package/dist/apis/UserV1Api.d.ts +63 -0
  11. package/dist/apis/UserV1Api.js +180 -0
  12. package/dist/apis/index.d.ts +3 -0
  13. package/dist/apis/index.js +21 -0
  14. package/dist/esm/apis/DistributorV1Api.d.ts +37 -0
  15. package/dist/esm/apis/DistributorV1Api.js +98 -0
  16. package/dist/esm/apis/OrganizationV1Api.d.ts +180 -0
  17. package/dist/esm/apis/OrganizationV1Api.js +562 -0
  18. package/dist/esm/apis/UserV1Api.d.ts +63 -0
  19. package/dist/esm/apis/UserV1Api.js +176 -0
  20. package/dist/esm/apis/index.d.ts +3 -0
  21. package/dist/esm/apis/index.js +5 -0
  22. package/dist/esm/index.d.ts +3 -0
  23. package/dist/esm/index.js +5 -0
  24. package/dist/esm/models/ErrorCodes.d.ts +31 -0
  25. package/dist/esm/models/ErrorCodes.js +49 -0
  26. package/dist/esm/models/ErrorSchema.d.ts +39 -0
  27. package/dist/esm/models/ErrorSchema.js +46 -0
  28. package/dist/esm/models/SubscriptionCreationMode.d.ts +26 -0
  29. package/dist/esm/models/SubscriptionCreationMode.js +44 -0
  30. package/dist/esm/models/V1BillingStatus.d.ts +48 -0
  31. package/dist/esm/models/V1BillingStatus.js +66 -0
  32. package/dist/esm/models/V1BillingType.d.ts +30 -0
  33. package/dist/esm/models/V1BillingType.js +48 -0
  34. package/dist/esm/models/V1ChargebeeV1NotPaidInvoice.d.ts +44 -0
  35. package/dist/esm/models/V1ChargebeeV1NotPaidInvoice.js +49 -0
  36. package/dist/esm/models/V1ChargebeeV1PaymentDueInvoice.d.ts +44 -0
  37. package/dist/esm/models/V1ChargebeeV1PaymentDueInvoice.js +49 -0
  38. package/dist/esm/models/V1ChargebeeV1PortalSession.d.ts +44 -0
  39. package/dist/esm/models/V1ChargebeeV1PortalSession.js +49 -0
  40. package/dist/esm/models/V1ChargebeeV1UnpaidInvoice.d.ts +44 -0
  41. package/dist/esm/models/V1ChargebeeV1UnpaidInvoice.js +49 -0
  42. package/dist/esm/models/V1CollectChargebeeV1Payment.d.ts +32 -0
  43. package/dist/esm/models/V1CollectChargebeeV1Payment.js +43 -0
  44. package/dist/esm/models/V1CreateChargebeeV1PortalSessionPayload.d.ts +32 -0
  45. package/dist/esm/models/V1CreateChargebeeV1PortalSessionPayload.js +41 -0
  46. package/dist/esm/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.d.ts +38 -0
  47. package/dist/esm/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.js +47 -0
  48. package/dist/esm/models/V1Distributor.d.ts +50 -0
  49. package/dist/esm/models/V1Distributor.js +53 -0
  50. package/dist/esm/models/V1DistributorList.d.ts +33 -0
  51. package/dist/esm/models/V1DistributorList.js +44 -0
  52. package/dist/esm/models/V1MigrateLegacyBillingPayload.d.ts +38 -0
  53. package/dist/esm/models/V1MigrateLegacyBillingPayload.js +47 -0
  54. package/dist/esm/models/V1Organization.d.ts +57 -0
  55. package/dist/esm/models/V1Organization.js +54 -0
  56. package/dist/esm/models/V1OrganizationChargebeeV1Status.d.ts +79 -0
  57. package/dist/esm/models/V1OrganizationChargebeeV1Status.js +72 -0
  58. package/dist/esm/models/V1OrganizationStatus.d.ts +59 -0
  59. package/dist/esm/models/V1OrganizationStatus.js +58 -0
  60. package/dist/esm/models/V1OrganizationStatusChargebeeV1Addon.d.ts +44 -0
  61. package/dist/esm/models/V1OrganizationStatusChargebeeV1Addon.js +49 -0
  62. package/dist/esm/models/V1OrganizationStatusChargebeeV1User.d.ts +46 -0
  63. package/dist/esm/models/V1OrganizationStatusChargebeeV1User.js +53 -0
  64. package/dist/esm/models/V1OrganizationStatusChargebeeV1UserBillingStatus.d.ts +40 -0
  65. package/dist/esm/models/V1OrganizationStatusChargebeeV1UserBillingStatus.js +58 -0
  66. package/dist/esm/models/V1SetChargebeeV1BillingPayorPayload.d.ts +32 -0
  67. package/dist/esm/models/V1SetChargebeeV1BillingPayorPayload.js +43 -0
  68. package/dist/esm/models/V1SetChargebeeV1Payload.d.ts +45 -0
  69. package/dist/esm/models/V1SetChargebeeV1Payload.js +52 -0
  70. package/dist/esm/models/V1SetLegacyBillingPayload.d.ts +45 -0
  71. package/dist/esm/models/V1SetLegacyBillingPayload.js +50 -0
  72. package/dist/esm/models/V1SetOrganisationDistributorPayload.d.ts +32 -0
  73. package/dist/esm/models/V1SetOrganisationDistributorPayload.js +43 -0
  74. package/dist/esm/models/V1SetUserNonBillablePayload.d.ts +32 -0
  75. package/dist/esm/models/V1SetUserNonBillablePayload.js +43 -0
  76. package/dist/esm/models/V1User.d.ts +50 -0
  77. package/dist/esm/models/V1User.js +55 -0
  78. package/dist/esm/models/V1UserServiceStatus.d.ts +44 -0
  79. package/dist/esm/models/V1UserServiceStatus.js +51 -0
  80. package/dist/esm/models/V1UserStatus.d.ts +33 -0
  81. package/dist/esm/models/V1UserStatus.js +44 -0
  82. package/dist/esm/models/index.d.ts +29 -0
  83. package/dist/esm/models/index.js +31 -0
  84. package/dist/esm/runtime.d.ts +184 -0
  85. package/dist/esm/runtime.js +334 -0
  86. package/dist/index.d.ts +3 -0
  87. package/dist/index.js +21 -0
  88. package/dist/models/ErrorCodes.d.ts +31 -0
  89. package/dist/models/ErrorCodes.js +57 -0
  90. package/dist/models/ErrorSchema.d.ts +39 -0
  91. package/dist/models/ErrorSchema.js +53 -0
  92. package/dist/models/SubscriptionCreationMode.d.ts +26 -0
  93. package/dist/models/SubscriptionCreationMode.js +52 -0
  94. package/dist/models/V1BillingStatus.d.ts +48 -0
  95. package/dist/models/V1BillingStatus.js +74 -0
  96. package/dist/models/V1BillingType.d.ts +30 -0
  97. package/dist/models/V1BillingType.js +56 -0
  98. package/dist/models/V1ChargebeeV1NotPaidInvoice.d.ts +44 -0
  99. package/dist/models/V1ChargebeeV1NotPaidInvoice.js +56 -0
  100. package/dist/models/V1ChargebeeV1PaymentDueInvoice.d.ts +44 -0
  101. package/dist/models/V1ChargebeeV1PaymentDueInvoice.js +56 -0
  102. package/dist/models/V1ChargebeeV1PortalSession.d.ts +44 -0
  103. package/dist/models/V1ChargebeeV1PortalSession.js +56 -0
  104. package/dist/models/V1ChargebeeV1UnpaidInvoice.d.ts +44 -0
  105. package/dist/models/V1ChargebeeV1UnpaidInvoice.js +56 -0
  106. package/dist/models/V1CollectChargebeeV1Payment.d.ts +32 -0
  107. package/dist/models/V1CollectChargebeeV1Payment.js +50 -0
  108. package/dist/models/V1CreateChargebeeV1PortalSessionPayload.d.ts +32 -0
  109. package/dist/models/V1CreateChargebeeV1PortalSessionPayload.js +48 -0
  110. package/dist/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.d.ts +38 -0
  111. package/dist/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.js +54 -0
  112. package/dist/models/V1Distributor.d.ts +50 -0
  113. package/dist/models/V1Distributor.js +60 -0
  114. package/dist/models/V1DistributorList.d.ts +33 -0
  115. package/dist/models/V1DistributorList.js +51 -0
  116. package/dist/models/V1MigrateLegacyBillingPayload.d.ts +38 -0
  117. package/dist/models/V1MigrateLegacyBillingPayload.js +54 -0
  118. package/dist/models/V1Organization.d.ts +57 -0
  119. package/dist/models/V1Organization.js +61 -0
  120. package/dist/models/V1OrganizationChargebeeV1Status.d.ts +79 -0
  121. package/dist/models/V1OrganizationChargebeeV1Status.js +79 -0
  122. package/dist/models/V1OrganizationStatus.d.ts +59 -0
  123. package/dist/models/V1OrganizationStatus.js +65 -0
  124. package/dist/models/V1OrganizationStatusChargebeeV1Addon.d.ts +44 -0
  125. package/dist/models/V1OrganizationStatusChargebeeV1Addon.js +56 -0
  126. package/dist/models/V1OrganizationStatusChargebeeV1User.d.ts +46 -0
  127. package/dist/models/V1OrganizationStatusChargebeeV1User.js +60 -0
  128. package/dist/models/V1OrganizationStatusChargebeeV1UserBillingStatus.d.ts +40 -0
  129. package/dist/models/V1OrganizationStatusChargebeeV1UserBillingStatus.js +66 -0
  130. package/dist/models/V1SetChargebeeV1BillingPayorPayload.d.ts +32 -0
  131. package/dist/models/V1SetChargebeeV1BillingPayorPayload.js +50 -0
  132. package/dist/models/V1SetChargebeeV1Payload.d.ts +45 -0
  133. package/dist/models/V1SetChargebeeV1Payload.js +59 -0
  134. package/dist/models/V1SetLegacyBillingPayload.d.ts +45 -0
  135. package/dist/models/V1SetLegacyBillingPayload.js +57 -0
  136. package/dist/models/V1SetOrganisationDistributorPayload.d.ts +32 -0
  137. package/dist/models/V1SetOrganisationDistributorPayload.js +50 -0
  138. package/dist/models/V1SetUserNonBillablePayload.d.ts +32 -0
  139. package/dist/models/V1SetUserNonBillablePayload.js +50 -0
  140. package/dist/models/V1User.d.ts +50 -0
  141. package/dist/models/V1User.js +62 -0
  142. package/dist/models/V1UserServiceStatus.d.ts +44 -0
  143. package/dist/models/V1UserServiceStatus.js +58 -0
  144. package/dist/models/V1UserStatus.d.ts +33 -0
  145. package/dist/models/V1UserStatus.js +51 -0
  146. package/dist/models/index.d.ts +29 -0
  147. package/dist/models/index.js +47 -0
  148. package/dist/runtime.d.ts +184 -0
  149. package/dist/runtime.js +350 -0
  150. package/package.json +22 -0
  151. package/renovate.json +6 -0
  152. package/src/apis/DistributorV1Api.ts +117 -0
  153. package/src/apis/OrganizationV1Api.ts +784 -0
  154. package/src/apis/UserV1Api.ts +232 -0
  155. package/src/apis/index.ts +5 -0
  156. package/src/index.ts +5 -0
  157. package/src/models/ErrorCodes.ts +59 -0
  158. package/src/models/ErrorSchema.ts +84 -0
  159. package/src/models/SubscriptionCreationMode.ts +54 -0
  160. package/src/models/V1BillingStatus.ts +76 -0
  161. package/src/models/V1BillingType.ts +58 -0
  162. package/src/models/V1ChargebeeV1NotPaidInvoice.ts +83 -0
  163. package/src/models/V1ChargebeeV1PaymentDueInvoice.ts +83 -0
  164. package/src/models/V1ChargebeeV1PortalSession.ts +83 -0
  165. package/src/models/V1ChargebeeV1UnpaidInvoice.ts +83 -0
  166. package/src/models/V1CollectChargebeeV1Payment.ts +66 -0
  167. package/src/models/V1CreateChargebeeV1PortalSessionPayload.ts +65 -0
  168. package/src/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.ts +75 -0
  169. package/src/models/V1Distributor.ts +92 -0
  170. package/src/models/V1DistributorList.ts +74 -0
  171. package/src/models/V1MigrateLegacyBillingPayload.ts +75 -0
  172. package/src/models/V1Organization.ts +109 -0
  173. package/src/models/V1OrganizationChargebeeV1Status.ts +163 -0
  174. package/src/models/V1OrganizationStatus.ts +124 -0
  175. package/src/models/V1OrganizationStatusChargebeeV1Addon.ts +83 -0
  176. package/src/models/V1OrganizationStatusChargebeeV1User.ts +101 -0
  177. package/src/models/V1OrganizationStatusChargebeeV1UserBillingStatus.ts +68 -0
  178. package/src/models/V1SetChargebeeV1BillingPayorPayload.ts +66 -0
  179. package/src/models/V1SetChargebeeV1Payload.ts +94 -0
  180. package/src/models/V1SetLegacyBillingPayload.ts +93 -0
  181. package/src/models/V1SetOrganisationDistributorPayload.ts +66 -0
  182. package/src/models/V1SetUserNonBillablePayload.ts +66 -0
  183. package/src/models/V1User.ts +93 -0
  184. package/src/models/V1UserServiceStatus.ts +84 -0
  185. package/src/models/V1UserStatus.ts +74 -0
  186. package/src/models/index.ts +31 -0
  187. package/src/runtime.ts +432 -0
  188. package/tsconfig.esm.json +7 -0
  189. package/tsconfig.json +16 -0
@@ -0,0 +1,566 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Billing
6
+ * Micro-Service to handle billing
7
+ *
8
+ * The version of the OpenAPI document: 2.1.1-SNAPSHOT
9
+ * Contact: customersuccess@equisoft.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.OrganizationV1Api = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class OrganizationV1Api extends runtime.BaseAPI {
32
+ /**
33
+ * Collect all CHARGEBEE_V1 unpaid invoices for the organization
34
+ */
35
+ collectChargebeeV1PaymentRaw(requestParameters, initOverrides) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['uuid'] == null) {
38
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling collectChargebeeV1Payment().');
39
+ }
40
+ if (requestParameters['v1CollectChargebeeV1Payment'] == null) {
41
+ throw new runtime.RequiredError('v1CollectChargebeeV1Payment', 'Required parameter "v1CollectChargebeeV1Payment" was null or undefined when calling collectChargebeeV1Payment().');
42
+ }
43
+ const queryParameters = {};
44
+ const headerParameters = {};
45
+ headerParameters['Content-Type'] = 'application/json';
46
+ if (this.configuration && this.configuration.accessToken) {
47
+ // oauth required
48
+ const token = this.configuration.accessToken;
49
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
50
+ if (tokenString) {
51
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
52
+ }
53
+ }
54
+ const response = yield this.request({
55
+ path: `/v1/organizations/{uuid}/chargebeeV1Billing/collectPayment`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
56
+ method: 'POST',
57
+ headers: headerParameters,
58
+ query: queryParameters,
59
+ body: (0, index_1.V1CollectChargebeeV1PaymentToJSON)(requestParameters['v1CollectChargebeeV1Payment']),
60
+ }, initOverrides);
61
+ return new runtime.VoidApiResponse(response);
62
+ });
63
+ }
64
+ /**
65
+ * Collect all CHARGEBEE_V1 unpaid invoices for the organization
66
+ */
67
+ collectChargebeeV1Payment(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ yield this.collectChargebeeV1PaymentRaw(requestParameters, initOverrides);
70
+ });
71
+ }
72
+ /**
73
+ * Create a Chargebee V1 portal session for the organization
74
+ */
75
+ createChargebeeV1PortalSessionRaw(requestParameters, initOverrides) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ if (requestParameters['uuid'] == null) {
78
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling createChargebeeV1PortalSession().');
79
+ }
80
+ if (requestParameters['v1CreateChargebeeV1PortalSessionPayload'] == null) {
81
+ throw new runtime.RequiredError('v1CreateChargebeeV1PortalSessionPayload', 'Required parameter "v1CreateChargebeeV1PortalSessionPayload" was null or undefined when calling createChargebeeV1PortalSession().');
82
+ }
83
+ const queryParameters = {};
84
+ const headerParameters = {};
85
+ headerParameters['Content-Type'] = 'application/json';
86
+ if (this.configuration && this.configuration.accessToken) {
87
+ // oauth required
88
+ const token = this.configuration.accessToken;
89
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
90
+ if (tokenString) {
91
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
92
+ }
93
+ }
94
+ const response = yield this.request({
95
+ path: `/v1/organizations/{uuid}/chargebeeV1PortalSession`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
96
+ method: 'POST',
97
+ headers: headerParameters,
98
+ query: queryParameters,
99
+ body: (0, index_1.V1CreateChargebeeV1PortalSessionPayloadToJSON)(requestParameters['v1CreateChargebeeV1PortalSessionPayload']),
100
+ }, initOverrides);
101
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V1ChargebeeV1PortalSessionFromJSON)(jsonValue));
102
+ });
103
+ }
104
+ /**
105
+ * Create a Chargebee V1 portal session for the organization
106
+ */
107
+ createChargebeeV1PortalSession(requestParameters, initOverrides) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ const response = yield this.createChargebeeV1PortalSessionRaw(requestParameters, initOverrides);
110
+ return yield response.value();
111
+ });
112
+ }
113
+ /**
114
+ * Create or Update Chargebee v1 subscription
115
+ */
116
+ createOrUpdateSubscriptionRaw(requestParameters, initOverrides) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ if (requestParameters['uuid'] == null) {
119
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling createOrUpdateSubscription().');
120
+ }
121
+ if (requestParameters['v1CreateOrUpdateChargebeeV1SubscriptionPayload'] == null) {
122
+ throw new runtime.RequiredError('v1CreateOrUpdateChargebeeV1SubscriptionPayload', 'Required parameter "v1CreateOrUpdateChargebeeV1SubscriptionPayload" was null or undefined when calling createOrUpdateSubscription().');
123
+ }
124
+ const queryParameters = {};
125
+ const headerParameters = {};
126
+ headerParameters['Content-Type'] = 'application/json';
127
+ if (this.configuration && this.configuration.accessToken) {
128
+ // oauth required
129
+ const token = this.configuration.accessToken;
130
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
131
+ if (tokenString) {
132
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
133
+ }
134
+ }
135
+ const response = yield this.request({
136
+ path: `/v1/organizations/{uuid}/chargebeeV1Billing/subscription`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
137
+ method: 'POST',
138
+ headers: headerParameters,
139
+ query: queryParameters,
140
+ body: (0, index_1.V1CreateOrUpdateChargebeeV1SubscriptionPayloadToJSON)(requestParameters['v1CreateOrUpdateChargebeeV1SubscriptionPayload']),
141
+ }, initOverrides);
142
+ return new runtime.VoidApiResponse(response);
143
+ });
144
+ }
145
+ /**
146
+ * Create or Update Chargebee v1 subscription
147
+ */
148
+ createOrUpdateSubscription(requestParameters, initOverrides) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ yield this.createOrUpdateSubscriptionRaw(requestParameters, initOverrides);
151
+ });
152
+ }
153
+ /**
154
+ * Get billing information about an organization
155
+ */
156
+ getOrganizationRaw(requestParameters, initOverrides) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ if (requestParameters['uuid'] == null) {
159
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling getOrganization().');
160
+ }
161
+ const queryParameters = {};
162
+ const headerParameters = {};
163
+ if (this.configuration && this.configuration.accessToken) {
164
+ // oauth required
165
+ const token = this.configuration.accessToken;
166
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
167
+ if (tokenString) {
168
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
169
+ }
170
+ }
171
+ const response = yield this.request({
172
+ path: `/v1/organizations/{uuid}`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
173
+ method: 'GET',
174
+ headers: headerParameters,
175
+ query: queryParameters,
176
+ }, initOverrides);
177
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V1OrganizationFromJSON)(jsonValue));
178
+ });
179
+ }
180
+ /**
181
+ * Get billing information about an organization
182
+ */
183
+ getOrganization(requestParameters, initOverrides) {
184
+ return __awaiter(this, void 0, void 0, function* () {
185
+ const response = yield this.getOrganizationRaw(requestParameters, initOverrides);
186
+ return yield response.value();
187
+ });
188
+ }
189
+ /**
190
+ * Get detailed billing status about an organization
191
+ */
192
+ getOrganizationStatusRaw(requestParameters, initOverrides) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ if (requestParameters['uuid'] == null) {
195
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling getOrganizationStatus().');
196
+ }
197
+ const queryParameters = {};
198
+ const headerParameters = {};
199
+ if (this.configuration && this.configuration.accessToken) {
200
+ // oauth required
201
+ const token = this.configuration.accessToken;
202
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
203
+ if (tokenString) {
204
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
205
+ }
206
+ }
207
+ const response = yield this.request({
208
+ path: `/v1/organizations/{uuid}/status`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
209
+ method: 'GET',
210
+ headers: headerParameters,
211
+ query: queryParameters,
212
+ }, initOverrides);
213
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V1OrganizationStatusFromJSON)(jsonValue));
214
+ });
215
+ }
216
+ /**
217
+ * Get detailed billing status about an organization
218
+ */
219
+ getOrganizationStatus(requestParameters, initOverrides) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ const response = yield this.getOrganizationStatusRaw(requestParameters, initOverrides);
222
+ return yield response.value();
223
+ });
224
+ }
225
+ /**
226
+ * Migration organization from a legacy billing to Chargebee V1 billing
227
+ */
228
+ migrateLegacyBillingRaw(requestParameters, initOverrides) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ if (requestParameters['uuid'] == null) {
231
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling migrateLegacyBilling().');
232
+ }
233
+ if (requestParameters['v1MigrateLegacyBillingPayload'] == null) {
234
+ throw new runtime.RequiredError('v1MigrateLegacyBillingPayload', 'Required parameter "v1MigrateLegacyBillingPayload" was null or undefined when calling migrateLegacyBilling().');
235
+ }
236
+ const queryParameters = {};
237
+ const headerParameters = {};
238
+ headerParameters['Content-Type'] = 'application/json';
239
+ if (this.configuration && this.configuration.accessToken) {
240
+ // oauth required
241
+ const token = this.configuration.accessToken;
242
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
243
+ if (tokenString) {
244
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
245
+ }
246
+ }
247
+ const response = yield this.request({
248
+ path: `/v1/organizations/{uuid}/migrateLegacyBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
249
+ method: 'PUT',
250
+ headers: headerParameters,
251
+ query: queryParameters,
252
+ body: (0, index_1.V1MigrateLegacyBillingPayloadToJSON)(requestParameters['v1MigrateLegacyBillingPayload']),
253
+ }, initOverrides);
254
+ return new runtime.VoidApiResponse(response);
255
+ });
256
+ }
257
+ /**
258
+ * Migration organization from a legacy billing to Chargebee V1 billing
259
+ */
260
+ migrateLegacyBilling(requestParameters, initOverrides) {
261
+ return __awaiter(this, void 0, void 0, function* () {
262
+ yield this.migrateLegacyBillingRaw(requestParameters, initOverrides);
263
+ });
264
+ }
265
+ /**
266
+ * Set Chargebee V1 Billing for the organization
267
+ */
268
+ setChargebeeV1BillingRaw(requestParameters, initOverrides) {
269
+ return __awaiter(this, void 0, void 0, function* () {
270
+ if (requestParameters['uuid'] == null) {
271
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling setChargebeeV1Billing().');
272
+ }
273
+ if (requestParameters['v1SetChargebeeV1Payload'] == null) {
274
+ throw new runtime.RequiredError('v1SetChargebeeV1Payload', 'Required parameter "v1SetChargebeeV1Payload" was null or undefined when calling setChargebeeV1Billing().');
275
+ }
276
+ const queryParameters = {};
277
+ const headerParameters = {};
278
+ headerParameters['Content-Type'] = 'application/json';
279
+ if (this.configuration && this.configuration.accessToken) {
280
+ // oauth required
281
+ const token = this.configuration.accessToken;
282
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
283
+ if (tokenString) {
284
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
285
+ }
286
+ }
287
+ const response = yield this.request({
288
+ path: `/v1/organizations/{uuid}/chargebeeV1Billing`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
289
+ method: 'PUT',
290
+ headers: headerParameters,
291
+ query: queryParameters,
292
+ body: (0, index_1.V1SetChargebeeV1PayloadToJSON)(requestParameters['v1SetChargebeeV1Payload']),
293
+ }, initOverrides);
294
+ return new runtime.VoidApiResponse(response);
295
+ });
296
+ }
297
+ /**
298
+ * Set Chargebee V1 Billing for the organization
299
+ */
300
+ setChargebeeV1Billing(requestParameters, initOverrides) {
301
+ return __awaiter(this, void 0, void 0, function* () {
302
+ yield this.setChargebeeV1BillingRaw(requestParameters, initOverrides);
303
+ });
304
+ }
305
+ /**
306
+ * Set the distributor for an organization
307
+ */
308
+ setDistributorRaw(requestParameters, initOverrides) {
309
+ return __awaiter(this, void 0, void 0, function* () {
310
+ if (requestParameters['uuid'] == null) {
311
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling setDistributor().');
312
+ }
313
+ if (requestParameters['v1SetOrganisationDistributorPayload'] == null) {
314
+ throw new runtime.RequiredError('v1SetOrganisationDistributorPayload', 'Required parameter "v1SetOrganisationDistributorPayload" was null or undefined when calling setDistributor().');
315
+ }
316
+ const queryParameters = {};
317
+ const headerParameters = {};
318
+ headerParameters['Content-Type'] = 'application/json';
319
+ if (this.configuration && this.configuration.accessToken) {
320
+ // oauth required
321
+ const token = this.configuration.accessToken;
322
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
323
+ if (tokenString) {
324
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
325
+ }
326
+ }
327
+ const response = yield this.request({
328
+ path: `/v1/organizations/{uuid}/distributor`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
329
+ method: 'PUT',
330
+ headers: headerParameters,
331
+ query: queryParameters,
332
+ body: (0, index_1.V1SetOrganisationDistributorPayloadToJSON)(requestParameters['v1SetOrganisationDistributorPayload']),
333
+ }, initOverrides);
334
+ return new runtime.VoidApiResponse(response);
335
+ });
336
+ }
337
+ /**
338
+ * Set the distributor for an organization
339
+ */
340
+ setDistributor(requestParameters, initOverrides) {
341
+ return __awaiter(this, void 0, void 0, function* () {
342
+ yield this.setDistributorRaw(requestParameters, initOverrides);
343
+ });
344
+ }
345
+ /**
346
+ * Set Legacy Billing for the organization
347
+ */
348
+ setLegacyBillingRaw(requestParameters, initOverrides) {
349
+ return __awaiter(this, void 0, void 0, function* () {
350
+ if (requestParameters['uuid'] == null) {
351
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling setLegacyBilling().');
352
+ }
353
+ if (requestParameters['v1SetLegacyBillingPayload'] == null) {
354
+ throw new runtime.RequiredError('v1SetLegacyBillingPayload', 'Required parameter "v1SetLegacyBillingPayload" was null or undefined when calling setLegacyBilling().');
355
+ }
356
+ const queryParameters = {};
357
+ const headerParameters = {};
358
+ headerParameters['Content-Type'] = 'application/json';
359
+ if (this.configuration && this.configuration.accessToken) {
360
+ // oauth required
361
+ const token = this.configuration.accessToken;
362
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
363
+ if (tokenString) {
364
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
365
+ }
366
+ }
367
+ const response = yield this.request({
368
+ path: `/v1/organizations/{uuid}/legacyBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
369
+ method: 'PUT',
370
+ headers: headerParameters,
371
+ query: queryParameters,
372
+ body: (0, index_1.V1SetLegacyBillingPayloadToJSON)(requestParameters['v1SetLegacyBillingPayload']),
373
+ }, initOverrides);
374
+ return new runtime.VoidApiResponse(response);
375
+ });
376
+ }
377
+ /**
378
+ * Set Legacy Billing for the organization
379
+ */
380
+ setLegacyBilling(requestParameters, initOverrides) {
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ yield this.setLegacyBillingRaw(requestParameters, initOverrides);
383
+ });
384
+ }
385
+ /**
386
+ * Set Manual Billing for the organization
387
+ */
388
+ setManualBillingRaw(requestParameters, initOverrides) {
389
+ return __awaiter(this, void 0, void 0, function* () {
390
+ if (requestParameters['uuid'] == null) {
391
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling setManualBilling().');
392
+ }
393
+ const queryParameters = {};
394
+ const headerParameters = {};
395
+ if (this.configuration && this.configuration.accessToken) {
396
+ // oauth required
397
+ const token = this.configuration.accessToken;
398
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
399
+ if (tokenString) {
400
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
401
+ }
402
+ }
403
+ const response = yield this.request({
404
+ path: `/v1/organizations/{uuid}/manualBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
405
+ method: 'PUT',
406
+ headers: headerParameters,
407
+ query: queryParameters,
408
+ }, initOverrides);
409
+ return new runtime.VoidApiResponse(response);
410
+ });
411
+ }
412
+ /**
413
+ * Set Manual Billing for the organization
414
+ */
415
+ setManualBilling(requestParameters, initOverrides) {
416
+ return __awaiter(this, void 0, void 0, function* () {
417
+ yield this.setManualBillingRaw(requestParameters, initOverrides);
418
+ });
419
+ }
420
+ /**
421
+ * Set Non-Billable Billing for the organization
422
+ */
423
+ setNonBillableBillingRaw(requestParameters, initOverrides) {
424
+ return __awaiter(this, void 0, void 0, function* () {
425
+ if (requestParameters['uuid'] == null) {
426
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling setNonBillableBilling().');
427
+ }
428
+ const queryParameters = {};
429
+ const headerParameters = {};
430
+ if (this.configuration && this.configuration.accessToken) {
431
+ // oauth required
432
+ const token = this.configuration.accessToken;
433
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
434
+ if (tokenString) {
435
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
436
+ }
437
+ }
438
+ const response = yield this.request({
439
+ path: `/v1/organizations/{uuid}/nonBillableBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
440
+ method: 'PUT',
441
+ headers: headerParameters,
442
+ query: queryParameters,
443
+ }, initOverrides);
444
+ return new runtime.VoidApiResponse(response);
445
+ });
446
+ }
447
+ /**
448
+ * Set Non-Billable Billing for the organization
449
+ */
450
+ setNonBillableBilling(requestParameters, initOverrides) {
451
+ return __awaiter(this, void 0, void 0, function* () {
452
+ yield this.setNonBillableBillingRaw(requestParameters, initOverrides);
453
+ });
454
+ }
455
+ /**
456
+ * Set the payor user for Chargebee V1 billing
457
+ */
458
+ setPayorUserIdRaw(requestParameters, initOverrides) {
459
+ return __awaiter(this, void 0, void 0, function* () {
460
+ if (requestParameters['uuid'] == null) {
461
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling setPayorUserId().');
462
+ }
463
+ if (requestParameters['v1SetChargebeeV1BillingPayorPayload'] == null) {
464
+ throw new runtime.RequiredError('v1SetChargebeeV1BillingPayorPayload', 'Required parameter "v1SetChargebeeV1BillingPayorPayload" was null or undefined when calling setPayorUserId().');
465
+ }
466
+ const queryParameters = {};
467
+ const headerParameters = {};
468
+ headerParameters['Content-Type'] = 'application/json';
469
+ if (this.configuration && this.configuration.accessToken) {
470
+ // oauth required
471
+ const token = this.configuration.accessToken;
472
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
473
+ if (tokenString) {
474
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
475
+ }
476
+ }
477
+ const response = yield this.request({
478
+ path: `/v1/organizations/{uuid}/chargebeeV1Billing/payor`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
479
+ method: 'PUT',
480
+ headers: headerParameters,
481
+ query: queryParameters,
482
+ body: (0, index_1.V1SetChargebeeV1BillingPayorPayloadToJSON)(requestParameters['v1SetChargebeeV1BillingPayorPayload']),
483
+ }, initOverrides);
484
+ return new runtime.VoidApiResponse(response);
485
+ });
486
+ }
487
+ /**
488
+ * Set the payor user for Chargebee V1 billing
489
+ */
490
+ setPayorUserId(requestParameters, initOverrides) {
491
+ return __awaiter(this, void 0, void 0, function* () {
492
+ yield this.setPayorUserIdRaw(requestParameters, initOverrides);
493
+ });
494
+ }
495
+ /**
496
+ * Unset billing for the organization
497
+ */
498
+ unsetBillingRaw(requestParameters, initOverrides) {
499
+ return __awaiter(this, void 0, void 0, function* () {
500
+ if (requestParameters['uuid'] == null) {
501
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling unsetBilling().');
502
+ }
503
+ const queryParameters = {};
504
+ const headerParameters = {};
505
+ if (this.configuration && this.configuration.accessToken) {
506
+ // oauth required
507
+ const token = this.configuration.accessToken;
508
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
509
+ if (tokenString) {
510
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
511
+ }
512
+ }
513
+ const response = yield this.request({
514
+ path: `/v1/organizations/{uuid}/billing`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
515
+ method: 'DELETE',
516
+ headers: headerParameters,
517
+ query: queryParameters,
518
+ }, initOverrides);
519
+ return new runtime.VoidApiResponse(response);
520
+ });
521
+ }
522
+ /**
523
+ * Unset billing for the organization
524
+ */
525
+ unsetBilling(requestParameters, initOverrides) {
526
+ return __awaiter(this, void 0, void 0, function* () {
527
+ yield this.unsetBillingRaw(requestParameters, initOverrides);
528
+ });
529
+ }
530
+ /**
531
+ * Unset the distributor for an organization
532
+ */
533
+ unsetDistributorRaw(requestParameters, initOverrides) {
534
+ return __awaiter(this, void 0, void 0, function* () {
535
+ if (requestParameters['uuid'] == null) {
536
+ throw new runtime.RequiredError('uuid', 'Required parameter "uuid" was null or undefined when calling unsetDistributor().');
537
+ }
538
+ const queryParameters = {};
539
+ const headerParameters = {};
540
+ if (this.configuration && this.configuration.accessToken) {
541
+ // oauth required
542
+ const token = this.configuration.accessToken;
543
+ const tokenString = yield token("OAuth2", ["billing:organization"]);
544
+ if (tokenString) {
545
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
546
+ }
547
+ }
548
+ const response = yield this.request({
549
+ path: `/v1/organizations/{uuid}/distributor`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
550
+ method: 'DELETE',
551
+ headers: headerParameters,
552
+ query: queryParameters,
553
+ }, initOverrides);
554
+ return new runtime.VoidApiResponse(response);
555
+ });
556
+ }
557
+ /**
558
+ * Unset the distributor for an organization
559
+ */
560
+ unsetDistributor(requestParameters, initOverrides) {
561
+ return __awaiter(this, void 0, void 0, function* () {
562
+ yield this.unsetDistributorRaw(requestParameters, initOverrides);
563
+ });
564
+ }
565
+ }
566
+ exports.OrganizationV1Api = OrganizationV1Api;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Billing
3
+ * Micro-Service to handle billing
4
+ *
5
+ * The version of the OpenAPI document: 2.1.1-SNAPSHOT
6
+ * Contact: customersuccess@equisoft.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
+ import * as runtime from '../runtime';
13
+ import type { V1SetUserNonBillablePayload, V1User, V1UserStatus } from '../models/index';
14
+ export interface GetUserRequest {
15
+ uuid: string;
16
+ }
17
+ export interface GetUserStatusRequest {
18
+ uuid: string;
19
+ }
20
+ export interface SetNonBillableRequest {
21
+ uuid: string;
22
+ v1SetUserNonBillablePayload: V1SetUserNonBillablePayload;
23
+ }
24
+ export interface UnsetNonBillableRequest {
25
+ uuid: string;
26
+ }
27
+ /**
28
+ *
29
+ */
30
+ export declare class UserV1Api extends runtime.BaseAPI {
31
+ /**
32
+ * Get billing information about a User
33
+ */
34
+ getUserRaw(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V1User>>;
35
+ /**
36
+ * Get billing information about a User
37
+ */
38
+ getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V1User>;
39
+ /**
40
+ * Get billing status of a user
41
+ */
42
+ getUserStatusRaw(requestParameters: GetUserStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V1UserStatus>>;
43
+ /**
44
+ * Get billing status of a user
45
+ */
46
+ getUserStatus(requestParameters: GetUserStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V1UserStatus>;
47
+ /**
48
+ * Set the user non-billable
49
+ */
50
+ setNonBillableRaw(requestParameters: SetNonBillableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
51
+ /**
52
+ * Set the user non-billable
53
+ */
54
+ setNonBillable(requestParameters: SetNonBillableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
55
+ /**
56
+ * Remove the non-billable flag on the user
57
+ */
58
+ unsetNonBillableRaw(requestParameters: UnsetNonBillableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
59
+ /**
60
+ * Remove the non-billable flag on the user
61
+ */
62
+ unsetNonBillable(requestParameters: UnsetNonBillableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
63
+ }