vayu-ts 0.3.4 → 0.3.7

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 (172) hide show
  1. package/dist/openapi/apis/AuthApi.js +8 -4
  2. package/dist/openapi/apis/CatalogProductsApi.js +46 -23
  3. package/dist/openapi/apis/CloudUsageSubmissionApi.js +8 -4
  4. package/dist/openapi/apis/ContractsApi.js +48 -22
  5. package/dist/openapi/apis/CreditsApi.js +24 -12
  6. package/dist/openapi/apis/CustomFieldsApi.d.ts +89 -0
  7. package/dist/openapi/apis/CustomFieldsApi.js +377 -0
  8. package/dist/openapi/apis/CustomersApi.js +124 -52
  9. package/dist/openapi/apis/EventsApi.d.ts +116 -1
  10. package/dist/openapi/apis/EventsApi.js +605 -25
  11. package/dist/openapi/apis/InvoicesApi.js +26 -13
  12. package/dist/openapi/apis/MeasurementsApi.js +36 -18
  13. package/dist/openapi/apis/MetersApi.js +38 -19
  14. package/dist/openapi/apis/PlansApi.d.ts +56 -0
  15. package/dist/openapi/apis/PlansApi.js +225 -0
  16. package/dist/openapi/apis/ProductConsumptionsApi.js +12 -4
  17. package/dist/openapi/apis/WebhooksApi.js +12 -4
  18. package/dist/openapi/index.d.ts +1 -1
  19. package/dist/openapi/index.js +3 -1
  20. package/dist/openapi/models/BillingInterval.d.ts +18 -0
  21. package/dist/openapi/models/BillingInterval.js +22 -0
  22. package/dist/openapi/models/ConflictErrorResponse.d.ts +42 -0
  23. package/dist/openapi/models/ConflictErrorResponse.js +52 -0
  24. package/dist/openapi/models/Contact.js +1 -1
  25. package/dist/openapi/models/CreateContractRequest.d.ts +6 -0
  26. package/dist/openapi/models/CreateContractRequest.js +12 -0
  27. package/dist/openapi/models/CreateCustomFieldRequest.d.ts +71 -0
  28. package/dist/openapi/models/CreateCustomFieldRequest.js +90 -0
  29. package/dist/openapi/models/CreateCustomFieldResponse.d.ts +32 -0
  30. package/dist/openapi/models/CreateCustomFieldResponse.js +32 -0
  31. package/dist/openapi/models/CreateCustomFieldResponseCustomField.d.ts +74 -0
  32. package/dist/openapi/models/CreateCustomFieldResponseCustomField.js +108 -0
  33. package/dist/openapi/models/CreateCustomerRequest.d.ts +20 -0
  34. package/dist/openapi/models/CreateCustomerRequest.js +30 -0
  35. package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +20 -0
  36. package/dist/openapi/models/CreateCustomerResponseCustomer.js +30 -0
  37. package/dist/openapi/models/CustomFieldEntities.d.ts +20 -0
  38. package/dist/openapi/models/CustomFieldEntities.js +24 -0
  39. package/dist/openapi/models/CustomFieldValueTypes.d.ts +2 -1
  40. package/dist/openapi/models/CustomFieldValueTypes.js +1 -0
  41. package/dist/openapi/models/DeleteContractResponseContract.d.ts +6 -0
  42. package/dist/openapi/models/DeleteContractResponseContract.js +12 -0
  43. package/dist/openapi/models/DeleteCustomFieldResponse.d.ts +32 -0
  44. package/dist/openapi/models/DeleteCustomFieldResponse.js +32 -0
  45. package/dist/openapi/models/DeleteCustomFieldResponseCustomField.d.ts +75 -0
  46. package/dist/openapi/models/DeleteCustomFieldResponseCustomField.js +114 -0
  47. package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +20 -0
  48. package/dist/openapi/models/DeleteCustomerResponseCustomer.js +30 -0
  49. package/dist/openapi/models/DeletePlanResponse.d.ts +32 -0
  50. package/dist/openapi/models/DeletePlanResponse.js +32 -0
  51. package/dist/openapi/models/DeletePlanResponsePlan.d.ts +42 -0
  52. package/dist/openapi/models/DeletePlanResponsePlan.js +68 -0
  53. package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +1 -1
  54. package/dist/openapi/models/GetContractResponseContract.d.ts +6 -0
  55. package/dist/openapi/models/GetContractResponseContract.js +12 -0
  56. package/dist/openapi/models/GetCustomFieldResponse.d.ts +32 -0
  57. package/dist/openapi/models/GetCustomFieldResponse.js +32 -0
  58. package/dist/openapi/models/GetCustomerByNameResponseCustomer.d.ts +20 -0
  59. package/dist/openapi/models/GetCustomerByNameResponseCustomer.js +30 -0
  60. package/dist/openapi/models/GetPlanResponse.d.ts +32 -0
  61. package/dist/openapi/models/GetPlanResponse.js +32 -0
  62. package/dist/openapi/models/GetPlanResponsePlan.d.ts +41 -0
  63. package/dist/openapi/models/GetPlanResponsePlan.js +62 -0
  64. package/dist/openapi/models/InternalServerErrorResponse.d.ts +42 -0
  65. package/dist/openapi/models/InternalServerErrorResponse.js +52 -0
  66. package/dist/openapi/models/ListCustomFieldsResponse.d.ts +35 -0
  67. package/dist/openapi/models/ListCustomFieldsResponse.js +50 -0
  68. package/dist/openapi/models/ListPlansResponse.d.ts +35 -0
  69. package/dist/openapi/models/ListPlansResponse.js +50 -0
  70. package/dist/openapi/models/NotFoundErrorResponse.d.ts +42 -0
  71. package/dist/openapi/models/NotFoundErrorResponse.js +52 -0
  72. package/dist/openapi/models/NotificationEventType.d.ts +5 -1
  73. package/dist/openapi/models/NotificationEventType.js +4 -0
  74. package/dist/openapi/models/ObjectSerializer.d.ts +51 -0
  75. package/dist/openapi/models/ObjectSerializer.js +176 -0
  76. package/dist/openapi/models/PlanBillingData.d.ts +41 -0
  77. package/dist/openapi/models/PlanBillingData.js +59 -0
  78. package/dist/openapi/models/PlanDuration.d.ts +30 -0
  79. package/dist/openapi/models/PlanDuration.js +25 -0
  80. package/dist/openapi/models/PlanStatus.d.ts +19 -0
  81. package/dist/openapi/models/PlanStatus.js +23 -0
  82. package/dist/openapi/models/ProductGroupCommitment.d.ts +8 -0
  83. package/dist/openapi/models/ProductGroupCommitment.js +12 -1
  84. package/dist/openapi/models/ProductGroupProductsInnerCommitment.d.ts +8 -0
  85. package/dist/openapi/models/ProductGroupProductsInnerCommitment.js +12 -1
  86. package/dist/openapi/models/ProductGroupProductsInnerCommitmentScheduling.d.ts +4 -4
  87. package/dist/openapi/models/ProductGroupProductsInnerCommitmentScheduling.js +2 -2
  88. package/dist/openapi/models/ProductGroupProductsInnerCommitmentSchedulingDuration.d.ts +41 -0
  89. package/dist/openapi/models/ProductGroupProductsInnerCommitmentSchedulingDuration.js +48 -0
  90. package/dist/openapi/models/ProductGroupProductsInnerPricing.d.ts +3 -1
  91. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf.d.ts +6 -0
  92. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf.js +12 -0
  93. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1.d.ts +2 -0
  94. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1.js +6 -0
  95. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2.d.ts +2 -0
  96. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2.js +6 -0
  97. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf5.d.ts +42 -0
  98. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf5.js +48 -0
  99. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf6.d.ts +42 -0
  100. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf6.js +48 -0
  101. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOfDiscount.d.ts +53 -0
  102. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOfDiscount.js +58 -0
  103. package/dist/openapi/models/QueryEventsResponse.d.ts +3 -3
  104. package/dist/openapi/models/QueryEventsResponse.js +18 -0
  105. package/dist/openapi/models/RateLimitErrorResponse.d.ts +42 -0
  106. package/dist/openapi/models/RateLimitErrorResponse.js +52 -0
  107. package/dist/openapi/models/RequestTooLongErrorResponse.d.ts +42 -0
  108. package/dist/openapi/models/RequestTooLongErrorResponse.js +52 -0
  109. package/dist/openapi/models/UnauthorizedErrorResponse.d.ts +42 -0
  110. package/dist/openapi/models/UnauthorizedErrorResponse.js +52 -0
  111. package/dist/openapi/models/UnlimitedDuration.d.ts +14 -0
  112. package/dist/openapi/models/UnlimitedDuration.js +18 -0
  113. package/dist/openapi/models/UpdateCustomFieldRequest.d.ts +71 -0
  114. package/dist/openapi/models/UpdateCustomFieldRequest.js +90 -0
  115. package/dist/openapi/models/UpdateCustomFieldResponse.d.ts +32 -0
  116. package/dist/openapi/models/UpdateCustomFieldResponse.js +32 -0
  117. package/dist/openapi/models/UpdateCustomerRequest.d.ts +20 -0
  118. package/dist/openapi/models/UpdateCustomerRequest.js +30 -0
  119. package/dist/openapi/models/V2DeleteEventResponse.d.ts +32 -0
  120. package/dist/openapi/models/V2DeleteEventResponse.js +32 -0
  121. package/dist/openapi/models/V2DeleteEventsByRefsRequest.d.ts +31 -0
  122. package/dist/openapi/models/V2DeleteEventsByRefsRequest.js +32 -0
  123. package/dist/openapi/models/V2DeleteEventsByRefsResponse.d.ts +35 -0
  124. package/dist/openapi/models/V2DeleteEventsByRefsResponse.js +32 -0
  125. package/dist/openapi/models/V2EventsDryRunRequest.d.ts +32 -0
  126. package/dist/openapi/models/V2EventsDryRunRequest.js +32 -0
  127. package/dist/openapi/models/V2EventsDryRunResponse.d.ts +32 -0
  128. package/dist/openapi/models/V2EventsDryRunResponse.js +32 -0
  129. package/dist/openapi/models/V2GetEventResponse.d.ts +32 -0
  130. package/dist/openapi/models/V2GetEventResponse.js +32 -0
  131. package/dist/openapi/models/V2QueryEventsAggregationRequest.d.ts +45 -0
  132. package/dist/openapi/models/V2QueryEventsAggregationRequest.js +70 -0
  133. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInner.d.ts +39 -0
  134. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInner.js +62 -0
  135. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregation.d.ts +35 -0
  136. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregation.js +44 -0
  137. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregationFieldArithmetic.d.ts +38 -0
  138. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregationFieldArithmetic.js +45 -0
  139. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInner.d.ts +43 -0
  140. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInner.js +54 -0
  141. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInnerValue.d.ts +30 -0
  142. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInnerValue.js +25 -0
  143. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerSqlFullQuery.d.ts +34 -0
  144. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerSqlFullQuery.js +38 -0
  145. package/dist/openapi/models/V2QueryEventsAggregationRequestPeriod.d.ts +32 -0
  146. package/dist/openapi/models/V2QueryEventsAggregationRequestPeriod.js +38 -0
  147. package/dist/openapi/models/V2QueryEventsAggregationResponse.d.ts +42 -0
  148. package/dist/openapi/models/V2QueryEventsAggregationResponse.js +52 -0
  149. package/dist/openapi/models/V2QueryEventsAggregationResponseDataPointsInner.d.ts +34 -0
  150. package/dist/openapi/models/V2QueryEventsAggregationResponseDataPointsInner.js +38 -0
  151. package/dist/openapi/models/V2QueryEventsResponse.d.ts +35 -0
  152. package/dist/openapi/models/V2QueryEventsResponse.js +50 -0
  153. package/dist/openapi/models/V2SendEventsRequest.d.ts +32 -0
  154. package/dist/openapi/models/V2SendEventsRequest.js +32 -0
  155. package/dist/openapi/models/V2SendEventsResponse.d.ts +40 -0
  156. package/dist/openapi/models/V2SendEventsResponse.js +38 -0
  157. package/dist/openapi/models/ValidationErrorResponse.d.ts +51 -0
  158. package/dist/openapi/models/ValidationErrorResponse.js +60 -0
  159. package/dist/openapi/models/ValidationErrorResponseParamsInner.d.ts +38 -0
  160. package/dist/openapi/models/ValidationErrorResponseParamsInner.js +38 -0
  161. package/dist/openapi/models/WebhookSubscribeRequest.d.ts +1 -0
  162. package/dist/openapi/models/WebhookSubscribeRequest.js +6 -0
  163. package/dist/openapi/models/all.d.ts +51 -0
  164. package/dist/openapi/models/all.js +51 -0
  165. package/dist/openapi/types/ObservableAPI.d.ts +235 -2
  166. package/dist/openapi/types/ObservableAPI.js +476 -5
  167. package/dist/openapi/types/PromiseAPI.d.ts +231 -2
  168. package/dist/openapi/types/PromiseAPI.js +320 -18
  169. package/dist/sdk/clients/EventsClient.js +1 -1
  170. package/dist/sdk/clients/WebhooksClient.d.ts +2 -0
  171. package/dist/sdk/clients/WebhooksClient.js +14 -0
  172. package/package.json +1 -1
