@flexprice/sdk 0.0.1

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