@flexprice/sdk 1.0.13 → 1.0.15
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/LICENSE +663 -0
- package/dist/ApiClient.js +455 -505
- package/dist/api/AuthApi.js +56 -72
- package/dist/api/CustomersApi.js +273 -301
- package/dist/api/EntitlementsApi.js +200 -224
- package/dist/api/EnvironmentsApi.js +129 -149
- package/dist/api/EventsApi.js +151 -173
- package/dist/api/FeaturesApi.js +167 -189
- package/dist/api/IntegrationsApi.js +121 -141
- package/dist/api/InvoicesApi.js +352 -377
- package/dist/api/PaymentsApi.js +202 -226
- package/dist/api/PlansApi.js +165 -187
- package/dist/api/PricesApi.js +166 -188
- package/dist/api/SecretsApi.js +88 -106
- package/dist/api/SubscriptionsApi.js +277 -307
- package/dist/api/TasksApi.js +168 -190
- package/dist/api/TenantsApi.js +114 -134
- package/dist/api/UsersApi.js +22 -36
- package/dist/api/WalletsApi.js +330 -322
- package/dist/index.js +1029 -1167
- package/dist/model/DtoAddress.js +67 -84
- package/dist/model/DtoAggregatedEntitlement.js +48 -65
- package/dist/model/DtoAggregatedFeature.js +60 -89
- package/dist/model/DtoAuthResponse.js +49 -66
- package/dist/model/DtoBillingPeriodInfo.js +49 -66
- package/dist/model/DtoBulkIngestEventRequest.js +49 -88
- package/dist/model/DtoCreateAPIKeyRequest.js +59 -89
- package/dist/model/DtoCreateAPIKeyResponse.js +44 -61
- package/dist/model/DtoCreateCustomerRequest.js +95 -125
- package/dist/model/DtoCreateEntitlementRequest.js +72 -102
- package/dist/model/DtoCreateEnvironmentRequest.js +49 -79
- package/dist/model/DtoCreateFeatureRequest.js +96 -112
- package/dist/model/DtoCreateIntegrationRequest.js +52 -82
- package/dist/model/DtoCreateInvoiceLineItemRequest.js +102 -132
- package/dist/model/DtoCreateInvoiceRequest.js +152 -179
- package/dist/model/DtoCreateMeterRequest.js +78 -117
- package/dist/model/DtoCreatePaymentRequest.js +84 -114
- package/dist/model/DtoCreatePlanEntitlementRequest.js +72 -102
- package/dist/model/DtoCreatePlanPriceRequest.js +141 -180
- package/dist/model/DtoCreatePlanRequest.js +83 -131
- package/dist/model/DtoCreatePriceRequest.js +141 -180
- package/dist/model/DtoCreatePriceTier.js +51 -81
- package/dist/model/DtoCreateSubscriptionRequest.js +115 -136
- package/dist/model/DtoCreateTaskRequest.js +68 -98
- package/dist/model/DtoCreateTenantRequest.js +50 -80
- package/dist/model/DtoCreateWalletRequest.js +110 -121
- package/dist/model/DtoCustomerEntitlementsResponse.js +49 -78
- package/dist/model/DtoCustomerInvoiceSummary.js +66 -83
- package/dist/model/DtoCustomerMultiCurrencyInvoiceSummary.js +56 -85
- package/dist/model/DtoCustomerResponse.js +135 -152
- package/dist/model/DtoCustomerUsageSummaryResponse.js +67 -96
- package/dist/model/DtoEntitlementResponse.js +127 -144
- package/dist/model/DtoEntitlementSource.js +69 -86
- package/dist/model/DtoEnvironmentResponse.js +61 -78
- package/dist/model/DtoEvent.js +83 -88
- package/dist/model/DtoFeatureResponse.js +129 -146
- package/dist/model/DtoFeatureUsageSummary.js +66 -95
- package/dist/model/DtoGetEventsRequest.js +106 -108
- package/dist/model/DtoGetEventsResponse.js +65 -94
- package/dist/model/DtoGetPreviewInvoiceRequest.js +55 -85
- package/dist/model/DtoGetUsageByMeterRequest.js +75 -105
- package/dist/model/DtoGetUsageBySubscriptionRequest.js +57 -87
- package/dist/model/DtoGetUsageBySubscriptionResponse.js +72 -101
- package/dist/model/DtoGetUsageRequest.js +86 -116
- package/dist/model/DtoGetUsageResponse.js +56 -85
- package/dist/model/DtoIngestEventRequest.js +78 -108
- package/dist/model/DtoInvoiceLineItemResponse.js +161 -178
- package/dist/model/DtoInvoiceResponse.js +250 -279
- package/dist/model/DtoLinkedIntegrationsResponse.js +35 -52
- package/dist/model/DtoListCustomersResponse.js +51 -80
- package/dist/model/DtoListEntitlementsResponse.js +51 -80
- package/dist/model/DtoListEnvironmentsResponse.js +52 -81
- package/dist/model/DtoListFeaturesResponse.js +51 -80
- package/dist/model/DtoListInvoicesResponse.js +51 -80
- package/dist/model/DtoListPaymentsResponse.js +51 -80
- package/dist/model/DtoListPlansResponse.js +51 -80
- package/dist/model/DtoListPricesResponse.js +51 -80
- package/dist/model/DtoListSecretsResponse.js +51 -80
- package/dist/model/DtoListSubscriptionPausesResponse.js +46 -75
- package/dist/model/DtoListSubscriptionsResponse.js +51 -80
- package/dist/model/DtoListTasksResponse.js +51 -80
- package/dist/model/DtoListWalletTransactionsResponse.js +51 -80
- package/dist/model/DtoLoginRequest.js +56 -86
- package/dist/model/DtoMeterResponse.js +99 -128
- package/dist/model/DtoPauseSubscriptionRequest.js +69 -99
- package/dist/model/DtoPaymentAttemptResponse.js +86 -103
- package/dist/model/DtoPaymentResponse.js +164 -181
- package/dist/model/DtoPlanResponse.js +124 -162
- package/dist/model/DtoPriceResponse.js +182 -221
- package/dist/model/DtoResumeSubscriptionRequest.js +46 -76
- package/dist/model/DtoSecretResponse.js +91 -108
- package/dist/model/DtoSignUpRequest.js +61 -91
- package/dist/model/DtoSubscriptionPauseResponse.js +135 -152
- package/dist/model/DtoSubscriptionResponse.js +270 -299
- package/dist/model/DtoSubscriptionUsageByMetersResponse.js +73 -90
- package/dist/model/DtoTaskResponse.js +141 -158
- package/dist/model/DtoTenantBillingDetails.js +57 -74
- package/dist/model/DtoTenantBillingUsage.js +51 -80
- package/dist/model/DtoTenantResponse.js +69 -86
- package/dist/model/DtoTopUpWalletRequest.js +89 -126
- package/dist/model/DtoUpdateCustomerRequest.js +89 -106
- package/dist/model/DtoUpdateEntitlementRequest.js +48 -65
- package/dist/model/DtoUpdateEnvironmentRequest.js +42 -59
- package/dist/model/DtoUpdateFeatureRequest.js +80 -76
- package/dist/model/DtoUpdatePaymentRequest.js +40 -57
- package/dist/model/DtoUpdatePaymentStatusRequest.js +41 -71
- package/dist/model/DtoUpdatePlanEntitlementRequest.js +78 -108
- package/dist/model/DtoUpdatePlanPriceRequest.js +147 -186
- package/dist/model/DtoUpdatePlanRequest.js +77 -115
- package/dist/model/DtoUpdatePriceRequest.js +47 -64
- package/dist/model/DtoUpdateTaskStatusRequest.js +38 -68
- package/dist/model/DtoUpdateTenantRequest.js +49 -54
- package/dist/model/DtoUpdateWalletRequest.js +65 -82
- package/dist/model/DtoUsageResult.js +38 -55
- package/dist/model/DtoUserResponse.js +51 -68
- package/dist/model/DtoWalletBalanceResponse.js +159 -176
- package/dist/model/DtoWalletResponse.js +120 -137
- package/dist/model/DtoWalletTransactionResponse.js +111 -128
- package/dist/model/ErrorsErrorDetail.js +47 -64
- package/dist/model/ErrorsErrorResponse.js +40 -57
- package/dist/model/MeterAggregation.js +39 -56
- package/dist/model/MeterFilter.js +42 -59
- package/dist/model/PriceJSONBTransformQuantity.js +38 -55
- package/dist/model/PricePrice.js +173 -212
- package/dist/model/PricePriceTier.js +38 -55
- package/dist/model/PriceTransformQuantity.js +38 -55
- package/dist/model/SubscriptionSubscriptionLineItem.js +165 -182
- package/dist/model/SubscriptionSubscriptionPause.js +135 -152
- package/dist/model/TypesAggregationType.js +36 -51
- package/dist/model/TypesAutoTopupTrigger.js +24 -41
- package/dist/model/TypesBillingCadence.js +24 -41
- package/dist/model/TypesBillingCycle.js +41 -0
- package/dist/model/TypesBillingModel.js +30 -46
- package/dist/model/TypesBillingPeriod.js +48 -61
- package/dist/model/TypesBillingTier.js +24 -41
- package/dist/model/TypesEntityType.js +30 -46
- package/dist/model/TypesFeatureType.js +30 -46
- package/dist/model/TypesFileType.js +24 -41
- package/dist/model/TypesInvoiceBillingReason.js +36 -51
- package/dist/model/TypesInvoiceCadence.js +24 -41
- package/dist/model/TypesInvoiceStatus.js +30 -46
- package/dist/model/TypesInvoiceType.js +30 -46
- package/dist/model/TypesPaginationResponse.js +38 -55
- package/dist/model/TypesPauseMode.js +30 -46
- package/dist/model/TypesPauseStatus.js +42 -56
- package/dist/model/TypesPaymentDestinationType.js +18 -36
- package/dist/model/TypesPaymentMethodType.js +36 -51
- package/dist/model/TypesPaymentStatus.js +48 -61
- package/dist/model/TypesPriceType.js +24 -41
- package/dist/model/TypesResetUsage.js +24 -41
- package/dist/model/TypesResumeMode.js +30 -46
- package/dist/model/TypesSecretProvider.js +30 -46
- package/dist/model/TypesSecretType.js +30 -46
- package/dist/model/TypesStatus.js +30 -46
- package/dist/model/TypesSubscriptionStatus.js +60 -71
- package/dist/model/TypesTaskStatus.js +36 -51
- package/dist/model/TypesTaskType.js +24 -41
- package/dist/model/TypesTransactionReason.js +60 -71
- package/dist/model/TypesTransactionStatus.js +30 -46
- package/dist/model/TypesTransactionType.js +24 -41
- package/dist/model/TypesWalletConfig.js +36 -53
- package/dist/model/TypesWalletConfigPriceType.js +30 -46
- package/dist/model/TypesWalletStatus.js +30 -46
- package/dist/model/TypesWalletTxReferenceType.js +30 -51
- package/dist/model/TypesWalletType.js +24 -41
- package/dist/model/TypesWindowSize.js +30 -46
- package/package.json +1 -1
- package/dist/api/MetersApi.js +0 -288
- package/dist/model/DtoListMetersResponse.js +0 -124
- package/dist/model/DtoUpdateMeterRequest.js +0 -110
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
-
var _DtoCreateSubscriptionRequest = _interopRequireDefault(require("../model/DtoCreateSubscriptionRequest"));
|
|
9
|
-
var _DtoGetUsageBySubscriptionRequest = _interopRequireDefault(require("../model/DtoGetUsageBySubscriptionRequest"));
|
|
10
|
-
var _DtoGetUsageBySubscriptionResponse = _interopRequireDefault(require("../model/DtoGetUsageBySubscriptionResponse"));
|
|
11
|
-
var _DtoListSubscriptionPausesResponse = _interopRequireDefault(require("../model/DtoListSubscriptionPausesResponse"));
|
|
12
|
-
var _DtoListSubscriptionsResponse = _interopRequireDefault(require("../model/DtoListSubscriptionsResponse"));
|
|
13
|
-
var _DtoPauseSubscriptionRequest = _interopRequireDefault(require("../model/DtoPauseSubscriptionRequest"));
|
|
14
|
-
var _DtoResumeSubscriptionRequest = _interopRequireDefault(require("../model/DtoResumeSubscriptionRequest"));
|
|
15
|
-
var _DtoSubscriptionPauseResponse = _interopRequireDefault(require("../model/DtoSubscriptionPauseResponse"));
|
|
16
|
-
var _DtoSubscriptionResponse = _interopRequireDefault(require("../model/DtoSubscriptionResponse"));
|
|
17
|
-
var _ErrorsErrorResponse = _interopRequireDefault(require("../model/ErrorsErrorResponse"));
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
20
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
22
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
23
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
1
|
+
/**
|
|
25
2
|
* FlexPrice API
|
|
26
3
|
* FlexPrice API Service
|
|
27
4
|
*
|
|
@@ -33,12 +10,25 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
33
10
|
* Do not edit the class manually.
|
|
34
11
|
*
|
|
35
12
|
*/
|
|
13
|
+
|
|
14
|
+
import ApiClient from "../ApiClient";
|
|
15
|
+
import DtoCreateSubscriptionRequest from '../model/DtoCreateSubscriptionRequest';
|
|
16
|
+
import DtoGetUsageBySubscriptionRequest from '../model/DtoGetUsageBySubscriptionRequest';
|
|
17
|
+
import DtoGetUsageBySubscriptionResponse from '../model/DtoGetUsageBySubscriptionResponse';
|
|
18
|
+
import DtoListSubscriptionPausesResponse from '../model/DtoListSubscriptionPausesResponse';
|
|
19
|
+
import DtoListSubscriptionsResponse from '../model/DtoListSubscriptionsResponse';
|
|
20
|
+
import DtoPauseSubscriptionRequest from '../model/DtoPauseSubscriptionRequest';
|
|
21
|
+
import DtoResumeSubscriptionRequest from '../model/DtoResumeSubscriptionRequest';
|
|
22
|
+
import DtoSubscriptionPauseResponse from '../model/DtoSubscriptionPauseResponse';
|
|
23
|
+
import DtoSubscriptionResponse from '../model/DtoSubscriptionResponse';
|
|
24
|
+
import ErrorsErrorResponse from '../model/ErrorsErrorResponse';
|
|
25
|
+
|
|
36
26
|
/**
|
|
37
27
|
* Subscriptions service.
|
|
38
28
|
* @module api/SubscriptionsApi
|
|
39
29
|
* @version 1.0
|
|
40
30
|
*/
|
|
41
|
-
|
|
31
|
+
export default class SubscriptionsApi {
|
|
42
32
|
/**
|
|
43
33
|
* Constructs a new SubscriptionsApi.
|
|
44
34
|
* @alias module:api/SubscriptionsApi
|
|
@@ -46,9 +36,8 @@ var SubscriptionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
46
36
|
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
47
37
|
* default to {@link module:ApiClient#instance} if unspecified.
|
|
48
38
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
39
|
+
constructor(apiClient) {
|
|
40
|
+
this.apiClient = apiClient || ApiClient.instance;
|
|
52
41
|
}
|
|
53
42
|
|
|
54
43
|
/**
|
|
@@ -69,7 +58,6 @@ var SubscriptionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
69
58
|
* @param {String} [customerId] CustomerID filters by customer ID
|
|
70
59
|
* @param {String} [endTime]
|
|
71
60
|
* @param {String} [expand]
|
|
72
|
-
* @param {Boolean} [includeCanceled] IncludeCanceled includes canceled subscriptions if true
|
|
73
61
|
* @param {Number} [limit]
|
|
74
62
|
* @param {Number} [offset]
|
|
75
63
|
* @param {module:model/String} [order]
|
|
@@ -82,302 +70,284 @@ var SubscriptionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
82
70
|
* @param {module:api/SubscriptionsApi~subscriptionsGetCallback} callback The callback function, accepting three arguments: error, data, response
|
|
83
71
|
* data is of type: {@link module:model/DtoListSubscriptionsResponse}
|
|
84
72
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
var returnType = _DtoListSubscriptionsResponse["default"];
|
|
115
|
-
return this.apiClient.callApi('/subscriptions', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
116
|
-
}
|
|
73
|
+
subscriptionsGet(opts, callback) {
|
|
74
|
+
opts = opts || {};
|
|
75
|
+
let postBody = null;
|
|
76
|
+
let pathParams = {};
|
|
77
|
+
let queryParams = {
|
|
78
|
+
'active_at': opts['activeAt'],
|
|
79
|
+
'billing_cadence': this.apiClient.buildCollectionParam(opts['billingCadence'], 'csv'),
|
|
80
|
+
'billing_period': this.apiClient.buildCollectionParam(opts['billingPeriod'], 'csv'),
|
|
81
|
+
'customer_id': opts['customerId'],
|
|
82
|
+
'end_time': opts['endTime'],
|
|
83
|
+
'expand': opts['expand'],
|
|
84
|
+
'limit': opts['limit'],
|
|
85
|
+
'offset': opts['offset'],
|
|
86
|
+
'order': opts['order'],
|
|
87
|
+
'plan_id': opts['planId'],
|
|
88
|
+
'sort': opts['sort'],
|
|
89
|
+
'start_time': opts['startTime'],
|
|
90
|
+
'status': opts['status'],
|
|
91
|
+
'subscription_status': this.apiClient.buildCollectionParam(opts['subscriptionStatus'], 'csv'),
|
|
92
|
+
'with_line_items': opts['withLineItems']
|
|
93
|
+
};
|
|
94
|
+
let headerParams = {};
|
|
95
|
+
let formParams = {};
|
|
96
|
+
let authNames = ['ApiKeyAuth'];
|
|
97
|
+
let contentTypes = [];
|
|
98
|
+
let accepts = ['application/json'];
|
|
99
|
+
let returnType = DtoListSubscriptionsResponse;
|
|
100
|
+
return this.apiClient.callApi('/subscriptions', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
101
|
+
}
|
|
117
102
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Callback function to receive the result of the subscriptionsIdCancelPost operation.
|
|
105
|
+
* @callback module:api/SubscriptionsApi~subscriptionsIdCancelPostCallback
|
|
106
|
+
* @param {String} error Error message, if any.
|
|
107
|
+
* @param {Object.<String, {String: Object}>} data The data returned by the service call.
|
|
108
|
+
* @param {String} response The complete HTTP response.
|
|
109
|
+
*/
|
|
125
110
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (id === undefined || id === null) {
|
|
142
|
-
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdCancelPost");
|
|
143
|
-
}
|
|
144
|
-
var pathParams = {
|
|
145
|
-
'id': id
|
|
146
|
-
};
|
|
147
|
-
var queryParams = {
|
|
148
|
-
'cancel_at_period_end': opts['cancelAtPeriodEnd']
|
|
149
|
-
};
|
|
150
|
-
var headerParams = {};
|
|
151
|
-
var formParams = {};
|
|
152
|
-
var authNames = ['ApiKeyAuth'];
|
|
153
|
-
var contentTypes = [];
|
|
154
|
-
var accepts = ['application/json'];
|
|
155
|
-
var returnType = {
|
|
156
|
-
'String': Object
|
|
157
|
-
};
|
|
158
|
-
return this.apiClient.callApi('/subscriptions/{id}/cancel', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
111
|
+
/**
|
|
112
|
+
* Cancel subscription
|
|
113
|
+
* Cancel a subscription
|
|
114
|
+
* @param {String} id Subscription ID
|
|
115
|
+
* @param {Object} opts Optional parameters
|
|
116
|
+
* @param {Boolean} [cancelAtPeriodEnd] Cancel at period end
|
|
117
|
+
* @param {module:api/SubscriptionsApi~subscriptionsIdCancelPostCallback} callback The callback function, accepting three arguments: error, data, response
|
|
118
|
+
* data is of type: {@link Object.<String, {String: Object}>}
|
|
119
|
+
*/
|
|
120
|
+
subscriptionsIdCancelPost(id, opts, callback) {
|
|
121
|
+
opts = opts || {};
|
|
122
|
+
let postBody = null;
|
|
123
|
+
// verify the required parameter 'id' is set
|
|
124
|
+
if (id === undefined || id === null) {
|
|
125
|
+
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdCancelPost");
|
|
159
126
|
}
|
|
127
|
+
let pathParams = {
|
|
128
|
+
'id': id
|
|
129
|
+
};
|
|
130
|
+
let queryParams = {
|
|
131
|
+
'cancel_at_period_end': opts['cancelAtPeriodEnd']
|
|
132
|
+
};
|
|
133
|
+
let headerParams = {};
|
|
134
|
+
let formParams = {};
|
|
135
|
+
let authNames = ['ApiKeyAuth'];
|
|
136
|
+
let contentTypes = [];
|
|
137
|
+
let accepts = ['application/json'];
|
|
138
|
+
let returnType = {
|
|
139
|
+
'String': Object
|
|
140
|
+
};
|
|
141
|
+
return this.apiClient.callApi('/subscriptions/{id}/cancel', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
142
|
+
}
|
|
160
143
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Callback function to receive the result of the subscriptionsIdGet operation.
|
|
146
|
+
* @callback module:api/SubscriptionsApi~subscriptionsIdGetCallback
|
|
147
|
+
* @param {String} error Error message, if any.
|
|
148
|
+
* @param {module:model/DtoSubscriptionResponse} data The data returned by the service call.
|
|
149
|
+
* @param {String} response The complete HTTP response.
|
|
150
|
+
*/
|
|
168
151
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (id === undefined || id === null) {
|
|
182
|
-
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdGet");
|
|
183
|
-
}
|
|
184
|
-
var pathParams = {
|
|
185
|
-
'id': id
|
|
186
|
-
};
|
|
187
|
-
var queryParams = {};
|
|
188
|
-
var headerParams = {};
|
|
189
|
-
var formParams = {};
|
|
190
|
-
var authNames = ['ApiKeyAuth'];
|
|
191
|
-
var contentTypes = [];
|
|
192
|
-
var accepts = ['application/json'];
|
|
193
|
-
var returnType = _DtoSubscriptionResponse["default"];
|
|
194
|
-
return this.apiClient.callApi('/subscriptions/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
152
|
+
/**
|
|
153
|
+
* Get subscription
|
|
154
|
+
* Get a subscription by ID
|
|
155
|
+
* @param {String} id Subscription ID
|
|
156
|
+
* @param {module:api/SubscriptionsApi~subscriptionsIdGetCallback} callback The callback function, accepting three arguments: error, data, response
|
|
157
|
+
* data is of type: {@link module:model/DtoSubscriptionResponse}
|
|
158
|
+
*/
|
|
159
|
+
subscriptionsIdGet(id, callback) {
|
|
160
|
+
let postBody = null;
|
|
161
|
+
// verify the required parameter 'id' is set
|
|
162
|
+
if (id === undefined || id === null) {
|
|
163
|
+
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdGet");
|
|
195
164
|
}
|
|
165
|
+
let pathParams = {
|
|
166
|
+
'id': id
|
|
167
|
+
};
|
|
168
|
+
let queryParams = {};
|
|
169
|
+
let headerParams = {};
|
|
170
|
+
let formParams = {};
|
|
171
|
+
let authNames = ['ApiKeyAuth'];
|
|
172
|
+
let contentTypes = [];
|
|
173
|
+
let accepts = ['application/json'];
|
|
174
|
+
let returnType = DtoSubscriptionResponse;
|
|
175
|
+
return this.apiClient.callApi('/subscriptions/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
176
|
+
}
|
|
196
177
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Callback function to receive the result of the subscriptionsIdPausePost operation.
|
|
180
|
+
* @callback module:api/SubscriptionsApi~subscriptionsIdPausePostCallback
|
|
181
|
+
* @param {String} error Error message, if any.
|
|
182
|
+
* @param {module:model/DtoSubscriptionPauseResponse} data The data returned by the service call.
|
|
183
|
+
* @param {String} response The complete HTTP response.
|
|
184
|
+
*/
|
|
204
185
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (request === undefined || request === null) {
|
|
223
|
-
throw new Error("Missing the required parameter 'request' when calling subscriptionsIdPausePost");
|
|
224
|
-
}
|
|
225
|
-
var pathParams = {
|
|
226
|
-
'id': id
|
|
227
|
-
};
|
|
228
|
-
var queryParams = {};
|
|
229
|
-
var headerParams = {};
|
|
230
|
-
var formParams = {};
|
|
231
|
-
var authNames = [];
|
|
232
|
-
var contentTypes = ['application/json'];
|
|
233
|
-
var accepts = ['application/json'];
|
|
234
|
-
var returnType = _DtoSubscriptionPauseResponse["default"];
|
|
235
|
-
return this.apiClient.callApi('/subscriptions/{id}/pause', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
186
|
+
/**
|
|
187
|
+
* Pause a subscription
|
|
188
|
+
* Pause a subscription with the specified parameters
|
|
189
|
+
* @param {String} id Subscription ID
|
|
190
|
+
* @param {module:model/DtoPauseSubscriptionRequest} request Pause subscription request
|
|
191
|
+
* @param {module:api/SubscriptionsApi~subscriptionsIdPausePostCallback} callback The callback function, accepting three arguments: error, data, response
|
|
192
|
+
* data is of type: {@link module:model/DtoSubscriptionPauseResponse}
|
|
193
|
+
*/
|
|
194
|
+
subscriptionsIdPausePost(id, request, callback) {
|
|
195
|
+
let postBody = request;
|
|
196
|
+
// verify the required parameter 'id' is set
|
|
197
|
+
if (id === undefined || id === null) {
|
|
198
|
+
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdPausePost");
|
|
199
|
+
}
|
|
200
|
+
// verify the required parameter 'request' is set
|
|
201
|
+
if (request === undefined || request === null) {
|
|
202
|
+
throw new Error("Missing the required parameter 'request' when calling subscriptionsIdPausePost");
|
|
236
203
|
}
|
|
204
|
+
let pathParams = {
|
|
205
|
+
'id': id
|
|
206
|
+
};
|
|
207
|
+
let queryParams = {};
|
|
208
|
+
let headerParams = {};
|
|
209
|
+
let formParams = {};
|
|
210
|
+
let authNames = [];
|
|
211
|
+
let contentTypes = ['application/json'];
|
|
212
|
+
let accepts = ['application/json'];
|
|
213
|
+
let returnType = DtoSubscriptionPauseResponse;
|
|
214
|
+
return this.apiClient.callApi('/subscriptions/{id}/pause', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
215
|
+
}
|
|
237
216
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Callback function to receive the result of the subscriptionsIdPausesGet operation.
|
|
219
|
+
* @callback module:api/SubscriptionsApi~subscriptionsIdPausesGetCallback
|
|
220
|
+
* @param {String} error Error message, if any.
|
|
221
|
+
* @param {Array.<module:model/DtoListSubscriptionPausesResponse>} data The data returned by the service call.
|
|
222
|
+
* @param {String} response The complete HTTP response.
|
|
223
|
+
*/
|
|
245
224
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (id === undefined || id === null) {
|
|
259
|
-
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdPausesGet");
|
|
260
|
-
}
|
|
261
|
-
var pathParams = {
|
|
262
|
-
'id': id
|
|
263
|
-
};
|
|
264
|
-
var queryParams = {};
|
|
265
|
-
var headerParams = {};
|
|
266
|
-
var formParams = {};
|
|
267
|
-
var authNames = [];
|
|
268
|
-
var contentTypes = [];
|
|
269
|
-
var accepts = ['application/json'];
|
|
270
|
-
var returnType = [_DtoListSubscriptionPausesResponse["default"]];
|
|
271
|
-
return this.apiClient.callApi('/subscriptions/{id}/pauses', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
225
|
+
/**
|
|
226
|
+
* List all pauses for a subscription
|
|
227
|
+
* List all pauses for a subscription
|
|
228
|
+
* @param {String} id Subscription ID
|
|
229
|
+
* @param {module:api/SubscriptionsApi~subscriptionsIdPausesGetCallback} callback The callback function, accepting three arguments: error, data, response
|
|
230
|
+
* data is of type: {@link Array.<module:model/DtoListSubscriptionPausesResponse>}
|
|
231
|
+
*/
|
|
232
|
+
subscriptionsIdPausesGet(id, callback) {
|
|
233
|
+
let postBody = null;
|
|
234
|
+
// verify the required parameter 'id' is set
|
|
235
|
+
if (id === undefined || id === null) {
|
|
236
|
+
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdPausesGet");
|
|
272
237
|
}
|
|
238
|
+
let pathParams = {
|
|
239
|
+
'id': id
|
|
240
|
+
};
|
|
241
|
+
let queryParams = {};
|
|
242
|
+
let headerParams = {};
|
|
243
|
+
let formParams = {};
|
|
244
|
+
let authNames = [];
|
|
245
|
+
let contentTypes = [];
|
|
246
|
+
let accepts = ['application/json'];
|
|
247
|
+
let returnType = [DtoListSubscriptionPausesResponse];
|
|
248
|
+
return this.apiClient.callApi('/subscriptions/{id}/pauses', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
249
|
+
}
|
|
273
250
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Callback function to receive the result of the subscriptionsIdResumePost operation.
|
|
253
|
+
* @callback module:api/SubscriptionsApi~subscriptionsIdResumePostCallback
|
|
254
|
+
* @param {String} error Error message, if any.
|
|
255
|
+
* @param {module:model/DtoSubscriptionPauseResponse} data The data returned by the service call.
|
|
256
|
+
* @param {String} response The complete HTTP response.
|
|
257
|
+
*/
|
|
281
258
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
if (request === undefined || request === null) {
|
|
300
|
-
throw new Error("Missing the required parameter 'request' when calling subscriptionsIdResumePost");
|
|
301
|
-
}
|
|
302
|
-
var pathParams = {
|
|
303
|
-
'id': id
|
|
304
|
-
};
|
|
305
|
-
var queryParams = {};
|
|
306
|
-
var headerParams = {};
|
|
307
|
-
var formParams = {};
|
|
308
|
-
var authNames = [];
|
|
309
|
-
var contentTypes = ['application/json'];
|
|
310
|
-
var accepts = ['application/json'];
|
|
311
|
-
var returnType = _DtoSubscriptionPauseResponse["default"];
|
|
312
|
-
return this.apiClient.callApi('/subscriptions/{id}/resume', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
259
|
+
/**
|
|
260
|
+
* Resume a paused subscription
|
|
261
|
+
* Resume a paused subscription with the specified parameters
|
|
262
|
+
* @param {String} id Subscription ID
|
|
263
|
+
* @param {module:model/DtoResumeSubscriptionRequest} request Resume subscription request
|
|
264
|
+
* @param {module:api/SubscriptionsApi~subscriptionsIdResumePostCallback} callback The callback function, accepting three arguments: error, data, response
|
|
265
|
+
* data is of type: {@link module:model/DtoSubscriptionPauseResponse}
|
|
266
|
+
*/
|
|
267
|
+
subscriptionsIdResumePost(id, request, callback) {
|
|
268
|
+
let postBody = request;
|
|
269
|
+
// verify the required parameter 'id' is set
|
|
270
|
+
if (id === undefined || id === null) {
|
|
271
|
+
throw new Error("Missing the required parameter 'id' when calling subscriptionsIdResumePost");
|
|
272
|
+
}
|
|
273
|
+
// verify the required parameter 'request' is set
|
|
274
|
+
if (request === undefined || request === null) {
|
|
275
|
+
throw new Error("Missing the required parameter 'request' when calling subscriptionsIdResumePost");
|
|
313
276
|
}
|
|
277
|
+
let pathParams = {
|
|
278
|
+
'id': id
|
|
279
|
+
};
|
|
280
|
+
let queryParams = {};
|
|
281
|
+
let headerParams = {};
|
|
282
|
+
let formParams = {};
|
|
283
|
+
let authNames = [];
|
|
284
|
+
let contentTypes = ['application/json'];
|
|
285
|
+
let accepts = ['application/json'];
|
|
286
|
+
let returnType = DtoSubscriptionPauseResponse;
|
|
287
|
+
return this.apiClient.callApi('/subscriptions/{id}/resume', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
288
|
+
}
|
|
314
289
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
290
|
+
/**
|
|
291
|
+
* Callback function to receive the result of the subscriptionsPost operation.
|
|
292
|
+
* @callback module:api/SubscriptionsApi~subscriptionsPostCallback
|
|
293
|
+
* @param {String} error Error message, if any.
|
|
294
|
+
* @param {module:model/DtoSubscriptionResponse} data The data returned by the service call.
|
|
295
|
+
* @param {String} response The complete HTTP response.
|
|
296
|
+
*/
|
|
322
297
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (subscription === undefined || subscription === null) {
|
|
336
|
-
throw new Error("Missing the required parameter 'subscription' when calling subscriptionsPost");
|
|
337
|
-
}
|
|
338
|
-
var pathParams = {};
|
|
339
|
-
var queryParams = {};
|
|
340
|
-
var headerParams = {};
|
|
341
|
-
var formParams = {};
|
|
342
|
-
var authNames = ['ApiKeyAuth'];
|
|
343
|
-
var contentTypes = ['application/json'];
|
|
344
|
-
var accepts = ['application/json'];
|
|
345
|
-
var returnType = _DtoSubscriptionResponse["default"];
|
|
346
|
-
return this.apiClient.callApi('/subscriptions', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
298
|
+
/**
|
|
299
|
+
* Create subscription
|
|
300
|
+
* Create a new subscription
|
|
301
|
+
* @param {module:model/DtoCreateSubscriptionRequest} subscription Subscription Request
|
|
302
|
+
* @param {module:api/SubscriptionsApi~subscriptionsPostCallback} callback The callback function, accepting three arguments: error, data, response
|
|
303
|
+
* data is of type: {@link module:model/DtoSubscriptionResponse}
|
|
304
|
+
*/
|
|
305
|
+
subscriptionsPost(subscription, callback) {
|
|
306
|
+
let postBody = subscription;
|
|
307
|
+
// verify the required parameter 'subscription' is set
|
|
308
|
+
if (subscription === undefined || subscription === null) {
|
|
309
|
+
throw new Error("Missing the required parameter 'subscription' when calling subscriptionsPost");
|
|
347
310
|
}
|
|
311
|
+
let pathParams = {};
|
|
312
|
+
let queryParams = {};
|
|
313
|
+
let headerParams = {};
|
|
314
|
+
let formParams = {};
|
|
315
|
+
let authNames = ['ApiKeyAuth'];
|
|
316
|
+
let contentTypes = ['application/json'];
|
|
317
|
+
let accepts = ['application/json'];
|
|
318
|
+
let returnType = DtoSubscriptionResponse;
|
|
319
|
+
return this.apiClient.callApi('/subscriptions', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
320
|
+
}
|
|
348
321
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
322
|
+
/**
|
|
323
|
+
* Callback function to receive the result of the subscriptionsUsagePost operation.
|
|
324
|
+
* @callback module:api/SubscriptionsApi~subscriptionsUsagePostCallback
|
|
325
|
+
* @param {String} error Error message, if any.
|
|
326
|
+
* @param {module:model/DtoGetUsageBySubscriptionResponse} data The data returned by the service call.
|
|
327
|
+
* @param {String} response The complete HTTP response.
|
|
328
|
+
*/
|
|
356
329
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
if (request === undefined || request === null) {
|
|
370
|
-
throw new Error("Missing the required parameter 'request' when calling subscriptionsUsagePost");
|
|
371
|
-
}
|
|
372
|
-
var pathParams = {};
|
|
373
|
-
var queryParams = {};
|
|
374
|
-
var headerParams = {};
|
|
375
|
-
var formParams = {};
|
|
376
|
-
var authNames = ['ApiKeyAuth'];
|
|
377
|
-
var contentTypes = ['application/json'];
|
|
378
|
-
var accepts = ['application/json'];
|
|
379
|
-
var returnType = _DtoGetUsageBySubscriptionResponse["default"];
|
|
380
|
-
return this.apiClient.callApi('/subscriptions/usage', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
330
|
+
/**
|
|
331
|
+
* Get usage by subscription
|
|
332
|
+
* Get usage for a subscription
|
|
333
|
+
* @param {module:model/DtoGetUsageBySubscriptionRequest} request Usage request
|
|
334
|
+
* @param {module:api/SubscriptionsApi~subscriptionsUsagePostCallback} callback The callback function, accepting three arguments: error, data, response
|
|
335
|
+
* data is of type: {@link module:model/DtoGetUsageBySubscriptionResponse}
|
|
336
|
+
*/
|
|
337
|
+
subscriptionsUsagePost(request, callback) {
|
|
338
|
+
let postBody = request;
|
|
339
|
+
// verify the required parameter 'request' is set
|
|
340
|
+
if (request === undefined || request === null) {
|
|
341
|
+
throw new Error("Missing the required parameter 'request' when calling subscriptionsUsagePost");
|
|
381
342
|
}
|
|
382
|
-
|
|
383
|
-
}
|
|
343
|
+
let pathParams = {};
|
|
344
|
+
let queryParams = {};
|
|
345
|
+
let headerParams = {};
|
|
346
|
+
let formParams = {};
|
|
347
|
+
let authNames = ['ApiKeyAuth'];
|
|
348
|
+
let contentTypes = ['application/json'];
|
|
349
|
+
let accepts = ['application/json'];
|
|
350
|
+
let returnType = DtoGetUsageBySubscriptionResponse;
|
|
351
|
+
return this.apiClient.callApi('/subscriptions/usage', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
352
|
+
}
|
|
353
|
+
}
|