@@ -110,10 +110,11 @@ class EventsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
110
110
  * @param startTime
111
111
  * @param endTime
112
112
  * @param eventName
113
+ * @param customerAlias
113
114
  * @param limit
114
115
  * @param cursor
115
116
  */
116
- async queryEvents(startTime, endTime, eventName, limit, cursor, _options) {
117
+ async queryEvents(startTime, endTime, eventName, customerAlias, limit, cursor, _options) {
117
118
  let _config = _options || this.configuration;
118
119
  // verify required parameter 'startTime' is not null or undefined
119
120
  if (startTime === null || startTime === undefined) {
@@ -141,6 +142,10 @@ class EventsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
141
142
  requestContext.setQueryParam("eventName", ObjectSerializer_1.ObjectSerializer.serialize(eventName, "string", ""));
142
143
  }
143
144
  // Query Params
145
+ if (customerAlias !== undefined) {
146
+ requestContext.setQueryParam("customerAlias", ObjectSerializer_1.ObjectSerializer.serialize(customerAlias, "string", ""));
147
+ }
148
+ // Query Params
144
149
  if (limit !== undefined) {
145
150
  requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", ""));
146
151
  }
@@ -230,6 +235,265 @@ class EventsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
230
235
  }
231
236
  return requestContext;
232
237
  }
