@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.
- package/.openapi-generator/FILES +41 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +13 -0
- package/.tool-versions +3 -0
- package/README.md +46 -0
- package/dist/apis/DistributorV1Api.d.ts +37 -0
- package/dist/apis/DistributorV1Api.js +102 -0
- package/dist/apis/OrganizationV1Api.d.ts +180 -0
- package/dist/apis/OrganizationV1Api.js +566 -0
- package/dist/apis/UserV1Api.d.ts +63 -0
- package/dist/apis/UserV1Api.js +180 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +21 -0
- package/dist/esm/apis/DistributorV1Api.d.ts +37 -0
- package/dist/esm/apis/DistributorV1Api.js +98 -0
- package/dist/esm/apis/OrganizationV1Api.d.ts +180 -0
- package/dist/esm/apis/OrganizationV1Api.js +562 -0
- package/dist/esm/apis/UserV1Api.d.ts +63 -0
- package/dist/esm/apis/UserV1Api.js +176 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +5 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/ErrorCodes.d.ts +31 -0
- package/dist/esm/models/ErrorCodes.js +49 -0
- package/dist/esm/models/ErrorSchema.d.ts +39 -0
- package/dist/esm/models/ErrorSchema.js +46 -0
- package/dist/esm/models/SubscriptionCreationMode.d.ts +26 -0
- package/dist/esm/models/SubscriptionCreationMode.js +44 -0
- package/dist/esm/models/V1BillingStatus.d.ts +48 -0
- package/dist/esm/models/V1BillingStatus.js +66 -0
- package/dist/esm/models/V1BillingType.d.ts +30 -0
- package/dist/esm/models/V1BillingType.js +48 -0
- package/dist/esm/models/V1ChargebeeV1NotPaidInvoice.d.ts +44 -0
- package/dist/esm/models/V1ChargebeeV1NotPaidInvoice.js +49 -0
- package/dist/esm/models/V1ChargebeeV1PaymentDueInvoice.d.ts +44 -0
- package/dist/esm/models/V1ChargebeeV1PaymentDueInvoice.js +49 -0
- package/dist/esm/models/V1ChargebeeV1PortalSession.d.ts +44 -0
- package/dist/esm/models/V1ChargebeeV1PortalSession.js +49 -0
- package/dist/esm/models/V1ChargebeeV1UnpaidInvoice.d.ts +44 -0
- package/dist/esm/models/V1ChargebeeV1UnpaidInvoice.js +49 -0
- package/dist/esm/models/V1CollectChargebeeV1Payment.d.ts +32 -0
- package/dist/esm/models/V1CollectChargebeeV1Payment.js +43 -0
- package/dist/esm/models/V1CreateChargebeeV1PortalSessionPayload.d.ts +32 -0
- package/dist/esm/models/V1CreateChargebeeV1PortalSessionPayload.js +41 -0
- package/dist/esm/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.d.ts +38 -0
- package/dist/esm/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.js +47 -0
- package/dist/esm/models/V1Distributor.d.ts +50 -0
- package/dist/esm/models/V1Distributor.js +53 -0
- package/dist/esm/models/V1DistributorList.d.ts +33 -0
- package/dist/esm/models/V1DistributorList.js +44 -0
- package/dist/esm/models/V1MigrateLegacyBillingPayload.d.ts +38 -0
- package/dist/esm/models/V1MigrateLegacyBillingPayload.js +47 -0
- package/dist/esm/models/V1Organization.d.ts +57 -0
- package/dist/esm/models/V1Organization.js +54 -0
- package/dist/esm/models/V1OrganizationChargebeeV1Status.d.ts +79 -0
- package/dist/esm/models/V1OrganizationChargebeeV1Status.js +72 -0
- package/dist/esm/models/V1OrganizationStatus.d.ts +59 -0
- package/dist/esm/models/V1OrganizationStatus.js +58 -0
- package/dist/esm/models/V1OrganizationStatusChargebeeV1Addon.d.ts +44 -0
- package/dist/esm/models/V1OrganizationStatusChargebeeV1Addon.js +49 -0
- package/dist/esm/models/V1OrganizationStatusChargebeeV1User.d.ts +46 -0
- package/dist/esm/models/V1OrganizationStatusChargebeeV1User.js +53 -0
- package/dist/esm/models/V1OrganizationStatusChargebeeV1UserBillingStatus.d.ts +40 -0
- package/dist/esm/models/V1OrganizationStatusChargebeeV1UserBillingStatus.js +58 -0
- package/dist/esm/models/V1SetChargebeeV1BillingPayorPayload.d.ts +32 -0
- package/dist/esm/models/V1SetChargebeeV1BillingPayorPayload.js +43 -0
- package/dist/esm/models/V1SetChargebeeV1Payload.d.ts +45 -0
- package/dist/esm/models/V1SetChargebeeV1Payload.js +52 -0
- package/dist/esm/models/V1SetLegacyBillingPayload.d.ts +45 -0
- package/dist/esm/models/V1SetLegacyBillingPayload.js +50 -0
- package/dist/esm/models/V1SetOrganisationDistributorPayload.d.ts +32 -0
- package/dist/esm/models/V1SetOrganisationDistributorPayload.js +43 -0
- package/dist/esm/models/V1SetUserNonBillablePayload.d.ts +32 -0
- package/dist/esm/models/V1SetUserNonBillablePayload.js +43 -0
- package/dist/esm/models/V1User.d.ts +50 -0
- package/dist/esm/models/V1User.js +55 -0
- package/dist/esm/models/V1UserServiceStatus.d.ts +44 -0
- package/dist/esm/models/V1UserServiceStatus.js +51 -0
- package/dist/esm/models/V1UserStatus.d.ts +33 -0
- package/dist/esm/models/V1UserStatus.js +44 -0
- package/dist/esm/models/index.d.ts +29 -0
- package/dist/esm/models/index.js +31 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/ErrorCodes.d.ts +31 -0
- package/dist/models/ErrorCodes.js +57 -0
- package/dist/models/ErrorSchema.d.ts +39 -0
- package/dist/models/ErrorSchema.js +53 -0
- package/dist/models/SubscriptionCreationMode.d.ts +26 -0
- package/dist/models/SubscriptionCreationMode.js +52 -0
- package/dist/models/V1BillingStatus.d.ts +48 -0
- package/dist/models/V1BillingStatus.js +74 -0
- package/dist/models/V1BillingType.d.ts +30 -0
- package/dist/models/V1BillingType.js +56 -0
- package/dist/models/V1ChargebeeV1NotPaidInvoice.d.ts +44 -0
- package/dist/models/V1ChargebeeV1NotPaidInvoice.js +56 -0
- package/dist/models/V1ChargebeeV1PaymentDueInvoice.d.ts +44 -0
- package/dist/models/V1ChargebeeV1PaymentDueInvoice.js +56 -0
- package/dist/models/V1ChargebeeV1PortalSession.d.ts +44 -0
- package/dist/models/V1ChargebeeV1PortalSession.js +56 -0
- package/dist/models/V1ChargebeeV1UnpaidInvoice.d.ts +44 -0
- package/dist/models/V1ChargebeeV1UnpaidInvoice.js +56 -0
- package/dist/models/V1CollectChargebeeV1Payment.d.ts +32 -0
- package/dist/models/V1CollectChargebeeV1Payment.js +50 -0
- package/dist/models/V1CreateChargebeeV1PortalSessionPayload.d.ts +32 -0
- package/dist/models/V1CreateChargebeeV1PortalSessionPayload.js +48 -0
- package/dist/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.d.ts +38 -0
- package/dist/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.js +54 -0
- package/dist/models/V1Distributor.d.ts +50 -0
- package/dist/models/V1Distributor.js +60 -0
- package/dist/models/V1DistributorList.d.ts +33 -0
- package/dist/models/V1DistributorList.js +51 -0
- package/dist/models/V1MigrateLegacyBillingPayload.d.ts +38 -0
- package/dist/models/V1MigrateLegacyBillingPayload.js +54 -0
- package/dist/models/V1Organization.d.ts +57 -0
- package/dist/models/V1Organization.js +61 -0
- package/dist/models/V1OrganizationChargebeeV1Status.d.ts +79 -0
- package/dist/models/V1OrganizationChargebeeV1Status.js +79 -0
- package/dist/models/V1OrganizationStatus.d.ts +59 -0
- package/dist/models/V1OrganizationStatus.js +65 -0
- package/dist/models/V1OrganizationStatusChargebeeV1Addon.d.ts +44 -0
- package/dist/models/V1OrganizationStatusChargebeeV1Addon.js +56 -0
- package/dist/models/V1OrganizationStatusChargebeeV1User.d.ts +46 -0
- package/dist/models/V1OrganizationStatusChargebeeV1User.js +60 -0
- package/dist/models/V1OrganizationStatusChargebeeV1UserBillingStatus.d.ts +40 -0
- package/dist/models/V1OrganizationStatusChargebeeV1UserBillingStatus.js +66 -0
- package/dist/models/V1SetChargebeeV1BillingPayorPayload.d.ts +32 -0
- package/dist/models/V1SetChargebeeV1BillingPayorPayload.js +50 -0
- package/dist/models/V1SetChargebeeV1Payload.d.ts +45 -0
- package/dist/models/V1SetChargebeeV1Payload.js +59 -0
- package/dist/models/V1SetLegacyBillingPayload.d.ts +45 -0
- package/dist/models/V1SetLegacyBillingPayload.js +57 -0
- package/dist/models/V1SetOrganisationDistributorPayload.d.ts +32 -0
- package/dist/models/V1SetOrganisationDistributorPayload.js +50 -0
- package/dist/models/V1SetUserNonBillablePayload.d.ts +32 -0
- package/dist/models/V1SetUserNonBillablePayload.js +50 -0
- package/dist/models/V1User.d.ts +50 -0
- package/dist/models/V1User.js +62 -0
- package/dist/models/V1UserServiceStatus.d.ts +44 -0
- package/dist/models/V1UserServiceStatus.js +58 -0
- package/dist/models/V1UserStatus.d.ts +33 -0
- package/dist/models/V1UserStatus.js +51 -0
- package/dist/models/index.d.ts +29 -0
- package/dist/models/index.js +47 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/package.json +22 -0
- package/renovate.json +6 -0
- package/src/apis/DistributorV1Api.ts +117 -0
- package/src/apis/OrganizationV1Api.ts +784 -0
- package/src/apis/UserV1Api.ts +232 -0
- package/src/apis/index.ts +5 -0
- package/src/index.ts +5 -0
- package/src/models/ErrorCodes.ts +59 -0
- package/src/models/ErrorSchema.ts +84 -0
- package/src/models/SubscriptionCreationMode.ts +54 -0
- package/src/models/V1BillingStatus.ts +76 -0
- package/src/models/V1BillingType.ts +58 -0
- package/src/models/V1ChargebeeV1NotPaidInvoice.ts +83 -0
- package/src/models/V1ChargebeeV1PaymentDueInvoice.ts +83 -0
- package/src/models/V1ChargebeeV1PortalSession.ts +83 -0
- package/src/models/V1ChargebeeV1UnpaidInvoice.ts +83 -0
- package/src/models/V1CollectChargebeeV1Payment.ts +66 -0
- package/src/models/V1CreateChargebeeV1PortalSessionPayload.ts +65 -0
- package/src/models/V1CreateOrUpdateChargebeeV1SubscriptionPayload.ts +75 -0
- package/src/models/V1Distributor.ts +92 -0
- package/src/models/V1DistributorList.ts +74 -0
- package/src/models/V1MigrateLegacyBillingPayload.ts +75 -0
- package/src/models/V1Organization.ts +109 -0
- package/src/models/V1OrganizationChargebeeV1Status.ts +163 -0
- package/src/models/V1OrganizationStatus.ts +124 -0
- package/src/models/V1OrganizationStatusChargebeeV1Addon.ts +83 -0
- package/src/models/V1OrganizationStatusChargebeeV1User.ts +101 -0
- package/src/models/V1OrganizationStatusChargebeeV1UserBillingStatus.ts +68 -0
- package/src/models/V1SetChargebeeV1BillingPayorPayload.ts +66 -0
- package/src/models/V1SetChargebeeV1Payload.ts +94 -0
- package/src/models/V1SetLegacyBillingPayload.ts +93 -0
- package/src/models/V1SetOrganisationDistributorPayload.ts +66 -0
- package/src/models/V1SetUserNonBillablePayload.ts +66 -0
- package/src/models/V1User.ts +93 -0
- package/src/models/V1UserServiceStatus.ts +84 -0
- package/src/models/V1UserStatus.ts +74 -0
- package/src/models/index.ts +31 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,784 @@
|
|
|
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
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ErrorSchema,
|
|
19
|
+
V1ChargebeeV1PortalSession,
|
|
20
|
+
V1CollectChargebeeV1Payment,
|
|
21
|
+
V1CreateChargebeeV1PortalSessionPayload,
|
|
22
|
+
V1CreateOrUpdateChargebeeV1SubscriptionPayload,
|
|
23
|
+
V1MigrateLegacyBillingPayload,
|
|
24
|
+
V1Organization,
|
|
25
|
+
V1OrganizationStatus,
|
|
26
|
+
V1SetChargebeeV1BillingPayorPayload,
|
|
27
|
+
V1SetChargebeeV1Payload,
|
|
28
|
+
V1SetLegacyBillingPayload,
|
|
29
|
+
V1SetOrganisationDistributorPayload,
|
|
30
|
+
} from '../models/index';
|
|
31
|
+
import {
|
|
32
|
+
ErrorSchemaFromJSON,
|
|
33
|
+
ErrorSchemaToJSON,
|
|
34
|
+
V1ChargebeeV1PortalSessionFromJSON,
|
|
35
|
+
V1ChargebeeV1PortalSessionToJSON,
|
|
36
|
+
V1CollectChargebeeV1PaymentFromJSON,
|
|
37
|
+
V1CollectChargebeeV1PaymentToJSON,
|
|
38
|
+
V1CreateChargebeeV1PortalSessionPayloadFromJSON,
|
|
39
|
+
V1CreateChargebeeV1PortalSessionPayloadToJSON,
|
|
40
|
+
V1CreateOrUpdateChargebeeV1SubscriptionPayloadFromJSON,
|
|
41
|
+
V1CreateOrUpdateChargebeeV1SubscriptionPayloadToJSON,
|
|
42
|
+
V1MigrateLegacyBillingPayloadFromJSON,
|
|
43
|
+
V1MigrateLegacyBillingPayloadToJSON,
|
|
44
|
+
V1OrganizationFromJSON,
|
|
45
|
+
V1OrganizationToJSON,
|
|
46
|
+
V1OrganizationStatusFromJSON,
|
|
47
|
+
V1OrganizationStatusToJSON,
|
|
48
|
+
V1SetChargebeeV1BillingPayorPayloadFromJSON,
|
|
49
|
+
V1SetChargebeeV1BillingPayorPayloadToJSON,
|
|
50
|
+
V1SetChargebeeV1PayloadFromJSON,
|
|
51
|
+
V1SetChargebeeV1PayloadToJSON,
|
|
52
|
+
V1SetLegacyBillingPayloadFromJSON,
|
|
53
|
+
V1SetLegacyBillingPayloadToJSON,
|
|
54
|
+
V1SetOrganisationDistributorPayloadFromJSON,
|
|
55
|
+
V1SetOrganisationDistributorPayloadToJSON,
|
|
56
|
+
} from '../models/index';
|
|
57
|
+
|
|
58
|
+
export interface CollectChargebeeV1PaymentRequest {
|
|
59
|
+
uuid: string;
|
|
60
|
+
v1CollectChargebeeV1Payment: V1CollectChargebeeV1Payment;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface CreateChargebeeV1PortalSessionRequest {
|
|
64
|
+
uuid: string;
|
|
65
|
+
v1CreateChargebeeV1PortalSessionPayload: V1CreateChargebeeV1PortalSessionPayload;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface CreateOrUpdateSubscriptionRequest {
|
|
69
|
+
uuid: string;
|
|
70
|
+
v1CreateOrUpdateChargebeeV1SubscriptionPayload: V1CreateOrUpdateChargebeeV1SubscriptionPayload;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface GetOrganizationRequest {
|
|
74
|
+
uuid: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface GetOrganizationStatusRequest {
|
|
78
|
+
uuid: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface MigrateLegacyBillingRequest {
|
|
82
|
+
uuid: string;
|
|
83
|
+
v1MigrateLegacyBillingPayload: V1MigrateLegacyBillingPayload;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface SetChargebeeV1BillingRequest {
|
|
87
|
+
uuid: string;
|
|
88
|
+
v1SetChargebeeV1Payload: V1SetChargebeeV1Payload;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface SetDistributorRequest {
|
|
92
|
+
uuid: string;
|
|
93
|
+
v1SetOrganisationDistributorPayload: V1SetOrganisationDistributorPayload;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface SetLegacyBillingRequest {
|
|
97
|
+
uuid: string;
|
|
98
|
+
v1SetLegacyBillingPayload: V1SetLegacyBillingPayload;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface SetManualBillingRequest {
|
|
102
|
+
uuid: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface SetNonBillableBillingRequest {
|
|
106
|
+
uuid: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface SetPayorUserIdRequest {
|
|
110
|
+
uuid: string;
|
|
111
|
+
v1SetChargebeeV1BillingPayorPayload: V1SetChargebeeV1BillingPayorPayload;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface UnsetBillingRequest {
|
|
115
|
+
uuid: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface UnsetDistributorRequest {
|
|
119
|
+
uuid: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
export class OrganizationV1Api extends runtime.BaseAPI {
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Collect all CHARGEBEE_V1 unpaid invoices for the organization
|
|
129
|
+
*/
|
|
130
|
+
async collectChargebeeV1PaymentRaw(requestParameters: CollectChargebeeV1PaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
131
|
+
if (requestParameters['uuid'] == null) {
|
|
132
|
+
throw new runtime.RequiredError(
|
|
133
|
+
'uuid',
|
|
134
|
+
'Required parameter "uuid" was null or undefined when calling collectChargebeeV1Payment().'
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (requestParameters['v1CollectChargebeeV1Payment'] == null) {
|
|
139
|
+
throw new runtime.RequiredError(
|
|
140
|
+
'v1CollectChargebeeV1Payment',
|
|
141
|
+
'Required parameter "v1CollectChargebeeV1Payment" was null or undefined when calling collectChargebeeV1Payment().'
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const queryParameters: any = {};
|
|
146
|
+
|
|
147
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
148
|
+
|
|
149
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
150
|
+
|
|
151
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
152
|
+
// oauth required
|
|
153
|
+
const token = this.configuration.accessToken;
|
|
154
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
155
|
+
if (tokenString) {
|
|
156
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const response = await this.request({
|
|
161
|
+
path: `/v1/organizations/{uuid}/chargebeeV1Billing/collectPayment`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
162
|
+
method: 'POST',
|
|
163
|
+
headers: headerParameters,
|
|
164
|
+
query: queryParameters,
|
|
165
|
+
body: V1CollectChargebeeV1PaymentToJSON(requestParameters['v1CollectChargebeeV1Payment']),
|
|
166
|
+
}, initOverrides);
|
|
167
|
+
|
|
168
|
+
return new runtime.VoidApiResponse(response);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Collect all CHARGEBEE_V1 unpaid invoices for the organization
|
|
173
|
+
*/
|
|
174
|
+
async collectChargebeeV1Payment(requestParameters: CollectChargebeeV1PaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
175
|
+
await this.collectChargebeeV1PaymentRaw(requestParameters, initOverrides);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Create a Chargebee V1 portal session for the organization
|
|
180
|
+
*/
|
|
181
|
+
async createChargebeeV1PortalSessionRaw(requestParameters: CreateChargebeeV1PortalSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V1ChargebeeV1PortalSession>> {
|
|
182
|
+
if (requestParameters['uuid'] == null) {
|
|
183
|
+
throw new runtime.RequiredError(
|
|
184
|
+
'uuid',
|
|
185
|
+
'Required parameter "uuid" was null or undefined when calling createChargebeeV1PortalSession().'
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (requestParameters['v1CreateChargebeeV1PortalSessionPayload'] == null) {
|
|
190
|
+
throw new runtime.RequiredError(
|
|
191
|
+
'v1CreateChargebeeV1PortalSessionPayload',
|
|
192
|
+
'Required parameter "v1CreateChargebeeV1PortalSessionPayload" was null or undefined when calling createChargebeeV1PortalSession().'
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const queryParameters: any = {};
|
|
197
|
+
|
|
198
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
199
|
+
|
|
200
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
201
|
+
|
|
202
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
203
|
+
// oauth required
|
|
204
|
+
const token = this.configuration.accessToken;
|
|
205
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
206
|
+
if (tokenString) {
|
|
207
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const response = await this.request({
|
|
212
|
+
path: `/v1/organizations/{uuid}/chargebeeV1PortalSession`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
213
|
+
method: 'POST',
|
|
214
|
+
headers: headerParameters,
|
|
215
|
+
query: queryParameters,
|
|
216
|
+
body: V1CreateChargebeeV1PortalSessionPayloadToJSON(requestParameters['v1CreateChargebeeV1PortalSessionPayload']),
|
|
217
|
+
}, initOverrides);
|
|
218
|
+
|
|
219
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => V1ChargebeeV1PortalSessionFromJSON(jsonValue));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Create a Chargebee V1 portal session for the organization
|
|
224
|
+
*/
|
|
225
|
+
async createChargebeeV1PortalSession(requestParameters: CreateChargebeeV1PortalSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V1ChargebeeV1PortalSession> {
|
|
226
|
+
const response = await this.createChargebeeV1PortalSessionRaw(requestParameters, initOverrides);
|
|
227
|
+
return await response.value();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Create or Update Chargebee v1 subscription
|
|
232
|
+
*/
|
|
233
|
+
async createOrUpdateSubscriptionRaw(requestParameters: CreateOrUpdateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
234
|
+
if (requestParameters['uuid'] == null) {
|
|
235
|
+
throw new runtime.RequiredError(
|
|
236
|
+
'uuid',
|
|
237
|
+
'Required parameter "uuid" was null or undefined when calling createOrUpdateSubscription().'
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (requestParameters['v1CreateOrUpdateChargebeeV1SubscriptionPayload'] == null) {
|
|
242
|
+
throw new runtime.RequiredError(
|
|
243
|
+
'v1CreateOrUpdateChargebeeV1SubscriptionPayload',
|
|
244
|
+
'Required parameter "v1CreateOrUpdateChargebeeV1SubscriptionPayload" was null or undefined when calling createOrUpdateSubscription().'
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const queryParameters: any = {};
|
|
249
|
+
|
|
250
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
251
|
+
|
|
252
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
253
|
+
|
|
254
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
255
|
+
// oauth required
|
|
256
|
+
const token = this.configuration.accessToken;
|
|
257
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
258
|
+
if (tokenString) {
|
|
259
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const response = await this.request({
|
|
264
|
+
path: `/v1/organizations/{uuid}/chargebeeV1Billing/subscription`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
265
|
+
method: 'POST',
|
|
266
|
+
headers: headerParameters,
|
|
267
|
+
query: queryParameters,
|
|
268
|
+
body: V1CreateOrUpdateChargebeeV1SubscriptionPayloadToJSON(requestParameters['v1CreateOrUpdateChargebeeV1SubscriptionPayload']),
|
|
269
|
+
}, initOverrides);
|
|
270
|
+
|
|
271
|
+
return new runtime.VoidApiResponse(response);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Create or Update Chargebee v1 subscription
|
|
276
|
+
*/
|
|
277
|
+
async createOrUpdateSubscription(requestParameters: CreateOrUpdateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
278
|
+
await this.createOrUpdateSubscriptionRaw(requestParameters, initOverrides);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Get billing information about an organization
|
|
283
|
+
*/
|
|
284
|
+
async getOrganizationRaw(requestParameters: GetOrganizationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V1Organization>> {
|
|
285
|
+
if (requestParameters['uuid'] == null) {
|
|
286
|
+
throw new runtime.RequiredError(
|
|
287
|
+
'uuid',
|
|
288
|
+
'Required parameter "uuid" was null or undefined when calling getOrganization().'
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const queryParameters: any = {};
|
|
293
|
+
|
|
294
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
295
|
+
|
|
296
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
297
|
+
// oauth required
|
|
298
|
+
const token = this.configuration.accessToken;
|
|
299
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
300
|
+
if (tokenString) {
|
|
301
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const response = await this.request({
|
|
306
|
+
path: `/v1/organizations/{uuid}`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
307
|
+
method: 'GET',
|
|
308
|
+
headers: headerParameters,
|
|
309
|
+
query: queryParameters,
|
|
310
|
+
}, initOverrides);
|
|
311
|
+
|
|
312
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => V1OrganizationFromJSON(jsonValue));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Get billing information about an organization
|
|
317
|
+
*/
|
|
318
|
+
async getOrganization(requestParameters: GetOrganizationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V1Organization> {
|
|
319
|
+
const response = await this.getOrganizationRaw(requestParameters, initOverrides);
|
|
320
|
+
return await response.value();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Get detailed billing status about an organization
|
|
325
|
+
*/
|
|
326
|
+
async getOrganizationStatusRaw(requestParameters: GetOrganizationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V1OrganizationStatus>> {
|
|
327
|
+
if (requestParameters['uuid'] == null) {
|
|
328
|
+
throw new runtime.RequiredError(
|
|
329
|
+
'uuid',
|
|
330
|
+
'Required parameter "uuid" was null or undefined when calling getOrganizationStatus().'
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const queryParameters: any = {};
|
|
335
|
+
|
|
336
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
337
|
+
|
|
338
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
339
|
+
// oauth required
|
|
340
|
+
const token = this.configuration.accessToken;
|
|
341
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
342
|
+
if (tokenString) {
|
|
343
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const response = await this.request({
|
|
348
|
+
path: `/v1/organizations/{uuid}/status`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
349
|
+
method: 'GET',
|
|
350
|
+
headers: headerParameters,
|
|
351
|
+
query: queryParameters,
|
|
352
|
+
}, initOverrides);
|
|
353
|
+
|
|
354
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => V1OrganizationStatusFromJSON(jsonValue));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Get detailed billing status about an organization
|
|
359
|
+
*/
|
|
360
|
+
async getOrganizationStatus(requestParameters: GetOrganizationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V1OrganizationStatus> {
|
|
361
|
+
const response = await this.getOrganizationStatusRaw(requestParameters, initOverrides);
|
|
362
|
+
return await response.value();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Migration organization from a legacy billing to Chargebee V1 billing
|
|
367
|
+
*/
|
|
368
|
+
async migrateLegacyBillingRaw(requestParameters: MigrateLegacyBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
369
|
+
if (requestParameters['uuid'] == null) {
|
|
370
|
+
throw new runtime.RequiredError(
|
|
371
|
+
'uuid',
|
|
372
|
+
'Required parameter "uuid" was null or undefined when calling migrateLegacyBilling().'
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (requestParameters['v1MigrateLegacyBillingPayload'] == null) {
|
|
377
|
+
throw new runtime.RequiredError(
|
|
378
|
+
'v1MigrateLegacyBillingPayload',
|
|
379
|
+
'Required parameter "v1MigrateLegacyBillingPayload" was null or undefined when calling migrateLegacyBilling().'
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const queryParameters: any = {};
|
|
384
|
+
|
|
385
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
386
|
+
|
|
387
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
388
|
+
|
|
389
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
390
|
+
// oauth required
|
|
391
|
+
const token = this.configuration.accessToken;
|
|
392
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
393
|
+
if (tokenString) {
|
|
394
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const response = await this.request({
|
|
399
|
+
path: `/v1/organizations/{uuid}/migrateLegacyBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
400
|
+
method: 'PUT',
|
|
401
|
+
headers: headerParameters,
|
|
402
|
+
query: queryParameters,
|
|
403
|
+
body: V1MigrateLegacyBillingPayloadToJSON(requestParameters['v1MigrateLegacyBillingPayload']),
|
|
404
|
+
}, initOverrides);
|
|
405
|
+
|
|
406
|
+
return new runtime.VoidApiResponse(response);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Migration organization from a legacy billing to Chargebee V1 billing
|
|
411
|
+
*/
|
|
412
|
+
async migrateLegacyBilling(requestParameters: MigrateLegacyBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
413
|
+
await this.migrateLegacyBillingRaw(requestParameters, initOverrides);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Set Chargebee V1 Billing for the organization
|
|
418
|
+
*/
|
|
419
|
+
async setChargebeeV1BillingRaw(requestParameters: SetChargebeeV1BillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
420
|
+
if (requestParameters['uuid'] == null) {
|
|
421
|
+
throw new runtime.RequiredError(
|
|
422
|
+
'uuid',
|
|
423
|
+
'Required parameter "uuid" was null or undefined when calling setChargebeeV1Billing().'
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (requestParameters['v1SetChargebeeV1Payload'] == null) {
|
|
428
|
+
throw new runtime.RequiredError(
|
|
429
|
+
'v1SetChargebeeV1Payload',
|
|
430
|
+
'Required parameter "v1SetChargebeeV1Payload" was null or undefined when calling setChargebeeV1Billing().'
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const queryParameters: any = {};
|
|
435
|
+
|
|
436
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
437
|
+
|
|
438
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
439
|
+
|
|
440
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
441
|
+
// oauth required
|
|
442
|
+
const token = this.configuration.accessToken;
|
|
443
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
444
|
+
if (tokenString) {
|
|
445
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const response = await this.request({
|
|
450
|
+
path: `/v1/organizations/{uuid}/chargebeeV1Billing`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
451
|
+
method: 'PUT',
|
|
452
|
+
headers: headerParameters,
|
|
453
|
+
query: queryParameters,
|
|
454
|
+
body: V1SetChargebeeV1PayloadToJSON(requestParameters['v1SetChargebeeV1Payload']),
|
|
455
|
+
}, initOverrides);
|
|
456
|
+
|
|
457
|
+
return new runtime.VoidApiResponse(response);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Set Chargebee V1 Billing for the organization
|
|
462
|
+
*/
|
|
463
|
+
async setChargebeeV1Billing(requestParameters: SetChargebeeV1BillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
464
|
+
await this.setChargebeeV1BillingRaw(requestParameters, initOverrides);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Set the distributor for an organization
|
|
469
|
+
*/
|
|
470
|
+
async setDistributorRaw(requestParameters: SetDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
471
|
+
if (requestParameters['uuid'] == null) {
|
|
472
|
+
throw new runtime.RequiredError(
|
|
473
|
+
'uuid',
|
|
474
|
+
'Required parameter "uuid" was null or undefined when calling setDistributor().'
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (requestParameters['v1SetOrganisationDistributorPayload'] == null) {
|
|
479
|
+
throw new runtime.RequiredError(
|
|
480
|
+
'v1SetOrganisationDistributorPayload',
|
|
481
|
+
'Required parameter "v1SetOrganisationDistributorPayload" was null or undefined when calling setDistributor().'
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const queryParameters: any = {};
|
|
486
|
+
|
|
487
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
488
|
+
|
|
489
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
490
|
+
|
|
491
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
492
|
+
// oauth required
|
|
493
|
+
const token = this.configuration.accessToken;
|
|
494
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
495
|
+
if (tokenString) {
|
|
496
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
const response = await this.request({
|
|
501
|
+
path: `/v1/organizations/{uuid}/distributor`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
502
|
+
method: 'PUT',
|
|
503
|
+
headers: headerParameters,
|
|
504
|
+
query: queryParameters,
|
|
505
|
+
body: V1SetOrganisationDistributorPayloadToJSON(requestParameters['v1SetOrganisationDistributorPayload']),
|
|
506
|
+
}, initOverrides);
|
|
507
|
+
|
|
508
|
+
return new runtime.VoidApiResponse(response);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Set the distributor for an organization
|
|
513
|
+
*/
|
|
514
|
+
async setDistributor(requestParameters: SetDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
515
|
+
await this.setDistributorRaw(requestParameters, initOverrides);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Set Legacy Billing for the organization
|
|
520
|
+
*/
|
|
521
|
+
async setLegacyBillingRaw(requestParameters: SetLegacyBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
522
|
+
if (requestParameters['uuid'] == null) {
|
|
523
|
+
throw new runtime.RequiredError(
|
|
524
|
+
'uuid',
|
|
525
|
+
'Required parameter "uuid" was null or undefined when calling setLegacyBilling().'
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if (requestParameters['v1SetLegacyBillingPayload'] == null) {
|
|
530
|
+
throw new runtime.RequiredError(
|
|
531
|
+
'v1SetLegacyBillingPayload',
|
|
532
|
+
'Required parameter "v1SetLegacyBillingPayload" was null or undefined when calling setLegacyBilling().'
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
const queryParameters: any = {};
|
|
537
|
+
|
|
538
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
539
|
+
|
|
540
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
541
|
+
|
|
542
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
543
|
+
// oauth required
|
|
544
|
+
const token = this.configuration.accessToken;
|
|
545
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
546
|
+
if (tokenString) {
|
|
547
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
const response = await this.request({
|
|
552
|
+
path: `/v1/organizations/{uuid}/legacyBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
553
|
+
method: 'PUT',
|
|
554
|
+
headers: headerParameters,
|
|
555
|
+
query: queryParameters,
|
|
556
|
+
body: V1SetLegacyBillingPayloadToJSON(requestParameters['v1SetLegacyBillingPayload']),
|
|
557
|
+
}, initOverrides);
|
|
558
|
+
|
|
559
|
+
return new runtime.VoidApiResponse(response);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Set Legacy Billing for the organization
|
|
564
|
+
*/
|
|
565
|
+
async setLegacyBilling(requestParameters: SetLegacyBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
566
|
+
await this.setLegacyBillingRaw(requestParameters, initOverrides);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Set Manual Billing for the organization
|
|
571
|
+
*/
|
|
572
|
+
async setManualBillingRaw(requestParameters: SetManualBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
573
|
+
if (requestParameters['uuid'] == null) {
|
|
574
|
+
throw new runtime.RequiredError(
|
|
575
|
+
'uuid',
|
|
576
|
+
'Required parameter "uuid" was null or undefined when calling setManualBilling().'
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
const queryParameters: any = {};
|
|
581
|
+
|
|
582
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
583
|
+
|
|
584
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
585
|
+
// oauth required
|
|
586
|
+
const token = this.configuration.accessToken;
|
|
587
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
588
|
+
if (tokenString) {
|
|
589
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
const response = await this.request({
|
|
594
|
+
path: `/v1/organizations/{uuid}/manualBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
595
|
+
method: 'PUT',
|
|
596
|
+
headers: headerParameters,
|
|
597
|
+
query: queryParameters,
|
|
598
|
+
}, initOverrides);
|
|
599
|
+
|
|
600
|
+
return new runtime.VoidApiResponse(response);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Set Manual Billing for the organization
|
|
605
|
+
*/
|
|
606
|
+
async setManualBilling(requestParameters: SetManualBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
607
|
+
await this.setManualBillingRaw(requestParameters, initOverrides);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Set Non-Billable Billing for the organization
|
|
612
|
+
*/
|
|
613
|
+
async setNonBillableBillingRaw(requestParameters: SetNonBillableBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
614
|
+
if (requestParameters['uuid'] == null) {
|
|
615
|
+
throw new runtime.RequiredError(
|
|
616
|
+
'uuid',
|
|
617
|
+
'Required parameter "uuid" was null or undefined when calling setNonBillableBilling().'
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const queryParameters: any = {};
|
|
622
|
+
|
|
623
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
624
|
+
|
|
625
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
626
|
+
// oauth required
|
|
627
|
+
const token = this.configuration.accessToken;
|
|
628
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
629
|
+
if (tokenString) {
|
|
630
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
const response = await this.request({
|
|
635
|
+
path: `/v1/organizations/{uuid}/nonBillableBilling`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
636
|
+
method: 'PUT',
|
|
637
|
+
headers: headerParameters,
|
|
638
|
+
query: queryParameters,
|
|
639
|
+
}, initOverrides);
|
|
640
|
+
|
|
641
|
+
return new runtime.VoidApiResponse(response);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Set Non-Billable Billing for the organization
|
|
646
|
+
*/
|
|
647
|
+
async setNonBillableBilling(requestParameters: SetNonBillableBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
648
|
+
await this.setNonBillableBillingRaw(requestParameters, initOverrides);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Set the payor user for Chargebee V1 billing
|
|
653
|
+
*/
|
|
654
|
+
async setPayorUserIdRaw(requestParameters: SetPayorUserIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
655
|
+
if (requestParameters['uuid'] == null) {
|
|
656
|
+
throw new runtime.RequiredError(
|
|
657
|
+
'uuid',
|
|
658
|
+
'Required parameter "uuid" was null or undefined when calling setPayorUserId().'
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
if (requestParameters['v1SetChargebeeV1BillingPayorPayload'] == null) {
|
|
663
|
+
throw new runtime.RequiredError(
|
|
664
|
+
'v1SetChargebeeV1BillingPayorPayload',
|
|
665
|
+
'Required parameter "v1SetChargebeeV1BillingPayorPayload" was null or undefined when calling setPayorUserId().'
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const queryParameters: any = {};
|
|
670
|
+
|
|
671
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
672
|
+
|
|
673
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
674
|
+
|
|
675
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
676
|
+
// oauth required
|
|
677
|
+
const token = this.configuration.accessToken;
|
|
678
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
679
|
+
if (tokenString) {
|
|
680
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
const response = await this.request({
|
|
685
|
+
path: `/v1/organizations/{uuid}/chargebeeV1Billing/payor`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
686
|
+
method: 'PUT',
|
|
687
|
+
headers: headerParameters,
|
|
688
|
+
query: queryParameters,
|
|
689
|
+
body: V1SetChargebeeV1BillingPayorPayloadToJSON(requestParameters['v1SetChargebeeV1BillingPayorPayload']),
|
|
690
|
+
}, initOverrides);
|
|
691
|
+
|
|
692
|
+
return new runtime.VoidApiResponse(response);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Set the payor user for Chargebee V1 billing
|
|
697
|
+
*/
|
|
698
|
+
async setPayorUserId(requestParameters: SetPayorUserIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
699
|
+
await this.setPayorUserIdRaw(requestParameters, initOverrides);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Unset billing for the organization
|
|
704
|
+
*/
|
|
705
|
+
async unsetBillingRaw(requestParameters: UnsetBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
706
|
+
if (requestParameters['uuid'] == null) {
|
|
707
|
+
throw new runtime.RequiredError(
|
|
708
|
+
'uuid',
|
|
709
|
+
'Required parameter "uuid" was null or undefined when calling unsetBilling().'
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
const queryParameters: any = {};
|
|
714
|
+
|
|
715
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
716
|
+
|
|
717
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
718
|
+
// oauth required
|
|
719
|
+
const token = this.configuration.accessToken;
|
|
720
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
721
|
+
if (tokenString) {
|
|
722
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
const response = await this.request({
|
|
727
|
+
path: `/v1/organizations/{uuid}/billing`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
728
|
+
method: 'DELETE',
|
|
729
|
+
headers: headerParameters,
|
|
730
|
+
query: queryParameters,
|
|
731
|
+
}, initOverrides);
|
|
732
|
+
|
|
733
|
+
return new runtime.VoidApiResponse(response);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Unset billing for the organization
|
|
738
|
+
*/
|
|
739
|
+
async unsetBilling(requestParameters: UnsetBillingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
740
|
+
await this.unsetBillingRaw(requestParameters, initOverrides);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Unset the distributor for an organization
|
|
745
|
+
*/
|
|
746
|
+
async unsetDistributorRaw(requestParameters: UnsetDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
747
|
+
if (requestParameters['uuid'] == null) {
|
|
748
|
+
throw new runtime.RequiredError(
|
|
749
|
+
'uuid',
|
|
750
|
+
'Required parameter "uuid" was null or undefined when calling unsetDistributor().'
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
const queryParameters: any = {};
|
|
755
|
+
|
|
756
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
757
|
+
|
|
758
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
759
|
+
// oauth required
|
|
760
|
+
const token = this.configuration.accessToken;
|
|
761
|
+
const tokenString = await token("OAuth2", ["billing:organization"]);
|
|
762
|
+
if (tokenString) {
|
|
763
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
const response = await this.request({
|
|
768
|
+
path: `/v1/organizations/{uuid}/distributor`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters['uuid']))),
|
|
769
|
+
method: 'DELETE',
|
|
770
|
+
headers: headerParameters,
|
|
771
|
+
query: queryParameters,
|
|
772
|
+
}, initOverrides);
|
|
773
|
+
|
|
774
|
+
return new runtime.VoidApiResponse(response);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* Unset the distributor for an organization
|
|
779
|
+
*/
|
|
780
|
+
async unsetDistributor(requestParameters: UnsetDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
781
|
+
await this.unsetDistributorRaw(requestParameters, initOverrides);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
}
|