vayu-ts 0.1.2 → 0.1.4
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/README.md +24 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/openapi/apis/AuthApi.d.ts +26 -0
- package/dist/openapi/apis/AuthApi.js +93 -0
- package/dist/openapi/apis/ContractsApi.d.ts +72 -0
- package/dist/openapi/apis/ContractsApi.js +307 -0
- package/dist/openapi/apis/CreditsApi.d.ts +57 -0
- package/dist/openapi/apis/CreditsApi.js +248 -0
- package/dist/openapi/apis/CustomersApi.d.ts +103 -0
- package/dist/openapi/apis/CustomersApi.js +457 -0
- package/dist/openapi/apis/EventsApi.d.ts +91 -0
- package/dist/openapi/apis/EventsApi.js +408 -0
- package/dist/openapi/apis/IntegrationsApi.d.ts +41 -0
- package/dist/openapi/apis/IntegrationsApi.js +170 -0
- package/dist/openapi/apis/InvoicesApi.d.ts +41 -0
- package/dist/openapi/apis/InvoicesApi.js +166 -0
- package/dist/openapi/apis/MetersApi.d.ts +73 -0
- package/dist/openapi/apis/MetersApi.js +316 -0
- package/dist/openapi/apis/PlansApi.d.ts +56 -0
- package/dist/openapi/apis/PlansApi.js +235 -0
- package/dist/openapi/apis/ReportsApi.d.ts +41 -0
- package/dist/openapi/apis/ReportsApi.js +166 -0
- package/dist/openapi/apis/WebhooksApi.d.ts +25 -0
- package/dist/openapi/apis/WebhooksApi.js +101 -0
- package/dist/openapi/apis/baseapi.d.ts +33 -0
- package/dist/openapi/apis/baseapi.js +41 -0
- package/dist/openapi/apis/exception.d.ts +19 -0
- package/dist/openapi/apis/exception.js +22 -0
- package/dist/openapi/auth/auth.d.ts +54 -0
- package/dist/openapi/auth/auth.js +50 -0
- package/dist/openapi/configuration.d.ts +63 -0
- package/dist/openapi/configuration.js +34 -0
- package/dist/openapi/http/http.d.ts +142 -0
- package/dist/openapi/http/http.js +229 -0
- package/dist/openapi/http/isomorphic-fetch.d.ts +5 -0
- package/dist/openapi/http/isomorphic-fetch.js +33 -0
- package/dist/openapi/index.d.ts +10 -0
- package/dist/openapi/index.js +38 -0
- package/dist/openapi/middleware.d.ts +54 -0
- package/dist/openapi/middleware.js +16 -0
- package/dist/openapi/models/Address.d.ts +35 -0
- package/dist/openapi/models/Address.js +58 -0
- package/dist/openapi/models/AggregationMethod.d.ts +40 -0
- package/dist/openapi/models/AggregationMethod.js +46 -0
- package/dist/openapi/models/AggregationOperator.d.ts +24 -0
- package/dist/openapi/models/AggregationOperator.js +28 -0
- package/dist/openapi/models/BillingCycleStatus.d.ts +15 -0
- package/dist/openapi/models/BillingCycleStatus.js +19 -0
- package/dist/openapi/models/BillingInterval.d.ts +18 -0
- package/dist/openapi/models/BillingInterval.js +22 -0
- package/dist/openapi/models/Condition.d.ts +29 -0
- package/dist/openapi/models/Condition.js +31 -0
- package/dist/openapi/models/Contact.d.ts +30 -0
- package/dist/openapi/models/Contact.js +43 -0
- package/dist/openapi/models/ContractStatus.d.ts +18 -0
- package/dist/openapi/models/ContractStatus.js +22 -0
- package/dist/openapi/models/CreateContractRequest.d.ts +43 -0
- package/dist/openapi/models/CreateContractRequest.js +49 -0
- package/dist/openapi/models/CreateContractResponse.d.ts +29 -0
- package/dist/openapi/models/CreateContractResponse.js +31 -0
- package/dist/openapi/models/CreateCustomerRequest.d.ts +46 -0
- package/dist/openapi/models/CreateCustomerRequest.js +55 -0
- package/dist/openapi/models/CreateCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/CreateCustomerResponse.js +31 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +49 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.js +73 -0
- package/dist/openapi/models/CreditLedgerEntry.d.ts +32 -0
- package/dist/openapi/models/CreditLedgerEntry.js +49 -0
- package/dist/openapi/models/Criterion.d.ts +31 -0
- package/dist/openapi/models/Criterion.js +43 -0
- package/dist/openapi/models/CriterionOperator.d.ts +23 -0
- package/dist/openapi/models/CriterionOperator.js +27 -0
- package/dist/openapi/models/Currency.d.ts +17 -0
- package/dist/openapi/models/Currency.js +21 -0
- package/dist/openapi/models/DeductCreditsRequest.d.ts +35 -0
- package/dist/openapi/models/DeductCreditsRequest.js +37 -0
- package/dist/openapi/models/DeleteContractResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteContractResponse.js +31 -0
- package/dist/openapi/models/DeleteContractResponseContract.d.ts +47 -0
- package/dist/openapi/models/DeleteContractResponseContract.js +73 -0
- package/dist/openapi/models/DeleteCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteCustomerResponse.js +31 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +50 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.js +79 -0
- package/dist/openapi/models/DeleteEventResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteEventResponse.js +31 -0
- package/dist/openapi/models/DeleteEventResponseEvent.d.ts +56 -0
- package/dist/openapi/models/DeleteEventResponseEvent.js +82 -0
- package/dist/openapi/models/DeleteMeterResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteMeterResponse.js +31 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.d.ts +43 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.js +73 -0
- package/dist/openapi/models/DeletePlanResponse.d.ts +29 -0
- package/dist/openapi/models/DeletePlanResponse.js +31 -0
- package/dist/openapi/models/DeletePlanResponsePlan.d.ts +39 -0
- package/dist/openapi/models/DeletePlanResponsePlan.js +67 -0
- package/dist/openapi/models/Event.d.ts +49 -0
- package/dist/openapi/models/Event.js +55 -0
- package/dist/openapi/models/EventsDryRunRequest.d.ts +29 -0
- package/dist/openapi/models/EventsDryRunRequest.js +31 -0
- package/dist/openapi/models/EventsDryRunResponse.d.ts +29 -0
- package/dist/openapi/models/EventsDryRunResponse.js +31 -0
- package/dist/openapi/models/EventsDryRunResponseObject.d.ts +32 -0
- package/dist/openapi/models/EventsDryRunResponseObject.js +43 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.d.ts +35 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.js +61 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +41 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.js +61 -0
- package/dist/openapi/models/Filter.d.ts +32 -0
- package/dist/openapi/models/Filter.js +34 -0
- package/dist/openapi/models/FullDayPeriod.d.ts +32 -0
- package/dist/openapi/models/FullDayPeriod.js +40 -0
- package/dist/openapi/models/GetCommitmentReportResponse.d.ts +44 -0
- package/dist/openapi/models/GetCommitmentReportResponse.js +115 -0
- package/dist/openapi/models/GetContractResponse.d.ts +29 -0
- package/dist/openapi/models/GetContractResponse.js +31 -0
- package/dist/openapi/models/GetContractResponseContract.d.ts +46 -0
- package/dist/openapi/models/GetContractResponseContract.js +67 -0
- package/dist/openapi/models/GetCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/GetCustomerResponse.js +31 -0
- package/dist/openapi/models/GetEventResponse.d.ts +29 -0
- package/dist/openapi/models/GetEventResponse.js +31 -0
- package/dist/openapi/models/GetEventResponseEvent.d.ts +55 -0
- package/dist/openapi/models/GetEventResponseEvent.js +76 -0
- package/dist/openapi/models/GetInvoiceResponse.d.ts +29 -0
- package/dist/openapi/models/GetInvoiceResponse.js +31 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.d.ts +50 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.js +79 -0
- package/dist/openapi/models/GetMeterResponse.d.ts +29 -0
- package/dist/openapi/models/GetMeterResponse.js +31 -0
- package/dist/openapi/models/GetMeterResponseMeter.d.ts +42 -0
- package/dist/openapi/models/GetMeterResponseMeter.js +67 -0
- package/dist/openapi/models/GetPlanResponse.d.ts +29 -0
- package/dist/openapi/models/GetPlanResponse.js +31 -0
- package/dist/openapi/models/GetPlanResponsePlan.d.ts +38 -0
- package/dist/openapi/models/GetPlanResponsePlan.js +61 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.d.ts +44 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.js +115 -0
- package/dist/openapi/models/GrantCreditsRequest.d.ts +35 -0
- package/dist/openapi/models/GrantCreditsRequest.js +37 -0
- package/dist/openapi/models/InvalidEvent.d.ts +33 -0
- package/dist/openapi/models/InvalidEvent.js +37 -0
- package/dist/openapi/models/LineItem.d.ts +33 -0
- package/dist/openapi/models/LineItem.js +37 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.d.ts +36 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.js +64 -0
- package/dist/openapi/models/ListContractsResponse.d.ts +32 -0
- package/dist/openapi/models/ListContractsResponse.js +49 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.d.ts +32 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.js +31 -0
- package/dist/openapi/models/ListCustomersResponse.d.ts +32 -0
- package/dist/openapi/models/ListCustomersResponse.js +49 -0
- package/dist/openapi/models/ListInvoicesResponse.d.ts +32 -0
- package/dist/openapi/models/ListInvoicesResponse.js +49 -0
- package/dist/openapi/models/ListMetersResponse.d.ts +32 -0
- package/dist/openapi/models/ListMetersResponse.js +49 -0
- package/dist/openapi/models/ListPlansResponse.d.ts +32 -0
- package/dist/openapi/models/ListPlansResponse.js +49 -0
- package/dist/openapi/models/LoginRequest.d.ts +31 -0
- package/dist/openapi/models/LoginRequest.js +31 -0
- package/dist/openapi/models/LoginResponse.d.ts +31 -0
- package/dist/openapi/models/LoginResponse.js +31 -0
- package/dist/openapi/models/Meter.d.ts +39 -0
- package/dist/openapi/models/Meter.js +49 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.d.ts +30 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.js +43 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.d.ts +34 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.js +47 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.d.ts +39 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.js +85 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.d.ts +28 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.js +31 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.d.ts +29 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.js +31 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.d.ts +33 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.js +55 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.d.ts +29 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.js +37 -0
- package/dist/openapi/models/NotificationEventType.d.ts +17 -0
- package/dist/openapi/models/NotificationEventType.js +21 -0
- package/dist/openapi/models/ObjectSerializer.d.ts +109 -0
- package/dist/openapi/models/ObjectSerializer.js +497 -0
- package/dist/openapi/models/PaymentTerm.d.ts +18 -0
- package/dist/openapi/models/PaymentTerm.js +22 -0
- package/dist/openapi/models/PlanBillingData.d.ts +37 -0
- package/dist/openapi/models/PlanBillingData.js +58 -0
- package/dist/openapi/models/PlanStatus.d.ts +19 -0
- package/dist/openapi/models/PlanStatus.js +23 -0
- package/dist/openapi/models/QueryEventsResponse.d.ts +32 -0
- package/dist/openapi/models/QueryEventsResponse.js +31 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.d.ts +52 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.js +73 -0
- package/dist/openapi/models/SendEventsRequest.d.ts +29 -0
- package/dist/openapi/models/SendEventsRequest.js +31 -0
- package/dist/openapi/models/SendEventsResponse.d.ts +37 -0
- package/dist/openapi/models/SendEventsResponse.js +37 -0
- package/dist/openapi/models/UpdateCustomerRequest.d.ts +46 -0
- package/dist/openapi/models/UpdateCustomerRequest.js +55 -0
- package/dist/openapi/models/UpdateCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/UpdateCustomerResponse.js +31 -0
- package/dist/openapi/models/UpdateMeterRequest.d.ts +39 -0
- package/dist/openapi/models/UpdateMeterRequest.js +49 -0
- package/dist/openapi/models/UpdateMeterResponse.d.ts +29 -0
- package/dist/openapi/models/UpdateMeterResponse.js +31 -0
- package/dist/openapi/models/WebhookSubscribeRequest.d.ts +30 -0
- package/dist/openapi/models/WebhookSubscribeRequest.js +37 -0
- package/dist/openapi/models/all.d.ts +82 -0
- package/dist/openapi/models/all.js +98 -0
- package/dist/openapi/rxjsStub.d.ts +10 -0
- package/dist/openapi/rxjsStub.js +31 -0
- package/dist/openapi/servers.d.ts +39 -0
- package/dist/openapi/servers.js +52 -0
- package/dist/openapi/types/ObjectParamAPI.d.ts +845 -0
- package/dist/openapi/types/ObjectParamAPI.js +606 -0
- package/dist/openapi/types/ObservableAPI.d.ts +544 -0
- package/dist/openapi/types/ObservableAPI.js +1089 -0
- package/dist/openapi/types/PromiseAPI.d.ts +521 -0
- package/dist/openapi/types/PromiseAPI.js +702 -0
- package/dist/openapi/util.d.ts +15 -0
- package/dist/openapi/util.js +42 -0
- package/dist/sdk/clients/ContractsClient.d.ts +10 -0
- package/dist/sdk/clients/ContractsClient.js +42 -0
- package/dist/sdk/clients/CustomersClient.d.ts +12 -0
- package/dist/sdk/clients/CustomersClient.js +52 -0
- package/dist/sdk/clients/EventsClient.d.ts +11 -0
- package/dist/sdk/clients/EventsClient.js +49 -0
- package/dist/sdk/clients/InvoicesClient.d.ts +7 -0
- package/dist/sdk/clients/InvoicesClient.js +32 -0
- package/dist/sdk/clients/MetersClient.d.ts +10 -0
- package/dist/sdk/clients/MetersClient.js +42 -0
- package/dist/sdk/clients/PlansClient.d.ts +8 -0
- package/dist/sdk/clients/PlansClient.js +37 -0
- package/dist/sdk/clients/WebhooksClient.d.ts +6 -0
- package/dist/sdk/clients/WebhooksClient.js +25 -0
- package/dist/sdk/clients/index.d.ts +7 -0
- package/dist/sdk/clients/index.js +23 -0
- package/dist/sdk/index.d.ts +14 -0
- package/dist/sdk/index.js +62 -0
- package/dist/sdk/services/configuration.service.d.ts +21 -0
- package/dist/sdk/services/configuration.service.js +104 -0
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/sdk/services/index.js +17 -0
- package/dist/sdk/types/Contracts.d.ts +1 -0
- package/dist/sdk/types/Contracts.js +2 -0
- package/dist/sdk/types/Customers.d.ts +1 -0
- package/dist/sdk/types/Customers.js +2 -0
- package/dist/sdk/types/Events.d.ts +1 -0
- package/dist/sdk/types/Events.js +2 -0
- package/dist/sdk/types/Invoices.d.ts +1 -0
- package/dist/sdk/types/Invoices.js +2 -0
- package/dist/sdk/types/Meters.d.ts +1 -0
- package/dist/sdk/types/Meters.js +2 -0
- package/dist/sdk/types/Plans.d.ts +1 -0
- package/dist/sdk/types/Plans.js +2 -0
- package/dist/sdk/types/index.d.ts +7 -0
- package/dist/sdk/types/index.js +23 -0
- package/dist/sdk/types/pagination-options.d.ts +4 -0
- package/dist/sdk/types/pagination-options.js +2 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,34 +177,35 @@ The Vayu API client library provides access to the following features:
|
|
|
177
177
|
- **Auth**
|
|
178
178
|
- `auth.login()`
|
|
179
179
|
- **Events**
|
|
180
|
-
- `events.
|
|
181
|
-
- `events.
|
|
182
|
-
- `events.
|
|
183
|
-
- `events.
|
|
184
|
-
- `events.
|
|
180
|
+
- `events.send()`
|
|
181
|
+
- `events.query()`
|
|
182
|
+
- `events.get()`
|
|
183
|
+
- `events.delete()`
|
|
184
|
+
- `events.dryRun()`
|
|
185
185
|
- **Customers**
|
|
186
|
-
- `customers.
|
|
187
|
-
- `customers.
|
|
188
|
-
- `customers.
|
|
189
|
-
- `customers.
|
|
190
|
-
- `customers.
|
|
186
|
+
- `customers.create()`
|
|
187
|
+
- `customers.update()`
|
|
188
|
+
- `customers.delete()`
|
|
189
|
+
- `customers.list()`
|
|
190
|
+
- `customers.get()`
|
|
191
|
+
- `customers.getByExternalId()`
|
|
191
192
|
- **Meters**
|
|
192
|
-
- `meters.
|
|
193
|
-
- `meters.
|
|
194
|
-
- `meters.
|
|
195
|
-
- `meters.
|
|
193
|
+
- `meters.get()`
|
|
194
|
+
- `meters.update()`
|
|
195
|
+
- `meters.delete()`
|
|
196
|
+
- `meters.list()`
|
|
196
197
|
- **Plans**
|
|
197
|
-
- `plans.
|
|
198
|
-
- `plans.
|
|
199
|
-
- `plans.
|
|
198
|
+
- `plans.get()`
|
|
199
|
+
- `plans.delete()`
|
|
200
|
+
- `plans.list()`
|
|
200
201
|
- **Contracts**
|
|
201
|
-
- `contracts.
|
|
202
|
-
- `contracts.
|
|
203
|
-
- `contracts.
|
|
204
|
-
- `contracts.
|
|
202
|
+
- `contracts.create()`
|
|
203
|
+
- `contracts.delete()`
|
|
204
|
+
- `contracts.list()`
|
|
205
|
+
- `contracts.get()`
|
|
205
206
|
- **Invoices**
|
|
206
|
-
- `invoices.
|
|
207
|
-
- `invoices.
|
|
207
|
+
- `invoices.get()`
|
|
208
|
+
- `invoices.list()`
|
|
208
209
|
|
|
209
210
|
## Support
|
|
210
211
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sdk';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sdk"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseAPIRequestFactory } from './baseapi';
|
|
2
|
+
import { Configuration } from '../configuration';
|
|
3
|
+
import { RequestContext, ResponseContext, HttpInfo } from '../http/http';
|
|
4
|
+
import { LoginRequest } from '../models/LoginRequest';
|
|
5
|
+
import { LoginResponse } from '../models/LoginResponse';
|
|
6
|
+
/**
|
|
7
|
+
* no description
|
|
8
|
+
*/
|
|
9
|
+
export declare class AuthApiRequestFactory extends BaseAPIRequestFactory {
|
|
10
|
+
/**
|
|
11
|
+
* This endpoint is designed to acquire a temporary access token. Submit the auth token in the request body to obtain a new access token. Use this new token for subsequent API calls. Token is set to expire every hour.
|
|
12
|
+
* Login by obtaining a new access token
|
|
13
|
+
* @param loginRequest
|
|
14
|
+
*/
|
|
15
|
+
login(loginRequest: LoginRequest, _options?: Configuration): Promise<RequestContext>;
|
|
16
|
+
}
|
|
17
|
+
export declare class AuthApiResponseProcessor {
|
|
18
|
+
/**
|
|
19
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
20
|
+
* to the expected objects
|
|
21
|
+
*
|
|
22
|
+
* @params response Response returned by the server for a request to login
|
|
23
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
24
|
+
*/
|
|
25
|
+
loginWithHttpInfo(response: ResponseContext): Promise<HttpInfo<LoginResponse>>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuthApiResponseProcessor = exports.AuthApiRequestFactory = void 0;
|
|
13
|
+
// TODO: better import syntax?
|
|
14
|
+
const baseapi_1 = require("./baseapi");
|
|
15
|
+
const http_1 = require("../http/http");
|
|
16
|
+
const ObjectSerializer_1 = require("../models/ObjectSerializer");
|
|
17
|
+
const exception_1 = require("./exception");
|
|
18
|
+
const util_1 = require("../util");
|
|
19
|
+
/**
|
|
20
|
+
* no description
|
|
21
|
+
*/
|
|
22
|
+
class AuthApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
23
|
+
/**
|
|
24
|
+
* This endpoint is designed to acquire a temporary access token. Submit the auth token in the request body to obtain a new access token. Use this new token for subsequent API calls. Token is set to expire every hour.
|
|
25
|
+
* Login by obtaining a new access token
|
|
26
|
+
* @param loginRequest
|
|
27
|
+
*/
|
|
28
|
+
login(loginRequest, _options) {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
let _config = _options || this.configuration;
|
|
32
|
+
// verify required parameter 'loginRequest' is not null or undefined
|
|
33
|
+
if (loginRequest === null || loginRequest === undefined) {
|
|
34
|
+
throw new baseapi_1.RequiredError("AuthApi", "login", "loginRequest");
|
|
35
|
+
}
|
|
36
|
+
// Path Params
|
|
37
|
+
const localVarPath = '/login';
|
|
38
|
+
// Make Request Context
|
|
39
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
|
|
40
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
41
|
+
// Body Params
|
|
42
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
|
|
43
|
+
"application/json"
|
|
44
|
+
]);
|
|
45
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
46
|
+
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(loginRequest, "LoginRequest", ""), contentType);
|
|
47
|
+
requestContext.setBody(serializedBody);
|
|
48
|
+
const defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default);
|
|
49
|
+
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
|
|
50
|
+
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
|
|
51
|
+
}
|
|
52
|
+
return requestContext;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.AuthApiRequestFactory = AuthApiRequestFactory;
|
|
57
|
+
class AuthApiResponseProcessor {
|
|
58
|
+
/**
|
|
59
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
60
|
+
* to the expected objects
|
|
61
|
+
*
|
|
62
|
+
* @params response Response returned by the server for a request to login
|
|
63
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
64
|
+
*/
|
|
65
|
+
loginWithHttpInfo(response) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
68
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
69
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "LoginResponse", "");
|
|
70
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
71
|
+
}
|
|
72
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
73
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
74
|
+
}
|
|
75
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
76
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
77
|
+
}
|
|
78
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
79
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
80
|
+
}
|
|
81
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
82
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
83
|
+
}
|
|
84
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
85
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
86
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "LoginResponse", "");
|
|
87
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
88
|
+
}
|
|
89
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.AuthApiResponseProcessor = AuthApiResponseProcessor;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { BaseAPIRequestFactory } from './baseapi';
|
|
2
|
+
import { Configuration } from '../configuration';
|
|
3
|
+
import { RequestContext, ResponseContext, HttpInfo } from '../http/http';
|
|
4
|
+
import { CreateContractRequest } from '../models/CreateContractRequest';
|
|
5
|
+
import { CreateContractResponse } from '../models/CreateContractResponse';
|
|
6
|
+
import { DeleteContractResponse } from '../models/DeleteContractResponse';
|
|
7
|
+
import { GetContractResponse } from '../models/GetContractResponse';
|
|
8
|
+
import { ListContractsResponse } from '../models/ListContractsResponse';
|
|
9
|
+
/**
|
|
10
|
+
* no description
|
|
11
|
+
*/
|
|
12
|
+
export declare class ContractsApiRequestFactory extends BaseAPIRequestFactory {
|
|
13
|
+
/**
|
|
14
|
+
* Create a new Contract.
|
|
15
|
+
* Create Contract
|
|
16
|
+
* @param createContractRequest
|
|
17
|
+
*/
|
|
18
|
+
createContract(createContractRequest: CreateContractRequest, _options?: Configuration): Promise<RequestContext>;
|
|
19
|
+
/**
|
|
20
|
+
* Delete a Contract by id.
|
|
21
|
+
* Delete Contract
|
|
22
|
+
* @param contractId
|
|
23
|
+
*/
|
|
24
|
+
deleteContract(contractId: string, _options?: Configuration): Promise<RequestContext>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a Contract by id.
|
|
27
|
+
* Get Contract
|
|
28
|
+
* @param contractId
|
|
29
|
+
*/
|
|
30
|
+
getContract(contractId: string, _options?: Configuration): Promise<RequestContext>;
|
|
31
|
+
/**
|
|
32
|
+
* Get a list of Contracts.
|
|
33
|
+
* List Contracts
|
|
34
|
+
* @param limit
|
|
35
|
+
* @param cursor
|
|
36
|
+
*/
|
|
37
|
+
listContracts(limit?: number, cursor?: string, _options?: Configuration): Promise<RequestContext>;
|
|
38
|
+
}
|
|
39
|
+
export declare class ContractsApiResponseProcessor {
|
|
40
|
+
/**
|
|
41
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
42
|
+
* to the expected objects
|
|
43
|
+
*
|
|
44
|
+
* @params response Response returned by the server for a request to createContract
|
|
45
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
46
|
+
*/
|
|
47
|
+
createContractWithHttpInfo(response: ResponseContext): Promise<HttpInfo<CreateContractResponse>>;
|
|
48
|
+
/**
|
|
49
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
50
|
+
* to the expected objects
|
|
51
|
+
*
|
|
52
|
+
* @params response Response returned by the server for a request to deleteContract
|
|
53
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
54
|
+
*/
|
|
55
|
+
deleteContractWithHttpInfo(response: ResponseContext): Promise<HttpInfo<DeleteContractResponse>>;
|
|
56
|
+
/**
|
|
57
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
58
|
+
* to the expected objects
|
|
59
|
+
*
|
|
60
|
+
* @params response Response returned by the server for a request to getContract
|
|
61
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
62
|
+
*/
|
|
63
|
+
getContractWithHttpInfo(response: ResponseContext): Promise<HttpInfo<GetContractResponse>>;
|
|
64
|
+
/**
|
|
65
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
66
|
+
* to the expected objects
|
|
67
|
+
*
|
|
68
|
+
* @params response Response returned by the server for a request to listContracts
|
|
69
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
70
|
+
*/
|
|
71
|
+
listContractsWithHttpInfo(response: ResponseContext): Promise<HttpInfo<ListContractsResponse>>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,307 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContractsApiResponseProcessor = exports.ContractsApiRequestFactory = void 0;
|
|
13
|
+
// TODO: better import syntax?
|
|
14
|
+
const baseapi_1 = require("./baseapi");
|
|
15
|
+
const http_1 = require("../http/http");
|
|
16
|
+
const ObjectSerializer_1 = require("../models/ObjectSerializer");
|
|
17
|
+
const exception_1 = require("./exception");
|
|
18
|
+
const util_1 = require("../util");
|
|
19
|
+
/**
|
|
20
|
+
* no description
|
|
21
|
+
*/
|
|
22
|
+
class ContractsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
23
|
+
/**
|
|
24
|
+
* Create a new Contract.
|
|
25
|
+
* Create Contract
|
|
26
|
+
* @param createContractRequest
|
|
27
|
+
*/
|
|
28
|
+
createContract(createContractRequest, _options) {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
let _config = _options || this.configuration;
|
|
32
|
+
// verify required parameter 'createContractRequest' is not null or undefined
|
|
33
|
+
if (createContractRequest === null || createContractRequest === undefined) {
|
|
34
|
+
throw new baseapi_1.RequiredError("ContractsApi", "createContract", "createContractRequest");
|
|
35
|
+
}
|
|
36
|
+
// Path Params
|
|
37
|
+
const localVarPath = '/contracts';
|
|
38
|
+
// Make Request Context
|
|
39
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
|
|
40
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
41
|
+
// Body Params
|
|
42
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
|
|
43
|
+
"application/json"
|
|
44
|
+
]);
|
|
45
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
46
|
+
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(createContractRequest, "CreateContractRequest", ""), contentType);
|
|
47
|
+
requestContext.setBody(serializedBody);
|
|
48
|
+
let authMethod;
|
|
49
|
+
// Apply auth methods
|
|
50
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
51
|
+
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
|
|
52
|
+
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
|
|
53
|
+
}
|
|
54
|
+
const defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default);
|
|
55
|
+
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
|
|
56
|
+
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
|
|
57
|
+
}
|
|
58
|
+
return requestContext;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Delete a Contract by id.
|
|
63
|
+
* Delete Contract
|
|
64
|
+
* @param contractId
|
|
65
|
+
*/
|
|
66
|
+
deleteContract(contractId, _options) {
|
|
67
|
+
var _a, _b, _c;
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
let _config = _options || this.configuration;
|
|
70
|
+
// verify required parameter 'contractId' is not null or undefined
|
|
71
|
+
if (contractId === null || contractId === undefined) {
|
|
72
|
+
throw new baseapi_1.RequiredError("ContractsApi", "deleteContract", "contractId");
|
|
73
|
+
}
|
|
74
|
+
// Path Params
|
|
75
|
+
const localVarPath = '/contracts/{contractId}'
|
|
76
|
+
.replace('{' + 'contractId' + '}', encodeURIComponent(String(contractId)));
|
|
77
|
+
// Make Request Context
|
|
78
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
|
|
79
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
80
|
+
let authMethod;
|
|
81
|
+
// Apply auth methods
|
|
82
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
83
|
+
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
|
|
84
|
+
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
|
|
85
|
+
}
|
|
86
|
+
const defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default);
|
|
87
|
+
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
|
|
88
|
+
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
|
|
89
|
+
}
|
|
90
|
+
return requestContext;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get a Contract by id.
|
|
95
|
+
* Get Contract
|
|
96
|
+
* @param contractId
|
|
97
|
+
*/
|
|
98
|
+
getContract(contractId, _options) {
|
|
99
|
+
var _a, _b, _c;
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
let _config = _options || this.configuration;
|
|
102
|
+
// verify required parameter 'contractId' is not null or undefined
|
|
103
|
+
if (contractId === null || contractId === undefined) {
|
|
104
|
+
throw new baseapi_1.RequiredError("ContractsApi", "getContract", "contractId");
|
|
105
|
+
}
|
|
106
|
+
// Path Params
|
|
107
|
+
const localVarPath = '/contracts/{contractId}'
|
|
108
|
+
.replace('{' + 'contractId' + '}', encodeURIComponent(String(contractId)));
|
|
109
|
+
// Make Request Context
|
|
110
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
111
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
112
|
+
let authMethod;
|
|
113
|
+
// Apply auth methods
|
|
114
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
115
|
+
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
|
|
116
|
+
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
|
|
117
|
+
}
|
|
118
|
+
const defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default);
|
|
119
|
+
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
|
|
120
|
+
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
|
|
121
|
+
}
|
|
122
|
+
return requestContext;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get a list of Contracts.
|
|
127
|
+
* List Contracts
|
|
128
|
+
* @param limit
|
|
129
|
+
* @param cursor
|
|
130
|
+
*/
|
|
131
|
+
listContracts(limit, cursor, _options) {
|
|
132
|
+
var _a, _b, _c;
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
let _config = _options || this.configuration;
|
|
135
|
+
// Path Params
|
|
136
|
+
const localVarPath = '/contracts';
|
|
137
|
+
// Make Request Context
|
|
138
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
139
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
140
|
+
// Query Params
|
|
141
|
+
if (limit !== undefined) {
|
|
142
|
+
requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", ""));
|
|
143
|
+
}
|
|
144
|
+
// Query Params
|
|
145
|
+
if (cursor !== undefined) {
|
|
146
|
+
requestContext.setQueryParam("cursor", ObjectSerializer_1.ObjectSerializer.serialize(cursor, "string", ""));
|
|
147
|
+
}
|
|
148
|
+
let authMethod;
|
|
149
|
+
// Apply auth methods
|
|
150
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
151
|
+
if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) {
|
|
152
|
+
yield (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext));
|
|
153
|
+
}
|
|
154
|
+
const defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default);
|
|
155
|
+
if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) {
|
|
156
|
+
yield (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext));
|
|
157
|
+
}
|
|
158
|
+
return requestContext;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.ContractsApiRequestFactory = ContractsApiRequestFactory;
|
|
163
|
+
class ContractsApiResponseProcessor {
|
|
164
|
+
/**
|
|
165
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
166
|
+
* to the expected objects
|
|
167
|
+
*
|
|
168
|
+
* @params response Response returned by the server for a request to createContract
|
|
169
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
170
|
+
*/
|
|
171
|
+
createContractWithHttpInfo(response) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
174
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
175
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "CreateContractResponse", "");
|
|
176
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
177
|
+
}
|
|
178
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
179
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
180
|
+
}
|
|
181
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
182
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
183
|
+
}
|
|
184
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
185
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
186
|
+
}
|
|
187
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
188
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
189
|
+
}
|
|
190
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
191
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
192
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "CreateContractResponse", "");
|
|
193
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
194
|
+
}
|
|
195
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
200
|
+
* to the expected objects
|
|
201
|
+
*
|
|
202
|
+
* @params response Response returned by the server for a request to deleteContract
|
|
203
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
204
|
+
*/
|
|
205
|
+
deleteContractWithHttpInfo(response) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
208
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
209
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "DeleteContractResponse", "");
|
|
210
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
211
|
+
}
|
|
212
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
213
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
214
|
+
}
|
|
215
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
216
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
217
|
+
}
|
|
218
|
+
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
219
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
|
|
220
|
+
}
|
|
221
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
222
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
223
|
+
}
|
|
224
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
225
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
226
|
+
}
|
|
227
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
228
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
229
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "DeleteContractResponse", "");
|
|
230
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
231
|
+
}
|
|
232
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
237
|
+
* to the expected objects
|
|
238
|
+
*
|
|
239
|
+
* @params response Response returned by the server for a request to getContract
|
|
240
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
241
|
+
*/
|
|
242
|
+
getContractWithHttpInfo(response) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
245
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
246
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "GetContractResponse", "");
|
|
247
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
248
|
+
}
|
|
249
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
250
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
251
|
+
}
|
|
252
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
253
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
254
|
+
}
|
|
255
|
+
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
256
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
|
|
257
|
+
}
|
|
258
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
259
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
260
|
+
}
|
|
261
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
262
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
263
|
+
}
|
|
264
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
265
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
266
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "GetContractResponse", "");
|
|
267
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
268
|
+
}
|
|
269
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
274
|
+
* to the expected objects
|
|
275
|
+
*
|
|
276
|
+
* @params response Response returned by the server for a request to listContracts
|
|
277
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
278
|
+
*/
|
|
279
|
+
listContractsWithHttpInfo(response) {
|
|
280
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
282
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
283
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ListContractsResponse", "");
|
|
284
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
285
|
+
}
|
|
286
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
287
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
288
|
+
}
|
|
289
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
290
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
291
|
+
}
|
|
292
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
293
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
294
|
+
}
|
|
295
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
296
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
297
|
+
}
|
|
298
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
299
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
300
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "ListContractsResponse", "");
|
|
301
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
302
|
+
}
|
|
303
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
exports.ContractsApiResponseProcessor = ContractsApiResponseProcessor;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BaseAPIRequestFactory } from './baseapi';
|
|
2
|
+
import { Configuration } from '../configuration';
|
|
3
|
+
import { RequestContext, ResponseContext, HttpInfo } from '../http/http';
|
|
4
|
+
import { DeductCreditsRequest } from '../models/DeductCreditsRequest';
|
|
5
|
+
import { GrantCreditsRequest } from '../models/GrantCreditsRequest';
|
|
6
|
+
import { ListCreditLedgerEntriesResponse } from '../models/ListCreditLedgerEntriesResponse';
|
|
7
|
+
/**
|
|
8
|
+
* no description
|
|
9
|
+
*/
|
|
10
|
+
export declare class CreditsApiRequestFactory extends BaseAPIRequestFactory {
|
|
11
|
+
/**
|
|
12
|
+
* This endpoint is used to deduct credits from the specified customer account. Submit the credit amount and customer ID in the request body to deduct the credits. The deducted credits will be subtracted from the customer\'s account.
|
|
13
|
+
* Deduct credits from customer credit ledger
|
|
14
|
+
* @param deductCreditsRequest
|
|
15
|
+
*/
|
|
16
|
+
deductCredits(deductCreditsRequest: DeductCreditsRequest, _options?: Configuration): Promise<RequestContext>;
|
|
17
|
+
/**
|
|
18
|
+
* This endpoint is used to grant credits to a customer. Submit the credit amount and customer ID in the request body to grant the credits. The granted credits will be added to the customer\'s account.
|
|
19
|
+
* Grant credits to a customer credit ledger
|
|
20
|
+
* @param grantCreditsRequest
|
|
21
|
+
*/
|
|
22
|
+
grantCredits(grantCreditsRequest: GrantCreditsRequest, _options?: Configuration): Promise<RequestContext>;
|
|
23
|
+
/**
|
|
24
|
+
* This endpoint is used to retrieve the credit ledger entries for a specific customer.
|
|
25
|
+
* Retrieve credit ledger entries for customer.
|
|
26
|
+
* @param customerId
|
|
27
|
+
* @param limit
|
|
28
|
+
* @param cursor
|
|
29
|
+
*/
|
|
30
|
+
listCreditLedgerEntries(customerId: string, limit?: number, cursor?: string, _options?: Configuration): Promise<RequestContext>;
|
|
31
|
+
}
|
|
32
|
+
export declare class CreditsApiResponseProcessor {
|
|
33
|
+
/**
|
|
34
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
35
|
+
* to the expected objects
|
|
36
|
+
*
|
|
37
|
+
* @params response Response returned by the server for a request to deductCredits
|
|
38
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
39
|
+
*/
|
|
40
|
+
deductCreditsWithHttpInfo(response: ResponseContext): Promise<HttpInfo<void>>;
|
|
41
|
+
/**
|
|
42
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
43
|
+
* to the expected objects
|
|
44
|
+
*
|
|
45
|
+
* @params response Response returned by the server for a request to grantCredits
|
|
46
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
47
|
+
*/
|
|
48
|
+
grantCreditsWithHttpInfo(response: ResponseContext): Promise<HttpInfo<void>>;
|
|
49
|
+
/**
|
|
50
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
51
|
+
* to the expected objects
|
|
52
|
+
*
|
|
53
|
+
* @params response Response returned by the server for a request to listCreditLedgerEntries
|
|
54
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
55
|
+
*/
|
|
56
|
+
listCreditLedgerEntriesWithHttpInfo(response: ResponseContext): Promise<HttpInfo<ListCreditLedgerEntriesResponse>>;
|
|
57
|
+
}
|