238
+ /**
239
+ * Use this endpoint to remove a specific event using its reference ID (v2).
240
+ * Delete an event by refId (v2)
241
+ * @param refId
242
+ */
243
+ async v2DeleteEventByRefId(refId, _options) {
244
+ let _config = _options || this.configuration;
245
+ // verify required parameter 'refId' is not null or undefined
246
+ if (refId === null || refId === undefined) {
247
+ throw new baseapi_1.RequiredError("EventsApi", "v2DeleteEventByRefId", "refId");
248
+ }
249
+ // Path Params
250
+ const localVarPath = '/v2/events/{refId}'
251
+ .replace('{' + 'refId' + '}', encodeURIComponent(String(refId)));
252
+ // Make Request Context
253
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
254
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
255
+ let authMethod;
256
+ // Apply auth methods
257
+ authMethod = _config.authMethods["BearerAuthorizer"];
258
+ if (authMethod?.applySecurityAuthentication) {
259
+ await authMethod?.applySecurityAuthentication(requestContext);
260
+ }
261
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
262
+ if (defaultAuth?.applySecurityAuthentication) {
263
+ await defaultAuth?.applySecurityAuthentication(requestContext);
264
+ }
265
+ return requestContext;
266
+ }
267
+ /**
268
+ * Delete multiple events, identified by ref, in a single request (v2).
269
+ * Delete events by refs (v2)
270
+ * @param v2DeleteEventsByRefsRequest A list of event refs to delete. The request deletes the matching events for the authenticated account.
271
+ */
272
+ async v2DeleteEventsByRefs(v2DeleteEventsByRefsRequest, _options) {
273
+ let _config = _options || this.configuration;
274
+ // verify required parameter 'v2DeleteEventsByRefsRequest' is not null or undefined
275
+ if (v2DeleteEventsByRefsRequest === null || v2DeleteEventsByRefsRequest === undefined) {
276
+ throw new baseapi_1.RequiredError("EventsApi", "v2DeleteEventsByRefs", "v2DeleteEventsByRefsRequest");
277
+ }
278
+ // Path Params
279
+ const localVarPath = '/v2/events/delete-by-refs';
280
+ // Make Request Context
281
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
282
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
283
+ // Body Params
284
+ const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
285
+ "application/json"
286
+ ]);
287
+ requestContext.setHeaderParam("Content-Type", contentType);
288
+ const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(v2DeleteEventsByRefsRequest, "V2DeleteEventsByRefsRequest", ""), contentType);
289
+ requestContext.setBody(serializedBody);
290
+ let authMethod;
291
+ // Apply auth methods
292
+ authMethod = _config.authMethods["BearerAuthorizer"];
293
+ if (authMethod?.applySecurityAuthentication) {
294
+ await authMethod?.applySecurityAuthentication(requestContext);
295
+ }
296
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
297
+ if (defaultAuth?.applySecurityAuthentication) {
298
+ await defaultAuth?.applySecurityAuthentication(requestContext);
299
+ }
300
+ return requestContext;
301
+ }
302
+ /**
303
+ * Use this endpoint to get a specific event using its reference ID (v2).
304
+ * Get event by refId (v2)
305
+ * @param refId
306
+ */
307
+ async v2GetEventByRefId(refId, _options) {
308
+ let _config = _options || this.configuration;
309
+ // verify required parameter 'refId' is not null or undefined
310
+ if (refId === null || refId === undefined) {
311
+ throw new baseapi_1.RequiredError("EventsApi", "v2GetEventByRefId", "refId");
312
+ }
313
+ // Path Params
314
+ const localVarPath = '/v2/events/{refId}'
315
+ .replace('{' + 'refId' + '}', encodeURIComponent(String(refId)));
316
+ // Make Request Context
317
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
318
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
319
+ let authMethod;
320
+ // Apply auth methods
321
+ authMethod = _config.authMethods["BearerAuthorizer"];
322
+ if (authMethod?.applySecurityAuthentication) {
323
+ await authMethod?.applySecurityAuthentication(requestContext);
324
+ }
325
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
326
+ if (defaultAuth?.applySecurityAuthentication) {
327
+ await defaultAuth?.applySecurityAuthentication(requestContext);
328
+ }
329
+ return requestContext;
330
+ }
331
+ /**
332
+ * Fetch events occurring within a specified timestamp range via the events-service (ClickHouse-backed).
333
+ * Query events by timestamp period and optional event name (v2)
334
+ * @param startTime
335
+ * @param endTime
336
+ * @param eventName
337
+ * @param customerAlias
338
+ * @param limit
339
+ * @param cursor
340
+ */
341
+ async v2QueryEvents(startTime, endTime, eventName, customerAlias, limit, cursor, _options) {
342
+ let _config = _options || this.configuration;
343
+ // verify required parameter 'startTime' is not null or undefined
344
+ if (startTime === null || startTime === undefined) {
345
+ throw new baseapi_1.RequiredError("EventsApi", "v2QueryEvents", "startTime");
346
+ }
347
+ // verify required parameter 'endTime' is not null or undefined
348
+ if (endTime === null || endTime === undefined) {
349
+ throw new baseapi_1.RequiredError("EventsApi", "v2QueryEvents", "endTime");
350
+ }
351
+ // Path Params
352
+ const localVarPath = '/v2/events';
353
+ // Make Request Context
354
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
355
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
356
+ // Query Params
357
+ if (startTime !== undefined) {
358
+ requestContext.setQueryParam("startTime", ObjectSerializer_1.ObjectSerializer.serialize(startTime, "Date", "date-time"));
359
+ }
360
+ // Query Params
361
+ if (endTime !== undefined) {
362
+ requestContext.setQueryParam("endTime", ObjectSerializer_1.ObjectSerializer.serialize(endTime, "Date", "date-time"));
363
+ }
364
+ // Query Params
365
+ if (eventName !== undefined) {
366
+ requestContext.setQueryParam("eventName", ObjectSerializer_1.ObjectSerializer.serialize(eventName, "string", ""));
367
+ }
368
+ // Query Params
369
+ if (customerAlias !== undefined) {
370
+ requestContext.setQueryParam("customerAlias", ObjectSerializer_1.ObjectSerializer.serialize(customerAlias, "string", ""));
371
+ }
372
+ // Query Params
373
+ if (limit !== undefined) {
374
+ requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", ""));
375
+ }
376
+ // Query Params
377
+ if (cursor !== undefined) {
378
+ requestContext.setQueryParam("cursor", ObjectSerializer_1.ObjectSerializer.serialize(cursor, "string", ""));
379
+ }
380
+ let authMethod;
381
+ // Apply auth methods
382
+ authMethod = _config.authMethods["BearerAuthorizer"];
383
+ if (authMethod?.applySecurityAuthentication) {
384
+ await authMethod?.applySecurityAuthentication(requestContext);
385
+ }
386
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
387
+ if (defaultAuth?.applySecurityAuthentication) {
388
+ await defaultAuth?.applySecurityAuthentication(requestContext);
389
+ }
390
+ return requestContext;
391
+ }
392
+ /**
393
+ * Aggregate events by meters and time grouping via the events-service.
394
+ * Aggregate events (v2)
395
+ * @param v2QueryEventsAggregationRequest Configuration for aggregating events by meters and time grouping.
396
+ */
397
+ async v2QueryEventsAggregation(v2QueryEventsAggregationRequest, _options) {
398
+ let _config = _options || this.configuration;
399
+ // verify required parameter 'v2QueryEventsAggregationRequest' is not null or undefined
400
+ if (v2QueryEventsAggregationRequest === null || v2QueryEventsAggregationRequest === undefined) {
401
+ throw new baseapi_1.RequiredError("EventsApi", "v2QueryEventsAggregation", "v2QueryEventsAggregationRequest");
402
+ }
403
+ // Path Params
404
+ const localVarPath = '/v2/events/aggregation';
405
+ // Make Request Context
406
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
407
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
408
+ // Body Params
409
+ const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
410
+ "application/json"
411
+ ]);
412
+ requestContext.setHeaderParam("Content-Type", contentType);
413
+ const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(v2QueryEventsAggregationRequest, "V2QueryEventsAggregationRequest", ""), contentType);
414
+ requestContext.setBody(serializedBody);
415
+ let authMethod;
416
+ // Apply auth methods
417
+ authMethod = _config.authMethods["BearerAuthorizer"];
418
+ if (authMethod?.applySecurityAuthentication) {
419
+ await authMethod?.applySecurityAuthentication(requestContext);
420
+ }
421
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
422
+ if (defaultAuth?.applySecurityAuthentication) {
423
+ await defaultAuth?.applySecurityAuthentication(requestContext);
424
+ }
425
+ return requestContext;
426
+ }
427
+ /**
428
+ * Submit a batch of events for ingestion via the events-service.
429
+ * Submit a batch of events for ingestion (v2)
430
+ * @param v2SendEventsRequest An array of events following the EventInput schema. Up to 1000 events or a total payload max size of 256KB
431
+ */
432
+ async v2SendEvents(v2SendEventsRequest, _options) {
433
+ let _config = _options || this.configuration;
434
+ // verify required parameter 'v2SendEventsRequest' is not null or undefined
435
+ if (v2SendEventsRequest === null || v2SendEventsRequest === undefined) {
436
+ throw new baseapi_1.RequiredError("EventsApi", "v2SendEvents", "v2SendEventsRequest");
437
+ }
438
+ // Path Params
439
+ const localVarPath = '/v2/events';
440
+ // Make Request Context
441
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
442
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
443
+ // Body Params
444
+ const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
445
+ "application/json"
446
+ ]);
447
+ requestContext.setHeaderParam("Content-Type", contentType);
448
+ const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(v2SendEventsRequest, "V2SendEventsRequest", ""), contentType);
449
+ requestContext.setBody(serializedBody);
450
+ let authMethod;
451
+ // Apply auth methods
452
+ authMethod = _config.authMethods["BearerAuthorizer"];
453
+ if (authMethod?.applySecurityAuthentication) {
454
+ await authMethod?.applySecurityAuthentication(requestContext);
455
+ }
456
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
457
+ if (defaultAuth?.applySecurityAuthentication) {
458
+ await defaultAuth?.applySecurityAuthentication(requestContext);
459
+ }
460
+ return requestContext;
461
+ }
462
+ /**
463
+ * Submit a batch of events for testing via the events-service. NOTE: this is a dry run and will not store the events.
464
+ * Submit a batch of events for testing (v2)
465
+ * @param v2EventsDryRunRequest An array of events following the EventInput schema. Up to 1000 events or a total payload max size of 256KB
466
+ */
467
+ async v2SendEventsDryRun(v2EventsDryRunRequest, _options) {
468
+ let _config = _options || this.configuration;
469
+ // verify required parameter 'v2EventsDryRunRequest' is not null or undefined
470
+ if (v2EventsDryRunRequest === null || v2EventsDryRunRequest === undefined) {
471
+ throw new baseapi_1.RequiredError("EventsApi", "v2SendEventsDryRun", "v2EventsDryRunRequest");
472
+ }
473
+ // Path Params
474
+ const localVarPath = '/v2/events/dry-run';
475
+ // Make Request Context
476
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
477
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
478
+ // Body Params
479
+ const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
480
+ "application/json"
481
+ ]);
482
+ requestContext.setHeaderParam("Content-Type", contentType);
483
+ const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(v2EventsDryRunRequest, "V2EventsDryRunRequest", ""), contentType);
484
+ requestContext.setBody(serializedBody);
485
+ let authMethod;
486
+ // Apply auth methods
487
+ authMethod = _config.authMethods["BearerAuthorizer"];
488
+ if (authMethod?.applySecurityAuthentication) {
489
+ await authMethod?.applySecurityAuthentication(requestContext);
490
+ }
491
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
492
+ if (defaultAuth?.applySecurityAuthentication) {
493
+ await defaultAuth?.applySecurityAuthentication(requestContext);
494
+ }
495
+ return requestContext;
496
+ }
233
497
  }
