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