vayu-ts 0.2.5 → 0.2.7-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/openapi/apis/AuthApi.js +47 -61
- package/dist/openapi/apis/ContractsApi.js +203 -232
- package/dist/openapi/apis/CreditsApi.js +162 -186
- package/dist/openapi/apis/CustomersApi.d.ts +15 -0
- package/dist/openapi/apis/CustomersApi.js +378 -353
- package/dist/openapi/apis/EventsApi.js +282 -316
- package/dist/openapi/apis/IntegrationsApi.js +105 -124
- package/dist/openapi/apis/InvoicesApi.js +100 -119
- package/dist/openapi/apis/MetersApi.js +211 -240
- package/dist/openapi/apis/PlansApi.js +150 -174
- package/dist/openapi/apis/ProductConsumptionsApi.d.ts +25 -0
- package/dist/openapi/apis/ProductConsumptionsApi.js +82 -0
- package/dist/openapi/apis/ReportsApi.js +100 -119
- package/dist/openapi/apis/WebhooksApi.js +55 -69
- package/dist/openapi/auth/auth.d.ts +1 -0
- package/dist/openapi/auth/auth.js +2 -13
- package/dist/openapi/http/http.d.ts +7 -20
- package/dist/openapi/http/http.js +15 -25
- package/dist/openapi/index.d.ts +3 -3
- package/dist/openapi/index.js +2 -1
- package/dist/openapi/models/Address.d.ts +3 -0
- package/dist/openapi/models/Address.js +1 -0
- package/dist/openapi/models/AggregationMethod.d.ts +3 -0
- package/dist/openapi/models/AggregationMethod.js +1 -0
- package/dist/openapi/models/Condition.d.ts +3 -0
- package/dist/openapi/models/Condition.js +1 -0
- package/dist/openapi/models/Contact.d.ts +4 -1
- package/dist/openapi/models/Contact.js +3 -2
- package/dist/openapi/models/ContractStatus.d.ts +1 -0
- package/dist/openapi/models/ContractStatus.js +1 -0
- package/dist/openapi/models/CreateContractRequest.d.ts +3 -0
- package/dist/openapi/models/CreateContractRequest.js +1 -0
- package/dist/openapi/models/CreateContractResponse.d.ts +3 -0
- package/dist/openapi/models/CreateContractResponse.js +1 -0
- package/dist/openapi/models/CreateCustomerRequest.d.ts +3 -0
- package/dist/openapi/models/CreateCustomerRequest.js +1 -0
- package/dist/openapi/models/CreateCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/CreateCustomerResponse.js +1 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +3 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.js +1 -0
- package/dist/openapi/models/CreditLedgerEntry.d.ts +3 -0
- package/dist/openapi/models/CreditLedgerEntry.js +1 -0
- package/dist/openapi/models/Criterion.d.ts +3 -0
- package/dist/openapi/models/Criterion.js +1 -0
- package/dist/openapi/models/CriterionOperator.d.ts +3 -1
- package/dist/openapi/models/CriterionOperator.js +2 -0
- package/dist/openapi/models/DeductCreditsRequest.d.ts +3 -0
- package/dist/openapi/models/DeductCreditsRequest.js +1 -0
- package/dist/openapi/models/DeleteContractResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteContractResponse.js +1 -0
- package/dist/openapi/models/DeleteContractResponseContract.d.ts +3 -0
- package/dist/openapi/models/DeleteContractResponseContract.js +1 -0
- package/dist/openapi/models/DeleteCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteCustomerResponse.js +1 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +3 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.js +1 -0
- package/dist/openapi/models/DeleteEventResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteEventResponse.js +1 -0
- package/dist/openapi/models/DeleteEventResponseEvent.d.ts +3 -0
- package/dist/openapi/models/DeleteEventResponseEvent.js +1 -0
- package/dist/openapi/models/DeleteMeterResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteMeterResponse.js +1 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.d.ts +3 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.js +1 -0
- package/dist/openapi/models/DeletePlanResponse.d.ts +3 -0
- package/dist/openapi/models/DeletePlanResponse.js +1 -0
- package/dist/openapi/models/DeletePlanResponsePlan.d.ts +3 -0
- package/dist/openapi/models/DeletePlanResponsePlan.js +1 -0
- package/dist/openapi/models/Event.d.ts +3 -0
- package/dist/openapi/models/Event.js +1 -0
- package/dist/openapi/models/EventsDryRunRequest.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunRequest.js +1 -0
- package/dist/openapi/models/EventsDryRunResponse.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponse.js +1 -0
- package/dist/openapi/models/EventsDryRunResponseObject.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponseObject.js +1 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.js +1 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.js +1 -0
- package/dist/openapi/models/Filter.d.ts +3 -0
- package/dist/openapi/models/Filter.js +1 -0
- package/dist/openapi/models/FullDayPeriod.d.ts +3 -0
- package/dist/openapi/models/FullDayPeriod.js +1 -0
- package/dist/openapi/models/GetCommitmentReportResponse.d.ts +5 -0
- package/dist/openapi/models/GetCommitmentReportResponse.js +13 -0
- package/dist/openapi/models/GetContractResponse.d.ts +3 -0
- package/dist/openapi/models/GetContractResponse.js +1 -0
- package/dist/openapi/models/GetContractResponseContract.d.ts +3 -0
- package/dist/openapi/models/GetContractResponseContract.js +1 -0
- package/dist/openapi/models/GetCustomerProductsConsumptionsResponse.d.ts +32 -0
- package/dist/openapi/models/GetCustomerProductsConsumptionsResponse.js +32 -0
- package/dist/openapi/models/GetCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/GetCustomerResponse.js +1 -0
- package/dist/openapi/models/GetEventResponse.d.ts +3 -0
- package/dist/openapi/models/GetEventResponse.js +1 -0
- package/dist/openapi/models/GetEventResponseEvent.d.ts +3 -0
- package/dist/openapi/models/GetEventResponseEvent.js +1 -0
- package/dist/openapi/models/GetInvoiceResponse.d.ts +3 -0
- package/dist/openapi/models/GetInvoiceResponse.js +1 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.d.ts +3 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.js +1 -0
- package/dist/openapi/models/GetMeterResponse.d.ts +3 -0
- package/dist/openapi/models/GetMeterResponse.js +1 -0
- package/dist/openapi/models/GetMeterResponseMeter.d.ts +3 -0
- package/dist/openapi/models/GetMeterResponseMeter.js +1 -0
- package/dist/openapi/models/GetPlanResponse.d.ts +3 -0
- package/dist/openapi/models/GetPlanResponse.js +1 -0
- package/dist/openapi/models/GetPlanResponsePlan.d.ts +3 -0
- package/dist/openapi/models/GetPlanResponsePlan.js +1 -0
- package/dist/openapi/models/GetProductConsumptionResponse.d.ts +32 -0
- package/dist/openapi/models/GetProductConsumptionResponse.js +32 -0
- package/dist/openapi/models/GetProductConsumptionResponseProductConsumption.d.ts +59 -0
- package/dist/openapi/models/GetProductConsumptionResponseProductConsumption.js +74 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.d.ts +5 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.js +13 -0
- package/dist/openapi/models/GrantCreditsRequest.d.ts +3 -0
- package/dist/openapi/models/GrantCreditsRequest.js +1 -0
- package/dist/openapi/models/InvalidEvent.d.ts +3 -0
- package/dist/openapi/models/InvalidEvent.js +1 -0
- package/dist/openapi/models/LineItem.d.ts +3 -0
- package/dist/openapi/models/LineItem.js +1 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.d.ts +3 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.js +1 -0
- package/dist/openapi/models/ListContractsResponse.d.ts +3 -0
- package/dist/openapi/models/ListContractsResponse.js +1 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.d.ts +3 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.js +1 -0
- package/dist/openapi/models/ListCustomersResponse.d.ts +3 -0
- package/dist/openapi/models/ListCustomersResponse.js +1 -0
- package/dist/openapi/models/ListInvoicesResponse.d.ts +3 -0
- package/dist/openapi/models/ListInvoicesResponse.js +1 -0
- package/dist/openapi/models/ListMetersResponse.d.ts +3 -0
- package/dist/openapi/models/ListMetersResponse.js +1 -0
- package/dist/openapi/models/ListPlansResponse.d.ts +3 -0
- package/dist/openapi/models/ListPlansResponse.js +1 -0
- package/dist/openapi/models/LoginRequest.d.ts +3 -0
- package/dist/openapi/models/LoginRequest.js +1 -0
- package/dist/openapi/models/LoginResponse.d.ts +3 -0
- package/dist/openapi/models/LoginResponse.js +1 -0
- package/dist/openapi/models/Meter.d.ts +3 -0
- package/dist/openapi/models/Meter.js +1 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.d.ts +3 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.js +1 -0
- package/dist/openapi/models/NotificationEventType.d.ts +2 -1
- package/dist/openapi/models/NotificationEventType.js +1 -0
- package/dist/openapi/models/ObjectSerializer.d.ts +6 -0
- package/dist/openapi/models/ObjectSerializer.js +68 -11
- package/dist/openapi/models/PlanBillingData.d.ts +5 -1
- package/dist/openapi/models/PlanBillingData.js +2 -1
- package/dist/{openapi-v2/models/UpdateEventPayload.d.ts → openapi/models/PlanDuration.d.ts} +7 -10
- package/dist/openapi/models/PlanDuration.js +25 -0
- package/dist/openapi/models/ProductConsumption.d.ts +59 -0
- package/dist/openapi/models/ProductConsumption.js +74 -0
- package/dist/openapi/models/QueryEventsResponse.d.ts +3 -0
- package/dist/openapi/models/QueryEventsResponse.js +1 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.d.ts +3 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.js +1 -0
- package/dist/openapi/models/SendEventsRequest.d.ts +3 -0
- package/dist/openapi/models/SendEventsRequest.js +1 -0
- package/dist/openapi/models/SendEventsResponse.d.ts +3 -0
- package/dist/openapi/models/SendEventsResponse.js +1 -0
- package/dist/openapi/models/UnlimitedDuration.d.ts +14 -0
- package/dist/openapi/models/UnlimitedDuration.js +18 -0
- package/dist/openapi/models/UpdateCustomerRequest.d.ts +3 -0
- package/dist/openapi/models/UpdateCustomerRequest.js +1 -0
- package/dist/openapi/models/UpdateCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/UpdateCustomerResponse.js +1 -0
- package/dist/openapi/models/UpdateMeterRequest.d.ts +3 -0
- package/dist/openapi/models/UpdateMeterRequest.js +1 -0
- package/dist/openapi/models/UpdateMeterResponse.d.ts +3 -0
- package/dist/openapi/models/UpdateMeterResponse.js +1 -0
- package/dist/openapi/models/WebhookSubscribeRequest.d.ts +3 -0
- package/dist/openapi/models/WebhookSubscribeRequest.js +1 -0
- package/dist/openapi/models/all.d.ts +6 -0
- package/dist/openapi/models/all.js +6 -0
- package/dist/openapi/servers.js +2 -3
- package/dist/openapi/types/ObservableAPI.d.ts +71 -38
- package/dist/openapi/types/ObservableAPI.js +172 -105
- package/dist/openapi/types/PromiseAPI.d.ts +69 -38
- package/dist/openapi/types/PromiseAPI.js +85 -42
- package/dist/openapi-v2/apis/AuthenticationApi.js +35 -49
- package/dist/openapi-v2/apis/CustomersApi.d.ts +15 -9
- package/dist/openapi-v2/apis/CustomersApi.js +245 -278
- package/dist/openapi-v2/apis/EntitlementsApi.d.ts +6 -3
- package/dist/openapi-v2/apis/EntitlementsApi.js +104 -125
- package/dist/openapi-v2/apis/EventsApi.d.ts +8 -4
- package/dist/openapi-v2/apis/EventsApi.js +144 -169
- package/dist/openapi-v2/apis/InvoicesApi.d.ts +13 -7
- package/dist/openapi-v2/apis/InvoicesApi.js +227 -260
- package/dist/openapi-v2/apis/ProductsApi.d.ts +11 -6
- package/dist/openapi-v2/apis/ProductsApi.js +193 -222
- package/dist/openapi-v2/auth/auth.d.ts +1 -0
- package/dist/openapi-v2/http/http.d.ts +7 -20
- package/dist/openapi-v2/http/http.js +15 -25
- package/dist/openapi-v2/index.d.ts +2 -2
- package/dist/openapi-v2/models/APICreateCustomerPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APICreateCustomerPayload.js +1 -0
- package/dist/openapi-v2/models/APICreateInvoicePayload.d.ts +3 -0
- package/dist/openapi-v2/models/APICreateInvoicePayload.js +1 -0
- package/dist/openapi-v2/models/APICreateProductPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APICreateProductPayload.js +1 -0
- package/dist/openapi-v2/models/APICustomer.d.ts +3 -0
- package/dist/openapi-v2/models/APICustomer.js +1 -0
- package/dist/openapi-v2/models/APIEntitlement.d.ts +3 -0
- package/dist/openapi-v2/models/APIEntitlement.js +1 -0
- package/dist/openapi-v2/models/APIEvent.d.ts +3 -0
- package/dist/openapi-v2/models/APIEvent.js +1 -0
- package/dist/openapi-v2/models/APIIngestEventPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIIngestEventPayload.js +1 -0
- package/dist/openapi-v2/models/APIInvoice.d.ts +3 -0
- package/dist/openapi-v2/models/APIInvoice.js +1 -0
- package/dist/openapi-v2/models/APIInvoiceBillingPeriod.d.ts +3 -0
- package/dist/openapi-v2/models/APIInvoiceBillingPeriod.js +1 -0
- package/dist/openapi-v2/models/APIProduct.d.ts +3 -0
- package/dist/openapi-v2/models/APIProduct.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.js +1 -0
- package/dist/openapi-v2/models/APIUpdateCustomerPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIUpdateCustomerPayload.js +1 -0
- package/dist/openapi-v2/models/APIUpdateInvoicePayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIUpdateInvoicePayload.js +1 -0
- package/dist/openapi-v2/models/APIUpdateProductPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIUpdateProductPayload.js +1 -0
- package/dist/openapi-v2/models/Aggregation.d.ts +3 -0
- package/dist/openapi-v2/models/Aggregation.js +1 -0
- package/dist/openapi-v2/models/Condition.d.ts +3 -0
- package/dist/openapi-v2/models/Condition.js +1 -0
- package/dist/openapi-v2/models/Criterion.d.ts +3 -0
- package/dist/openapi-v2/models/Criterion.js +1 -0
- package/dist/openapi-v2/models/CriterionValue.d.ts +3 -0
- package/dist/openapi-v2/models/CriterionValue.js +1 -0
- package/dist/openapi-v2/models/EntitlementRevision.d.ts +3 -0
- package/dist/openapi-v2/models/EntitlementRevision.js +1 -0
- package/dist/openapi-v2/models/IngestEventToTheSystem201Response.d.ts +3 -0
- package/dist/openapi-v2/models/IngestEventToTheSystem201Response.js +1 -0
- package/dist/openapi-v2/models/InvoiceProductBreakdown.d.ts +3 -0
- package/dist/openapi-v2/models/InvoiceProductBreakdown.js +1 -0
- package/dist/openapi-v2/models/Login200Response.d.ts +3 -0
- package/dist/openapi-v2/models/Login200Response.js +1 -0
- package/dist/openapi-v2/models/LoginRequest.d.ts +3 -0
- package/dist/openapi-v2/models/LoginRequest.js +1 -0
- package/dist/openapi-v2/models/ObjectSerializer.d.ts +1 -2
- package/dist/openapi-v2/models/ObjectSerializer.js +53 -17
- package/dist/openapi-v2/models/Pricing.d.ts +5 -0
- package/dist/openapi-v2/models/Pricing.js +7 -0
- package/dist/openapi-v2/models/PricingCadence.d.ts +18 -0
- package/dist/openapi-v2/models/PricingCadence.js +22 -0
- package/dist/openapi-v2/models/PricingTiersInner.d.ts +3 -0
- package/dist/openapi-v2/models/PricingTiersInner.js +1 -0
- package/dist/openapi-v2/models/ProductBreakdown.d.ts +3 -0
- package/dist/openapi-v2/models/ProductBreakdown.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPICustomer.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPICustomer.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIEntitlement.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIEntitlement.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIEvent.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIEvent.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIInvoice.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIInvoice.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIProduct.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIProduct.js +1 -0
- package/dist/openapi-v2/models/ReviseEntitlementPayload.d.ts +3 -0
- package/dist/openapi-v2/models/ReviseEntitlementPayload.js +1 -0
- package/dist/openapi-v2/models/all.d.ts +1 -2
- package/dist/openapi-v2/models/all.js +1 -2
- package/dist/openapi-v2/servers.js +2 -3
- package/dist/openapi-v2/types/ObservableAPI.d.ts +106 -58
- package/dist/openapi-v2/types/ObservableAPI.js +156 -108
- package/dist/openapi-v2/types/PromiseAPI.d.ts +106 -58
- package/dist/openapi-v2/types/PromiseAPI.js +106 -58
- package/dist/sdk/clients/ContractsClient.js +10 -27
- package/dist/sdk/clients/CustomersClient.js +14 -35
- package/dist/sdk/clients/EventsClient.js +13 -32
- package/dist/sdk/clients/InvoicesClient.js +6 -19
- package/dist/sdk/clients/MetersClient.js +10 -27
- package/dist/sdk/clients/PlansClient.js +8 -23
- package/dist/sdk/clients/ProductsConsumptionsClient.d.ts +5 -0
- package/dist/sdk/clients/ProductsConsumptionsClient.js +14 -0
- package/dist/sdk/clients/WebhooksClient.js +2 -13
- package/dist/sdk/clients/index.d.ts +1 -0
- package/dist/sdk/clients/index.js +1 -0
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +5 -13
- package/dist/sdk/services/configuration.service.js +21 -33
- package/dist/sdk-v2/clients/CustomersClient.js +12 -33
- package/dist/sdk-v2/clients/EntitlementsClient.js +6 -21
- package/dist/sdk-v2/clients/EventsClient.js +8 -25
- package/dist/sdk-v2/clients/InvoicesClient.js +12 -33
- package/dist/sdk-v2/clients/ProductsClient.js +10 -29
- package/dist/sdk-v2/index.js +2 -13
- package/dist/sdk-v2/services/configuration.service.js +22 -34
- package/dist/sdk-v2/types/index.d.ts +1 -1
- package/dist/sdk-v2/types/index.js +2 -1
- package/package.json +1 -1
- package/dist/openapi-v2/models/Event.d.ts +0 -54
- package/dist/openapi-v2/models/Event.js +0 -85
- package/dist/openapi-v2/models/UpdateEventPayload.js +0 -31
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.PlansApiResponseProcessor = exports.PlansApiRequestFactory = void 0;
|
|
13
4
|
// TODO: better import syntax?
|
|
@@ -25,64 +16,58 @@ class PlansApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
|
25
16
|
* Delete Plan
|
|
26
17
|
* @param planId
|
|
27
18
|
*/
|
|
28
|
-
deletePlan(planId, _options) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
authMethod
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
return requestContext;
|
|
53
|
-
});
|
|
19
|
+
async deletePlan(planId, _options) {
|
|
20
|
+
let _config = _options || this.configuration;
|
|
21
|
+
// verify required parameter 'planId' is not null or undefined
|
|
22
|
+
if (planId === null || planId === undefined) {
|
|
23
|
+
throw new baseapi_1.RequiredError("PlansApi", "deletePlan", "planId");
|
|
24
|
+
}
|
|
25
|
+
// Path Params
|
|
26
|
+
const localVarPath = '/plans/{planId}'
|
|
27
|
+
.replace('{' + 'planId' + '}', encodeURIComponent(String(planId)));
|
|
28
|
+
// Make Request Context
|
|
29
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
|
|
30
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
31
|
+
let authMethod;
|
|
32
|
+
// Apply auth methods
|
|
33
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
34
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
35
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
36
|
+
}
|
|
37
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
38
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
39
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
40
|
+
}
|
|
41
|
+
return requestContext;
|
|
54
42
|
}
|
|
55
43
|
/**
|
|
56
44
|
* Get a Plan by id.
|
|
57
45
|
* Get Plan
|
|
58
46
|
* @param planId
|
|
59
47
|
*/
|
|
60
|
-
getPlan(planId, _options) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
authMethod
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
return requestContext;
|
|
85
|
-
});
|
|
48
|
+
async getPlan(planId, _options) {
|
|
49
|
+
let _config = _options || this.configuration;
|
|
50
|
+
// verify required parameter 'planId' is not null or undefined
|
|
51
|
+
if (planId === null || planId === undefined) {
|
|
52
|
+
throw new baseapi_1.RequiredError("PlansApi", "getPlan", "planId");
|
|
53
|
+
}
|
|
54
|
+
// Path Params
|
|
55
|
+
const localVarPath = '/plans/{planId}'
|
|
56
|
+
.replace('{' + 'planId' + '}', encodeURIComponent(String(planId)));
|
|
57
|
+
// Make Request Context
|
|
58
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
59
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
60
|
+
let authMethod;
|
|
61
|
+
// Apply auth methods
|
|
62
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
63
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
64
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
65
|
+
}
|
|
66
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
67
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
68
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
69
|
+
}
|
|
70
|
+
return requestContext;
|
|
86
71
|
}
|
|
87
72
|
/**
|
|
88
73
|
* Get a list of Plans.
|
|
@@ -90,35 +75,32 @@ class PlansApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
|
90
75
|
* @param limit
|
|
91
76
|
* @param cursor
|
|
92
77
|
*/
|
|
93
|
-
listPlans(limit, cursor, _options) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
authMethod
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
return requestContext;
|
|
121
|
-
});
|
|
78
|
+
async listPlans(limit, cursor, _options) {
|
|
79
|
+
let _config = _options || this.configuration;
|
|
80
|
+
// Path Params
|
|
81
|
+
const localVarPath = '/plans';
|
|
82
|
+
// Make Request Context
|
|
83
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
84
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
85
|
+
// Query Params
|
|
86
|
+
if (limit !== undefined) {
|
|
87
|
+
requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", ""));
|
|
88
|
+
}
|
|
89
|
+
// Query Params
|
|
90
|
+
if (cursor !== undefined) {
|
|
91
|
+
requestContext.setQueryParam("cursor", ObjectSerializer_1.ObjectSerializer.serialize(cursor, "string", ""));
|
|
92
|
+
}
|
|
93
|
+
let authMethod;
|
|
94
|
+
// Apply auth methods
|
|
95
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
96
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
97
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
98
|
+
}
|
|
99
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
100
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
101
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
102
|
+
}
|
|
103
|
+
return requestContext;
|
|
122
104
|
}
|
|
123
105
|
}
|
|
124
106
|
exports.PlansApiRequestFactory = PlansApiRequestFactory;
|
|
@@ -130,35 +112,33 @@ class PlansApiResponseProcessor {
|
|
|
130
112
|
* @params response Response returned by the server for a request to deletePlan
|
|
131
113
|
* @throws ApiException if the response code was not in [200, 299]
|
|
132
114
|
*/
|
|
133
|
-
deletePlanWithHttpInfo(response) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
161
|
-
});
|
|
115
|
+
async deletePlanWithHttpInfo(response) {
|
|
116
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
117
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
118
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "DeletePlanResponse", "");
|
|
119
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
120
|
+
}
|
|
121
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
122
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
123
|
+
}
|
|
124
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
125
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
126
|
+
}
|
|
127
|
+
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
128
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
|
|
129
|
+
}
|
|
130
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
131
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
132
|
+
}
|
|
133
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
134
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
135
|
+
}
|
|
136
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
137
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
138
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "DeletePlanResponse", "");
|
|
139
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
140
|
+
}
|
|
141
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
162
142
|
}
|
|
163
143
|
/**
|
|
164
144
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
@@ -167,35 +147,33 @@ class PlansApiResponseProcessor {
|
|
|
167
147
|
* @params response Response returned by the server for a request to getPlan
|
|
168
148
|
* @throws ApiException if the response code was not in [200, 299]
|
|
169
149
|
*/
|
|
170
|
-
getPlanWithHttpInfo(response) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
198
|
-
});
|
|
150
|
+
async getPlanWithHttpInfo(response) {
|
|
151
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
152
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
153
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetPlanResponse", "");
|
|
154
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
155
|
+
}
|
|
156
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
157
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
158
|
+
}
|
|
159
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
160
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
161
|
+
}
|
|
162
|
+
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
163
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
|
|
164
|
+
}
|
|
165
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
166
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
167
|
+
}
|
|
168
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
169
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
170
|
+
}
|
|
171
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
172
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
173
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetPlanResponse", "");
|
|
174
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
175
|
+
}
|
|
176
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
199
177
|
}
|
|
200
178
|
/**
|
|
201
179
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
@@ -204,32 +182,30 @@ class PlansApiResponseProcessor {
|
|
|
204
182
|
* @params response Response returned by the server for a request to listPlans
|
|
205
183
|
* @throws ApiException if the response code was not in [200, 299]
|
|
206
184
|
*/
|
|
207
|
-
listPlansWithHttpInfo(response) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
232
|
-
});
|
|
185
|
+
async listPlansWithHttpInfo(response) {
|
|
186
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
187
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
188
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ListPlansResponse", "");
|
|
189
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
190
|
+
}
|
|
191
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
192
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
193
|
+
}
|
|
194
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
195
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
196
|
+
}
|
|
197
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
198
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
199
|
+
}
|
|
200
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
201
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
202
|
+
}
|
|
203
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
204
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
205
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ListPlansResponse", "");
|
|
206
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
207
|
+
}
|
|
208
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
233
209
|
}
|
|
234
210
|
}
|
|
235
211
|
exports.PlansApiResponseProcessor = PlansApiResponseProcessor;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseAPIRequestFactory } from './baseapi';
|
|
2
|
+
import { Configuration } from '../configuration';
|
|
3
|
+
import { RequestContext, ResponseContext, HttpInfo } from '../http/http';
|
|
4
|
+
import { GetProductConsumptionResponse } from '../models/GetProductConsumptionResponse';
|
|
5
|
+
/**
|
|
6
|
+
* no description
|
|
7
|
+
*/
|
|
8
|
+
export declare class ProductConsumptionsApiRequestFactory extends BaseAPIRequestFactory {
|
|
9
|
+
/**
|
|
10
|
+
* Use this action to get the consumption data for a product
|
|
11
|
+
* Get product consumption
|
|
12
|
+
* @param productId
|
|
13
|
+
*/
|
|
14
|
+
getProductConsumption(productId: string, _options?: Configuration): Promise<RequestContext>;
|
|
15
|
+
}
|
|
16
|
+
export declare class ProductConsumptionsApiResponseProcessor {
|
|
17
|
+
/**
|
|
18
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
19
|
+
* to the expected objects
|
|
20
|
+
*
|
|
21
|
+
* @params response Response returned by the server for a request to getProductConsumption
|
|
22
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
23
|
+
*/
|
|
24
|
+
getProductConsumptionWithHttpInfo(response: ResponseContext): Promise<HttpInfo<GetProductConsumptionResponse>>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductConsumptionsApiResponseProcessor = exports.ProductConsumptionsApiRequestFactory = void 0;
|
|
4
|
+
// TODO: better import syntax?
|
|
5
|
+
const baseapi_1 = require("./baseapi");
|
|
6
|
+
const http_1 = require("../http/http");
|
|
7
|
+
const ObjectSerializer_1 = require("../models/ObjectSerializer");
|
|
8
|
+
const exception_1 = require("./exception");
|
|
9
|
+
const util_1 = require("../util");
|
|
10
|
+
/**
|
|
11
|
+
* no description
|
|
12
|
+
*/
|
|
13
|
+
class ProductConsumptionsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
14
|
+
/**
|
|
15
|
+
* Use this action to get the consumption data for a product
|
|
16
|
+
* Get product consumption
|
|
17
|
+
* @param productId
|
|
18
|
+
*/
|
|
19
|
+
async getProductConsumption(productId, _options) {
|
|
20
|
+
let _config = _options || this.configuration;
|
|
21
|
+
// verify required parameter 'productId' is not null or undefined
|
|
22
|
+
if (productId === null || productId === undefined) {
|
|
23
|
+
throw new baseapi_1.RequiredError("ProductConsumptionsApi", "getProductConsumption", "productId");
|
|
24
|
+
}
|
|
25
|
+
// Path Params
|
|
26
|
+
const localVarPath = '/product-consumption/{productId}'
|
|
27
|
+
.replace('{' + 'productId' + '}', encodeURIComponent(String(productId)));
|
|
28
|
+
// Make Request Context
|
|
29
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
30
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
31
|
+
let authMethod;
|
|
32
|
+
// Apply auth methods
|
|
33
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
34
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
35
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
36
|
+
}
|
|
37
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
38
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
39
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
40
|
+
}
|
|
41
|
+
return requestContext;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.ProductConsumptionsApiRequestFactory = ProductConsumptionsApiRequestFactory;
|
|
45
|
+
class ProductConsumptionsApiResponseProcessor {
|
|
46
|
+
/**
|
|
47
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
48
|
+
* to the expected objects
|
|
49
|
+
*
|
|
50
|
+
* @params response Response returned by the server for a request to getProductConsumption
|
|
51
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
52
|
+
*/
|
|
53
|
+
async getProductConsumptionWithHttpInfo(response) {
|
|
54
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
55
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
56
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetProductConsumptionResponse", "");
|
|
57
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
58
|
+
}
|
|
59
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
60
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
61
|
+
}
|
|
62
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
63
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
64
|
+
}
|
|
65
|
+
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
66
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
|
|
67
|
+
}
|
|
68
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
69
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
70
|
+
}
|
|
71
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
72
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
73
|
+
}
|
|
74
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
75
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
76
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetProductConsumptionResponse", "");
|
|
77
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
78
|
+
}
|
|
79
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ProductConsumptionsApiResponseProcessor = ProductConsumptionsApiResponseProcessor;
|