234
498
  exports.EventsApiRequestFactory = EventsApiRequestFactory;
235
499
  class EventsApiResponseProcessor {
@@ -247,16 +511,24 @@ class EventsApiResponseProcessor {
247
511
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
248
512
  }
249
513
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
250
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
514
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
515
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
251
516
  }
252
517
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
253
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
518
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
519
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
520
+ }
521
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
522
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
523
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
254
524
  }
255
525
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
256
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
526
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
527
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
257
528
  }
258
529
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
259
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
530
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
531
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
260
532
  }
261
533
  // Work around for missing responses in specification, e.g. for petstore.yaml
262
534
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -279,16 +551,24 @@ class EventsApiResponseProcessor {
279
551
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
280
552
  }
281
553
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
282
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
554
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
555
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
283
556
  }
284
557
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
285
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
558
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
559
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
560
+ }
561
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
562
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
563
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
286
564
  }
287
565
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
288
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
566
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
567
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
289
568
  }
290
569
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
291
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
570
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
571
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
292
572
  }
293
573
  // Work around for missing responses in specification, e.g. for petstore.yaml
294
574
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -311,16 +591,24 @@ class EventsApiResponseProcessor {
311
591
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
312
592
  }
313
593
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
314
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
594
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
595
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
315
596
  }
316
597
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
317
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
598
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
599
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
600
+ }
601
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
602
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
603
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
318
604
  }
319
605
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
320
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
606
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
607
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
321
608
  }
322
609
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
323
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
610
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
611
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
324
612
  }
325
613
  // Work around for missing responses in specification, e.g. for petstore.yaml
326
614
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -343,16 +631,20 @@ class EventsApiResponseProcessor {
343
631
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
344
632
  }
345
633
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
346
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
634
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
635
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
347
636
  }
348
637
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
349
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
638
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
639
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
350
640
  }
351
641
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
352
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
642
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
643
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
353
644
  }
354
645
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
355
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
646
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
647
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
356
648
  }
357
649
  // Work around for missing responses in specification, e.g. for petstore.yaml
358
650
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -375,16 +667,24 @@ class EventsApiResponseProcessor {
375
667
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
376
668
  }
377
669
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
378
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
670
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
671
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
379
672
  }
380
673
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
381
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
674
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
675
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
676
+ }
677
+ if ((0, util_1.isCodeInRange)("413", response.httpStatusCode)) {
678
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RequestTooLongErrorResponse", "");
679
+ throw new exception_1.ApiException(response.httpStatusCode, "Request Entity Too Large", body, response.headers);
382
680
  }
383
681
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
384
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
682
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
683
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
385
684
  }
386
685
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
387
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
686
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
687
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
388
688
  }
389
689
  // Work around for missing responses in specification, e.g. for petstore.yaml
390
690
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -407,16 +707,24 @@ class EventsApiResponseProcessor {
407
707
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
408
708
  }
409
709
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
410
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
710
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
711
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
411
712
  }
412
713
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
413
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
714
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
715
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
716
+ }
717
+ if ((0, util_1.isCodeInRange)("413", response.httpStatusCode)) {
718
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RequestTooLongErrorResponse", "");
719
+ throw new exception_1.ApiException(response.httpStatusCode, "Request Entity Too Large", body, response.headers);
414
720
  }
415
721
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
416
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
722
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
723
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
417
724
  }
418
725
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
419
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
726
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
727
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
420
728
  }
421
729
  // Work around for missing responses in specification, e.g. for petstore.yaml
422
730
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -425,5 +733,277 @@ class EventsApiResponseProcessor {
425
733
  }
426
734
  throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
427
735
  }
736
+ /**
737
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
738
+ * to the expected objects
739
+ *
740
+ * @params response Response returned by the server for a request to v2DeleteEventByRefId
741
+ * @throws ApiException if the response code was not in [200, 299]
742
+ */
743
+ async v2DeleteEventByRefIdWithHttpInfo(response) {
744
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
745
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
746
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2DeleteEventResponse", "");
747
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
748
+ }
749
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
750
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
751
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
752
+ }
753
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
754
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
755
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
756
+ }
757
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
758
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
759
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
760
+ }
761
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
762
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
763
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
764
+ }
765
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
766
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
767
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
768
+ }
769
+ // Work around for missing responses in specification, e.g. for petstore.yaml
770
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
771
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2DeleteEventResponse", "");
772
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
773
+ }
774
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
775
+ }
776
+ /**
777
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
778
+ * to the expected objects
779
+ *
780
+ * @params response Response returned by the server for a request to v2DeleteEventsByRefs
781
+ * @throws ApiException if the response code was not in [200, 299]
782
+ */
783
+ async v2DeleteEventsByRefsWithHttpInfo(response) {
784
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
785
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
786
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2DeleteEventsByRefsResponse", "");
787
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
788
+ }
789
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
790
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
791
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
792
+ }
793
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
794
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
795
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
796
+ }
797
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
798
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
799
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
800
+ }
801
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
802
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
803
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
804
+ }
805
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
806
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
807
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
808
+ }
809
+ // Work around for missing responses in specification, e.g. for petstore.yaml
810
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
811
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2DeleteEventsByRefsResponse", "");
812
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
813
+ }
814
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
815
+ }
816
+ /**
817
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
818
+ * to the expected objects
819
+ *
820
+ * @params response Response returned by the server for a request to v2GetEventByRefId
821
+ * @throws ApiException if the response code was not in [200, 299]
822
+ */
823
+ async v2GetEventByRefIdWithHttpInfo(response) {
824
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
825
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
826
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2GetEventResponse", "");
827
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
828
+ }
829
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
830
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
831
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
832
+ }
833
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
834
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
835
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
836
+ }
837
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
838
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
839
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
840
+ }
841
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
842
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
843
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
844
+ }
845
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
846
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
847
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
848
+ }
849
+ // Work around for missing responses in specification, e.g. for petstore.yaml
850
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
851
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2GetEventResponse", "");
852
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
853
+ }
854
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
855
+ }
856
+ /**
857
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
858
+ * to the expected objects
859
+ *
860
+ * @params response Response returned by the server for a request to v2QueryEvents
861
+ * @throws ApiException if the response code was not in [200, 299]
862
+ */
863
+ async v2QueryEventsWithHttpInfo(response) {
864
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
865
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
866
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2QueryEventsResponse", "");
867
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
868
+ }
869
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
870
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
871
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
872
+ }
873
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
874
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
875
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
876
+ }
877
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
878
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
879
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
880
+ }
881
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
882
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
883
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
884
+ }
885
+ // Work around for missing responses in specification, e.g. for petstore.yaml
886
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
887
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2QueryEventsResponse", "");
888
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
889
+ }
890
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
891
+ }
892
+ /**
893
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
894
+ * to the expected objects
895
+ *
896
+ * @params response Response returned by the server for a request to v2QueryEventsAggregation
897
+ * @throws ApiException if the response code was not in [200, 299]
898
+ */
899
+ async v2QueryEventsAggregationWithHttpInfo(response) {
900
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
901
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
902
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2QueryEventsAggregationResponse", "");
903
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
904
+ }
905
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
906
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
907
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
908
+ }
909
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
910
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
911
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
912
+ }
913
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
914
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
915
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
916
+ }
917
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
918
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
919
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
920
+ }
921
+ // Work around for missing responses in specification, e.g. for petstore.yaml
922
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
923
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2QueryEventsAggregationResponse", "");
924
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
925
+ }
926
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
927
+ }
928
+ /**
929
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
930
+ * to the expected objects
931
+ *
932
+ * @params response Response returned by the server for a request to v2SendEvents
933
+ * @throws ApiException if the response code was not in [200, 299]
934
+ */
935
+ async v2SendEventsWithHttpInfo(response) {
936
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
937
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
938
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2SendEventsResponse", "");
939
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
940
+ }
941
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
942
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
943
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
944
+ }
945
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
946
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
947
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
948
+ }
949
+ if ((0, util_1.isCodeInRange)("413", response.httpStatusCode)) {
950
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RequestTooLongErrorResponse", "");
951
+ throw new exception_1.ApiException(response.httpStatusCode, "Request Entity Too Large", body, response.headers);
952
+ }
953
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
954
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
955
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
956
+ }
957
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
958
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
959
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
960
+ }
961
+ // Work around for missing responses in specification, e.g. for petstore.yaml
962
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
963
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2SendEventsResponse", "");
964
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
965
+ }
966
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
967
+ }
968
+ /**
969
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
970
+ * to the expected objects
971
+ *
972
+ * @params response Response returned by the server for a request to v2SendEventsDryRun
973
+ * @throws ApiException if the response code was not in [200, 299]
974
+ */
975
+ async v2SendEventsDryRunWithHttpInfo(response) {
976
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
977
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
978
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2EventsDryRunResponse", "");
979
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
980
+ }
981
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
982
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
983
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
984
+ }
985
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
986
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
987
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
988
+ }
989
+ if ((0, util_1.isCodeInRange)("413", response.httpStatusCode)) {
990
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RequestTooLongErrorResponse", "");
991
+ throw new exception_1.ApiException(response.httpStatusCode, "Request Entity Too Large", body, response.headers);
992
+ }
993
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
994
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
995
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
996
+ }
997
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
998
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
999
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
1000
+ }
1001
+ // Work around for missing responses in specification, e.g. for petstore.yaml
1002
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1003
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "V2EventsDryRunResponse", "");
1004
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
1005
+ }
1006
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
1007
+ }
428
1008
  }
429
1009
  exports.EventsApiResponseProcessor = EventsApiResponseProcessor;