@flexprice/sdk 0.1.2 → 1.0.13

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 CHANGED
@@ -1,380 +1,256 @@
1
- # flexprice-client
1
+ # FlexPrice JavaScript SDK
2
2
 
3
- FlexpriceClient - JavaScript client for flexprice-client
4
- FlexPrice API Service
5
- This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
6
-
7
- - API version: 1.0
8
- - Package version: 1.0
9
- - Generator version: 7.12.0
10
- - Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
3
+ This is the JavaScript client library for the FlexPrice API.
11
4
 
12
5
  ## Installation
13
6
 
14
- ### For [Node.js](https://nodejs.org/)
15
-
16
- #### npm
7
+ ### Node.js
17
8
 
18
- To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
9
+ ```bash
10
+ npm install @flexprice/sdk --save
11
+ ```
19
12
 
20
- Then install it via:
13
+ ### Browser via CDN
21
14
 
22
- ```shell
23
- npm install flexprice-client --save
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/@flexprice/sdk/dist/flexprice-sdk.min.js"></script>
24
17
  ```
25
18
 
26
- Finally, you need to build the module:
19
+ ## Usage
20
+
21
+ ```javascript
22
+ // Import the FlexPrice SDK
23
+ const FlexPrice = require('@flexprice/sdk');
24
+ // Or using ES modules:
25
+ // import * as FlexPrice from '@flexprice/sdk';
26
+
27
+ // Load environment variables (using dotenv package)
28
+ require('dotenv').config();
29
+
30
+ function main() {
31
+ try {
32
+ // Configure the API client with your API key
33
+ // API keys should start with 'sk_' followed by a unique identifier
34
+ const apiKey = process.env.FLEXPRICE_API_KEY;
35
+ const apiHost = process.env.FLEXPRICE_API_HOST || 'api.cloud.flexprice.io';
36
+
37
+ if (!apiKey) {
38
+ console.error('ERROR: You must provide a valid FlexPrice API key');
39
+ process.exit(1);
40
+ }
41
+
42
+ // Initialize the API client with your API key
43
+ const defaultClient = FlexPrice.ApiClient.instance;
44
+
45
+ // Set the base path directly to the API endpoint including /v1
46
+ defaultClient.basePath = `https://${apiHost}/v1`;
47
+
48
+ // Configure API key authorization
49
+ const apiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
50
+ apiKeyAuth.apiKey = apiKey;
51
+ apiKeyAuth.in = 'header';
52
+ apiKeyAuth.name = 'x-api-key';
53
+
54
+ // Generate a unique customer ID for this example
55
+ const customerId = `sample-customer-${Date.now()}`;
56
+
57
+ // Create API instances for different endpoints
58
+ const eventsApi = new FlexPrice.EventsApi();
59
+ const customersApi = new FlexPrice.CustomersApi();
60
+
61
+ // Step 1: Create a customer
62
+ console.log(`Creating customer with ID: ${customerId}...`);
63
+
64
+ const customerRequest = {
65
+ externalId: customerId,
66
+ email: `example-${customerId}@example.com`,
67
+ name: 'Example Customer',
68
+ metadata: {
69
+ source: 'javascript-sdk-example',
70
+ createdAt: new Date().toISOString()
71
+ }
72
+ };
73
+
74
+ customersApi.customersPost({
75
+ dtoCreateCustomerRequest: customerRequest
76
+ }, function(error, data, response) {
77
+ if (error) {
78
+ console.error('Error creating customer:', error);
79
+ return;
80
+ }
81
+
82
+ console.log('Customer created successfully!');
83
+
84
+ // Step 2: Create an event
85
+ console.log('Creating event...');
86
+
87
+ // Important: Use snake_case for all property names to match the API
88
+ const eventRequest = {
89
+ event_name: 'Sample Event',
90
+ external_customer_id: customerId,
91
+ properties: {
92
+ source: 'javascript_sample_app',
93
+ environment: 'test',
94
+ timestamp: new Date().toISOString()
95
+ },
96
+ source: 'javascript_sample_app',
97
+ timestamp: new Date().toISOString()
98
+ };
99
+
100
+ // Important: Pass the event directly without wrapping it
101
+ eventsApi.eventsPost(eventRequest, function(error, eventResult, response) {
102
+ if (error) {
103
+ console.error('Error creating event:', error);
104
+ return;
105
+ }
106
+
107
+ console.log(`Event created successfully! ID: ${eventResult.event_id}`);
108
+
109
+ // Step 3: Retrieve events for this customer
110
+ console.log(`Retrieving events for customer ${customerId}...`);
111
+
112
+ // Important: Use snake_case for parameter names
113
+ eventsApi.eventsGet({
114
+ external_customer_id: customerId
115
+ }, function(error, events, response) {
116
+ if (error) {
117
+ console.error('Error retrieving events:', error);
118
+ return;
119
+ }
120
+
121
+ console.log(`Found ${events.events.length} events:`);
122
+
123
+ events.events.forEach((event, index) => {
124
+ console.log(`Event ${index + 1}: ${event.id} - ${event.event_name}`);
125
+ console.log(`Properties: ${JSON.stringify(event.properties)}`);
126
+ });
127
+
128
+ console.log('Example completed successfully!');
129
+ });
130
+ });
131
+ });
132
+ } catch (error) {
133
+ console.error('Error:', error);
134
+ }
135
+ }
27
136
 
28
- ```shell
29
- npm run build
137
+ main();
30
138
  ```
31
139
 
32
- ##### Local development
140
+ ## Running the Example
33
141
 
34
- To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
142
+ To run the provided example:
35
143
 
36
- ```shell
37
- npm install
38
- ```
144
+ 1. Clone the repository:
145
+ ```bash
146
+ git clone https://github.com/flexprice/javascript-sdk.git
147
+ cd javascript-sdk/examples
148
+ ```
39
149
 
40
- Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
150
+ 2. Install dependencies:
151
+ ```bash
152
+ npm install
153
+ ```
41
154
 
42
- ```shell
43
- npm link
44
- ```
155
+ 3. Create a `.env` file with your API credentials:
156
+ ```bash
157
+ cp .env.sample .env
158
+ # Edit .env with your API key
159
+ ```
45
160
 
46
- To use the link you just defined in your project, switch to the directory you want to use your flexprice-client from, and run:
161
+ 4. Run the example:
162
+ ```bash
163
+ npm start
164
+ ```
47
165
 
48
- ```shell
49
- npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
50
- ```
166
+ ## Features
51
167
 
52
- Finally, you need to build the module:
168
+ - Complete API coverage
169
+ - CommonJS and ES Module support
170
+ - Browser compatibility
171
+ - Detailed documentation
172
+ - Error handling
173
+ - TypeScript definitions
53
174
 
54
- ```shell
55
- npm run build
56
- ```
175
+ ## Documentation
57
176
 
58
- #### git
177
+ For detailed API documentation, refer to the code comments and the official FlexPrice API documentation.
59
178
 
60
- If the library is hosted at a git repository, e.g.https://github.com/flexprice/javascript-sdk
61
- then install it via:
179
+ ## Troubleshooting
62
180
 
63
- ```shell
64
- npm install flexprice/javascript-sdk --save
65
- ```
181
+ ### Authentication Issues
66
182
 
67
- ### For browser
183
+ If you see errors related to authentication:
68
184
 
69
- The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
70
- the above steps with Node.js and installing browserify with `npm install -g browserify`,
71
- perform the following (assuming *main.js* is your entry file):
185
+ - Make sure your API key starts with `sk_` (for server-side usage)
186
+ - Check that the key is active and has the necessary permissions
187
+ - Use the `x-api-key` header for authentication (the SDK handles this for you)
72
188
 
73
- ```shell
74
- browserify main.js > bundle.js
75
- ```
189
+ ### Property Names
76
190
 
77
- Then include *bundle.js* in the HTML pages.
191
+ Always use snake_case for property names in requests:
192
+ - ✅ `event_name`, `external_customer_id`, `page_size`
193
+ - ❌ `eventName`, `externalCustomerId`, `pageSize`
78
194
 
79
- ### Webpack Configuration
195
+ ### Parameter Passing
80
196
 
81
- Using Webpack you may encounter the following error: "Module not found: Error:
82
- Cannot resolve module", most certainly you should disable AMD loader. Add/merge
83
- the following section to your webpack config:
197
+ Pass parameters directly to methods like eventsPost:
198
+ - `eventsApi.eventsPost(eventRequest, callback)`
199
+ - `eventsApi.eventsPost({ dtoIngestEventRequest: eventRequest }, callback)`
200
+
201
+ ### Callback vs Promise Error
202
+
203
+ The SDK uses callback-style API calls instead of Promises. If you see an error like:
84
204
 
85
- ```javascript
86
- module: {
87
- rules: [
88
- {
89
- parser: {
90
- amd: false
91
- }
92
- }
93
- ]
94
- }
205
+ ```
206
+ Warning: superagent request was sent twice, because both .end() and .then() were called.
95
207
  ```
96
208
 
97
- ## Getting Started
209
+ Make sure you're using the callback pattern shown in the examples, not trying to `await` the API calls.
98
210
 
99
- Please follow the [installation](#installation) instruction and execute the following JS code:
211
+ ### Network or Connectivity Issues
100
212
 
101
- ```javascript
102
- var FlexpriceClient = require('flexprice-client');
213
+ If you encounter network-related errors:
214
+
215
+ - Check your internet connection
216
+ - Verify that the API host is accessible from your environment
217
+ - Look for firewall or proxy settings that might block API requests
218
+
219
+ ### Using the SDK in a Browser
220
+
221
+ When using the SDK in a browser, remember:
222
+
223
+ - CORS restrictions might apply - ensure your domain is whitelisted
224
+ - Never expose API keys in client-side code - use a proxy or backend service
225
+ - Some features might be limited in browser environments
226
+
227
+ ## TypeScript Usage
103
228
 
229
+ The package includes TypeScript definitions:
104
230
 
105
- var api = new FlexpriceClient.AuthApi()
106
- var login = new FlexpriceClient.DtoLoginRequest(); // {DtoLoginRequest} Login request
107
- var callback = function(error, data, response) {
231
+ ```typescript
232
+ import * as FlexPrice from '@flexprice/sdk';
233
+
234
+ // Configure the client
235
+ const client = FlexPrice.ApiClient.instance;
236
+ // ... rest of the configuration
237
+
238
+ // Type-safe API calls with correct property names
239
+ const api = new FlexPrice.EventsApi();
240
+
241
+ const eventRequest = {
242
+ event_name: 'Sample Event',
243
+ external_customer_id: 'customer-123',
244
+ properties: { key: 'value' },
245
+ source: 'typescript_example',
246
+ timestamp: new Date().toISOString()
247
+ };
248
+
249
+ api.eventsPost(eventRequest, (error, data, response) => {
108
250
  if (error) {
109
251
  console.error(error);
110
252
  } else {
111
- console.log('API called successfully. Returned data: ' + data);
253
+ console.log(data);
112
254
  }
113
- };
114
- api.authLoginPost(login, callback);
115
-
116
- ```
117
-
118
- ## Documentation for API Endpoints
119
-
120
- All URIs are relative to */v1*
121
-
122
- Class | Method | HTTP request | Description
123
- ------------ | ------------- | ------------- | -------------
124
- *FlexpriceClient.AuthApi* | [**authLoginPost**](docs/AuthApi.md#authLoginPost) | **POST** /auth/login | Login
125
- *FlexpriceClient.AuthApi* | [**authSignupPost**](docs/AuthApi.md#authSignupPost) | **POST** /auth/signup | Sign up
126
- *FlexpriceClient.CustomersApi* | [**customersGet**](docs/CustomersApi.md#customersGet) | **GET** /customers | Get customers
127
- *FlexpriceClient.CustomersApi* | [**customersIdDelete**](docs/CustomersApi.md#customersIdDelete) | **DELETE** /customers/{id} | Delete a customer
128
- *FlexpriceClient.CustomersApi* | [**customersIdEntitlementsGet**](docs/CustomersApi.md#customersIdEntitlementsGet) | **GET** /customers/{id}/entitlements | Get customer entitlements
129
- *FlexpriceClient.CustomersApi* | [**customersIdGet**](docs/CustomersApi.md#customersIdGet) | **GET** /customers/{id} | Get a customer
130
- *FlexpriceClient.CustomersApi* | [**customersIdPut**](docs/CustomersApi.md#customersIdPut) | **PUT** /customers/{id} | Update a customer
131
- *FlexpriceClient.CustomersApi* | [**customersIdUsageGet**](docs/CustomersApi.md#customersIdUsageGet) | **GET** /customers/{id}/usage | Get customer usage summary
132
- *FlexpriceClient.CustomersApi* | [**customersLookupLookupKeyGet**](docs/CustomersApi.md#customersLookupLookupKeyGet) | **GET** /customers/lookup/{lookup_key} | Get a customer by lookup key
133
- *FlexpriceClient.CustomersApi* | [**customersPost**](docs/CustomersApi.md#customersPost) | **POST** /customers | Create a customer
134
- *FlexpriceClient.EntitlementsApi* | [**entitlementsGet**](docs/EntitlementsApi.md#entitlementsGet) | **GET** /entitlements | Get entitlements
135
- *FlexpriceClient.EntitlementsApi* | [**entitlementsIdDelete**](docs/EntitlementsApi.md#entitlementsIdDelete) | **DELETE** /entitlements/{id} | Delete an entitlement
136
- *FlexpriceClient.EntitlementsApi* | [**entitlementsIdGet**](docs/EntitlementsApi.md#entitlementsIdGet) | **GET** /entitlements/{id} | Get an entitlement by ID
137
- *FlexpriceClient.EntitlementsApi* | [**entitlementsIdPut**](docs/EntitlementsApi.md#entitlementsIdPut) | **PUT** /entitlements/{id} | Update an entitlement
138
- *FlexpriceClient.EntitlementsApi* | [**entitlementsPost**](docs/EntitlementsApi.md#entitlementsPost) | **POST** /entitlements | Create a new entitlement
139
- *FlexpriceClient.EntitlementsApi* | [**plansIdEntitlementsGet**](docs/EntitlementsApi.md#plansIdEntitlementsGet) | **GET** /plans/{id}/entitlements | Get plan entitlements
140
- *FlexpriceClient.EnvironmentsApi* | [**environmentsGet**](docs/EnvironmentsApi.md#environmentsGet) | **GET** /environments | Get environments
141
- *FlexpriceClient.EnvironmentsApi* | [**environmentsIdGet**](docs/EnvironmentsApi.md#environmentsIdGet) | **GET** /environments/{id} | Get an environment
142
- *FlexpriceClient.EnvironmentsApi* | [**environmentsIdPut**](docs/EnvironmentsApi.md#environmentsIdPut) | **PUT** /environments/{id} | Update an environment
143
- *FlexpriceClient.EnvironmentsApi* | [**environmentsPost**](docs/EnvironmentsApi.md#environmentsPost) | **POST** /environments | Create an environment
144
- *FlexpriceClient.EventsApi* | [**eventsBulkPost**](docs/EventsApi.md#eventsBulkPost) | **POST** /events/bulk | Bulk Ingest events
145
- *FlexpriceClient.EventsApi* | [**eventsGet**](docs/EventsApi.md#eventsGet) | **GET** /events | Get raw events
146
- *FlexpriceClient.EventsApi* | [**eventsPost**](docs/EventsApi.md#eventsPost) | **POST** /events | Ingest event
147
- *FlexpriceClient.EventsApi* | [**eventsUsageMeterPost**](docs/EventsApi.md#eventsUsageMeterPost) | **POST** /events/usage/meter | Get usage by meter
148
- *FlexpriceClient.EventsApi* | [**eventsUsagePost**](docs/EventsApi.md#eventsUsagePost) | **POST** /events/usage | Get usage statistics
149
- *FlexpriceClient.FeaturesApi* | [**featuresGet**](docs/FeaturesApi.md#featuresGet) | **GET** /features | List features
150
- *FlexpriceClient.FeaturesApi* | [**featuresIdDelete**](docs/FeaturesApi.md#featuresIdDelete) | **DELETE** /features/{id} | Delete a feature
151
- *FlexpriceClient.FeaturesApi* | [**featuresIdGet**](docs/FeaturesApi.md#featuresIdGet) | **GET** /features/{id} | Get a feature by ID
152
- *FlexpriceClient.FeaturesApi* | [**featuresIdPut**](docs/FeaturesApi.md#featuresIdPut) | **PUT** /features/{id} | Update a feature
153
- *FlexpriceClient.FeaturesApi* | [**featuresPost**](docs/FeaturesApi.md#featuresPost) | **POST** /features | Create a new feature
154
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsIdDelete**](docs/IntegrationsApi.md#secretsIntegrationsIdDelete) | **DELETE** /secrets/integrations/{id} | Delete an integration
155
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsLinkedGet**](docs/IntegrationsApi.md#secretsIntegrationsLinkedGet) | **GET** /secrets/integrations/linked | List linked integrations
156
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsProviderGet**](docs/IntegrationsApi.md#secretsIntegrationsProviderGet) | **GET** /secrets/integrations/{provider} | Get integration details
157
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsProviderPost**](docs/IntegrationsApi.md#secretsIntegrationsProviderPost) | **POST** /secrets/integrations/{provider} | Create or update an integration
158
- *FlexpriceClient.InvoicesApi* | [**customersIdInvoicesSummaryGet**](docs/InvoicesApi.md#customersIdInvoicesSummaryGet) | **GET** /customers/{id}/invoices/summary | Get a customer invoice summary
159
- *FlexpriceClient.InvoicesApi* | [**invoicesGet**](docs/InvoicesApi.md#invoicesGet) | **GET** /invoices | List invoices
160
- *FlexpriceClient.InvoicesApi* | [**invoicesIdFinalizePost**](docs/InvoicesApi.md#invoicesIdFinalizePost) | **POST** /invoices/{id}/finalize | Finalize an invoice
161
- *FlexpriceClient.InvoicesApi* | [**invoicesIdGet**](docs/InvoicesApi.md#invoicesIdGet) | **GET** /invoices/{id} | Get an invoice by ID
162
- *FlexpriceClient.InvoicesApi* | [**invoicesIdPaymentAttemptPost**](docs/InvoicesApi.md#invoicesIdPaymentAttemptPost) | **POST** /invoices/{id}/payment/attempt | Attempt payment for an invoice
163
- *FlexpriceClient.InvoicesApi* | [**invoicesIdPaymentPut**](docs/InvoicesApi.md#invoicesIdPaymentPut) | **PUT** /invoices/{id}/payment | Update invoice payment status
164
- *FlexpriceClient.InvoicesApi* | [**invoicesIdPdfGet**](docs/InvoicesApi.md#invoicesIdPdfGet) | **GET** /invoices/{id}/pdf | Get PDF for an invoice
165
- *FlexpriceClient.InvoicesApi* | [**invoicesIdVoidPost**](docs/InvoicesApi.md#invoicesIdVoidPost) | **POST** /invoices/{id}/void | Void an invoice
166
- *FlexpriceClient.InvoicesApi* | [**invoicesPost**](docs/InvoicesApi.md#invoicesPost) | **POST** /invoices | Create a new invoice
167
- *FlexpriceClient.InvoicesApi* | [**invoicesPreviewPost**](docs/InvoicesApi.md#invoicesPreviewPost) | **POST** /invoices/preview | Get a preview invoice
168
- *FlexpriceClient.MetersApi* | [**metersGet**](docs/MetersApi.md#metersGet) | **GET** /meters | List meters
169
- *FlexpriceClient.MetersApi* | [**metersIdDelete**](docs/MetersApi.md#metersIdDelete) | **DELETE** /meters/{id} | Delete meter
170
- *FlexpriceClient.MetersApi* | [**metersIdDisablePost**](docs/MetersApi.md#metersIdDisablePost) | **POST** /meters/{id}/disable | Disable meter [TODO: Deprecate]
171
- *FlexpriceClient.MetersApi* | [**metersIdGet**](docs/MetersApi.md#metersIdGet) | **GET** /meters/{id} | Get meter
172
- *FlexpriceClient.MetersApi* | [**metersIdPut**](docs/MetersApi.md#metersIdPut) | **PUT** /meters/{id} | Update meter
173
- *FlexpriceClient.MetersApi* | [**metersPost**](docs/MetersApi.md#metersPost) | **POST** /meters | Create meter
174
- *FlexpriceClient.PaymentsApi* | [**paymentsGet**](docs/PaymentsApi.md#paymentsGet) | **GET** /payments | List payments
175
- *FlexpriceClient.PaymentsApi* | [**paymentsIdDelete**](docs/PaymentsApi.md#paymentsIdDelete) | **DELETE** /payments/{id} | Delete a payment
176
- *FlexpriceClient.PaymentsApi* | [**paymentsIdGet**](docs/PaymentsApi.md#paymentsIdGet) | **GET** /payments/{id} | Get a payment by ID
177
- *FlexpriceClient.PaymentsApi* | [**paymentsIdProcessPost**](docs/PaymentsApi.md#paymentsIdProcessPost) | **POST** /payments/{id}/process | Process a payment
178
- *FlexpriceClient.PaymentsApi* | [**paymentsIdPut**](docs/PaymentsApi.md#paymentsIdPut) | **PUT** /payments/{id} | Update a payment
179
- *FlexpriceClient.PaymentsApi* | [**paymentsPost**](docs/PaymentsApi.md#paymentsPost) | **POST** /payments | Create a new payment
180
- *FlexpriceClient.PlansApi* | [**plansGet**](docs/PlansApi.md#plansGet) | **GET** /plans | Get plans
181
- *FlexpriceClient.PlansApi* | [**plansIdDelete**](docs/PlansApi.md#plansIdDelete) | **DELETE** /plans/{id} | Delete a plan
182
- *FlexpriceClient.PlansApi* | [**plansIdGet**](docs/PlansApi.md#plansIdGet) | **GET** /plans/{id} | Get a plan
183
- *FlexpriceClient.PlansApi* | [**plansIdPut**](docs/PlansApi.md#plansIdPut) | **PUT** /plans/{id} | Update a plan
184
- *FlexpriceClient.PlansApi* | [**plansPost**](docs/PlansApi.md#plansPost) | **POST** /plans | Create a new plan
185
- *FlexpriceClient.PricesApi* | [**pricesGet**](docs/PricesApi.md#pricesGet) | **GET** /prices | Get prices
186
- *FlexpriceClient.PricesApi* | [**pricesIdDelete**](docs/PricesApi.md#pricesIdDelete) | **DELETE** /prices/{id} | Delete a price
187
- *FlexpriceClient.PricesApi* | [**pricesIdGet**](docs/PricesApi.md#pricesIdGet) | **GET** /prices/{id} | Get a price by ID
188
- *FlexpriceClient.PricesApi* | [**pricesIdPut**](docs/PricesApi.md#pricesIdPut) | **PUT** /prices/{id} | Update a price
189
- *FlexpriceClient.PricesApi* | [**pricesPost**](docs/PricesApi.md#pricesPost) | **POST** /prices | Create a new price
190
- *FlexpriceClient.SecretsApi* | [**secretsApiKeysGet**](docs/SecretsApi.md#secretsApiKeysGet) | **GET** /secrets/api/keys | List API keys
191
- *FlexpriceClient.SecretsApi* | [**secretsApiKeysIdDelete**](docs/SecretsApi.md#secretsApiKeysIdDelete) | **DELETE** /secrets/api/keys/{id} | Delete an API key
192
- *FlexpriceClient.SecretsApi* | [**secretsApiKeysPost**](docs/SecretsApi.md#secretsApiKeysPost) | **POST** /secrets/api/keys | Create a new API key
193
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsGet**](docs/SubscriptionsApi.md#subscriptionsGet) | **GET** /subscriptions | List subscriptions
194
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdCancelPost**](docs/SubscriptionsApi.md#subscriptionsIdCancelPost) | **POST** /subscriptions/{id}/cancel | Cancel subscription
195
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdGet**](docs/SubscriptionsApi.md#subscriptionsIdGet) | **GET** /subscriptions/{id} | Get subscription
196
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdPausePost**](docs/SubscriptionsApi.md#subscriptionsIdPausePost) | **POST** /subscriptions/{id}/pause | Pause a subscription
197
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdPausesGet**](docs/SubscriptionsApi.md#subscriptionsIdPausesGet) | **GET** /subscriptions/{id}/pauses | List all pauses for a subscription
198
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdResumePost**](docs/SubscriptionsApi.md#subscriptionsIdResumePost) | **POST** /subscriptions/{id}/resume | Resume a paused subscription
199
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsPost**](docs/SubscriptionsApi.md#subscriptionsPost) | **POST** /subscriptions | Create subscription
200
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsUsagePost**](docs/SubscriptionsApi.md#subscriptionsUsagePost) | **POST** /subscriptions/usage | Get usage by subscription
201
- *FlexpriceClient.TasksApi* | [**tasksGet**](docs/TasksApi.md#tasksGet) | **GET** /tasks | List tasks
202
- *FlexpriceClient.TasksApi* | [**tasksIdGet**](docs/TasksApi.md#tasksIdGet) | **GET** /tasks/{id} | Get a task by ID
203
- *FlexpriceClient.TasksApi* | [**tasksIdProcessPost**](docs/TasksApi.md#tasksIdProcessPost) | **POST** /tasks/{id}/process | Process a task
204
- *FlexpriceClient.TasksApi* | [**tasksIdStatusPut**](docs/TasksApi.md#tasksIdStatusPut) | **PUT** /tasks/{id}/status | Update task status
205
- *FlexpriceClient.TasksApi* | [**tasksPost**](docs/TasksApi.md#tasksPost) | **POST** /tasks | Create a new task
206
- *FlexpriceClient.TenantsApi* | [**tenantBillingGet**](docs/TenantsApi.md#tenantBillingGet) | **GET** /tenant/billing | Get billing usage for the current tenant
207
- *FlexpriceClient.TenantsApi* | [**tenantsIdGet**](docs/TenantsApi.md#tenantsIdGet) | **GET** /tenants/{id} | Get tenant by ID
208
- *FlexpriceClient.TenantsApi* | [**tenantsPost**](docs/TenantsApi.md#tenantsPost) | **POST** /tenants | Create a new tenant
209
- *FlexpriceClient.TenantsApi* | [**tenantsUpdatePut**](docs/TenantsApi.md#tenantsUpdatePut) | **PUT** /tenants/update | Update a tenant
210
- *FlexpriceClient.UsersApi* | [**usersMeGet**](docs/UsersApi.md#usersMeGet) | **GET** /users/me | Get user info
211
- *FlexpriceClient.WalletsApi* | [**customersIdWalletsGet**](docs/WalletsApi.md#customersIdWalletsGet) | **GET** /customers/{id}/wallets | Get wallets by customer ID
212
- *FlexpriceClient.WalletsApi* | [**walletsIdBalanceRealTimeGet**](docs/WalletsApi.md#walletsIdBalanceRealTimeGet) | **GET** /wallets/{id}/balance/real-time | Get wallet balance
213
- *FlexpriceClient.WalletsApi* | [**walletsIdGet**](docs/WalletsApi.md#walletsIdGet) | **GET** /wallets/{id} | Get wallet by ID
214
- *FlexpriceClient.WalletsApi* | [**walletsIdPut**](docs/WalletsApi.md#walletsIdPut) | **PUT** /wallets/{id} | Update a wallet
215
- *FlexpriceClient.WalletsApi* | [**walletsIdTerminatePost**](docs/WalletsApi.md#walletsIdTerminatePost) | **POST** /wallets/{id}/terminate | Terminate a wallet
216
- *FlexpriceClient.WalletsApi* | [**walletsIdTopUpPost**](docs/WalletsApi.md#walletsIdTopUpPost) | **POST** /wallets/{id}/top-up | Top up wallet
217
- *FlexpriceClient.WalletsApi* | [**walletsIdTransactionsGet**](docs/WalletsApi.md#walletsIdTransactionsGet) | **GET** /wallets/{id}/transactions | Get wallet transactions
218
- *FlexpriceClient.WalletsApi* | [**walletsPost**](docs/WalletsApi.md#walletsPost) | **POST** /wallets | Create a new wallet
219
-
220
-
221
- ## Documentation for Models
222
-
223
- - [FlexpriceClient.DtoAddress](docs/DtoAddress.md)
224
- - [FlexpriceClient.DtoAggregatedEntitlement](docs/DtoAggregatedEntitlement.md)
225
- - [FlexpriceClient.DtoAggregatedFeature](docs/DtoAggregatedFeature.md)
226
- - [FlexpriceClient.DtoAuthResponse](docs/DtoAuthResponse.md)
227
- - [FlexpriceClient.DtoBillingPeriodInfo](docs/DtoBillingPeriodInfo.md)
228
- - [FlexpriceClient.DtoBulkIngestEventRequest](docs/DtoBulkIngestEventRequest.md)
229
- - [FlexpriceClient.DtoCreateAPIKeyRequest](docs/DtoCreateAPIKeyRequest.md)
230
- - [FlexpriceClient.DtoCreateAPIKeyResponse](docs/DtoCreateAPIKeyResponse.md)
231
- - [FlexpriceClient.DtoCreateCustomerRequest](docs/DtoCreateCustomerRequest.md)
232
- - [FlexpriceClient.DtoCreateEntitlementRequest](docs/DtoCreateEntitlementRequest.md)
233
- - [FlexpriceClient.DtoCreateEnvironmentRequest](docs/DtoCreateEnvironmentRequest.md)
234
- - [FlexpriceClient.DtoCreateFeatureRequest](docs/DtoCreateFeatureRequest.md)
235
- - [FlexpriceClient.DtoCreateIntegrationRequest](docs/DtoCreateIntegrationRequest.md)
236
- - [FlexpriceClient.DtoCreateInvoiceLineItemRequest](docs/DtoCreateInvoiceLineItemRequest.md)
237
- - [FlexpriceClient.DtoCreateInvoiceRequest](docs/DtoCreateInvoiceRequest.md)
238
- - [FlexpriceClient.DtoCreateMeterRequest](docs/DtoCreateMeterRequest.md)
239
- - [FlexpriceClient.DtoCreatePaymentRequest](docs/DtoCreatePaymentRequest.md)
240
- - [FlexpriceClient.DtoCreatePlanEntitlementRequest](docs/DtoCreatePlanEntitlementRequest.md)
241
- - [FlexpriceClient.DtoCreatePlanPriceRequest](docs/DtoCreatePlanPriceRequest.md)
242
- - [FlexpriceClient.DtoCreatePlanRequest](docs/DtoCreatePlanRequest.md)
243
- - [FlexpriceClient.DtoCreatePriceRequest](docs/DtoCreatePriceRequest.md)
244
- - [FlexpriceClient.DtoCreatePriceTier](docs/DtoCreatePriceTier.md)
245
- - [FlexpriceClient.DtoCreateSubscriptionRequest](docs/DtoCreateSubscriptionRequest.md)
246
- - [FlexpriceClient.DtoCreateTaskRequest](docs/DtoCreateTaskRequest.md)
247
- - [FlexpriceClient.DtoCreateTenantRequest](docs/DtoCreateTenantRequest.md)
248
- - [FlexpriceClient.DtoCreateWalletRequest](docs/DtoCreateWalletRequest.md)
249
- - [FlexpriceClient.DtoCustomerEntitlementsResponse](docs/DtoCustomerEntitlementsResponse.md)
250
- - [FlexpriceClient.DtoCustomerInvoiceSummary](docs/DtoCustomerInvoiceSummary.md)
251
- - [FlexpriceClient.DtoCustomerMultiCurrencyInvoiceSummary](docs/DtoCustomerMultiCurrencyInvoiceSummary.md)
252
- - [FlexpriceClient.DtoCustomerResponse](docs/DtoCustomerResponse.md)
253
- - [FlexpriceClient.DtoCustomerUsageSummaryResponse](docs/DtoCustomerUsageSummaryResponse.md)
254
- - [FlexpriceClient.DtoEntitlementResponse](docs/DtoEntitlementResponse.md)
255
- - [FlexpriceClient.DtoEntitlementSource](docs/DtoEntitlementSource.md)
256
- - [FlexpriceClient.DtoEnvironmentResponse](docs/DtoEnvironmentResponse.md)
257
- - [FlexpriceClient.DtoEvent](docs/DtoEvent.md)
258
- - [FlexpriceClient.DtoFeatureResponse](docs/DtoFeatureResponse.md)
259
- - [FlexpriceClient.DtoFeatureUsageSummary](docs/DtoFeatureUsageSummary.md)
260
- - [FlexpriceClient.DtoGetEventsResponse](docs/DtoGetEventsResponse.md)
261
- - [FlexpriceClient.DtoGetPreviewInvoiceRequest](docs/DtoGetPreviewInvoiceRequest.md)
262
- - [FlexpriceClient.DtoGetUsageByMeterRequest](docs/DtoGetUsageByMeterRequest.md)
263
- - [FlexpriceClient.DtoGetUsageBySubscriptionRequest](docs/DtoGetUsageBySubscriptionRequest.md)
264
- - [FlexpriceClient.DtoGetUsageBySubscriptionResponse](docs/DtoGetUsageBySubscriptionResponse.md)
265
- - [FlexpriceClient.DtoGetUsageRequest](docs/DtoGetUsageRequest.md)
266
- - [FlexpriceClient.DtoGetUsageResponse](docs/DtoGetUsageResponse.md)
267
- - [FlexpriceClient.DtoIngestEventRequest](docs/DtoIngestEventRequest.md)
268
- - [FlexpriceClient.DtoInvoiceLineItemResponse](docs/DtoInvoiceLineItemResponse.md)
269
- - [FlexpriceClient.DtoInvoiceResponse](docs/DtoInvoiceResponse.md)
270
- - [FlexpriceClient.DtoLinkedIntegrationsResponse](docs/DtoLinkedIntegrationsResponse.md)
271
- - [FlexpriceClient.DtoListCustomersResponse](docs/DtoListCustomersResponse.md)
272
- - [FlexpriceClient.DtoListEntitlementsResponse](docs/DtoListEntitlementsResponse.md)
273
- - [FlexpriceClient.DtoListEnvironmentsResponse](docs/DtoListEnvironmentsResponse.md)
274
- - [FlexpriceClient.DtoListFeaturesResponse](docs/DtoListFeaturesResponse.md)
275
- - [FlexpriceClient.DtoListInvoicesResponse](docs/DtoListInvoicesResponse.md)
276
- - [FlexpriceClient.DtoListPaymentsResponse](docs/DtoListPaymentsResponse.md)
277
- - [FlexpriceClient.DtoListPlansResponse](docs/DtoListPlansResponse.md)
278
- - [FlexpriceClient.DtoListPricesResponse](docs/DtoListPricesResponse.md)
279
- - [FlexpriceClient.DtoListSecretsResponse](docs/DtoListSecretsResponse.md)
280
- - [FlexpriceClient.DtoListSubscriptionPausesResponse](docs/DtoListSubscriptionPausesResponse.md)
281
- - [FlexpriceClient.DtoListSubscriptionsResponse](docs/DtoListSubscriptionsResponse.md)
282
- - [FlexpriceClient.DtoListTasksResponse](docs/DtoListTasksResponse.md)
283
- - [FlexpriceClient.DtoListWalletTransactionsResponse](docs/DtoListWalletTransactionsResponse.md)
284
- - [FlexpriceClient.DtoLoginRequest](docs/DtoLoginRequest.md)
285
- - [FlexpriceClient.DtoMeterResponse](docs/DtoMeterResponse.md)
286
- - [FlexpriceClient.DtoPauseSubscriptionRequest](docs/DtoPauseSubscriptionRequest.md)
287
- - [FlexpriceClient.DtoPaymentAttemptResponse](docs/DtoPaymentAttemptResponse.md)
288
- - [FlexpriceClient.DtoPaymentResponse](docs/DtoPaymentResponse.md)
289
- - [FlexpriceClient.DtoPlanResponse](docs/DtoPlanResponse.md)
290
- - [FlexpriceClient.DtoPriceResponse](docs/DtoPriceResponse.md)
291
- - [FlexpriceClient.DtoResumeSubscriptionRequest](docs/DtoResumeSubscriptionRequest.md)
292
- - [FlexpriceClient.DtoSecretResponse](docs/DtoSecretResponse.md)
293
- - [FlexpriceClient.DtoSignUpRequest](docs/DtoSignUpRequest.md)
294
- - [FlexpriceClient.DtoSubscriptionPauseResponse](docs/DtoSubscriptionPauseResponse.md)
295
- - [FlexpriceClient.DtoSubscriptionResponse](docs/DtoSubscriptionResponse.md)
296
- - [FlexpriceClient.DtoSubscriptionUsageByMetersResponse](docs/DtoSubscriptionUsageByMetersResponse.md)
297
- - [FlexpriceClient.DtoTaskResponse](docs/DtoTaskResponse.md)
298
- - [FlexpriceClient.DtoTenantBillingDetails](docs/DtoTenantBillingDetails.md)
299
- - [FlexpriceClient.DtoTenantBillingUsage](docs/DtoTenantBillingUsage.md)
300
- - [FlexpriceClient.DtoTenantResponse](docs/DtoTenantResponse.md)
301
- - [FlexpriceClient.DtoTopUpWalletRequest](docs/DtoTopUpWalletRequest.md)
302
- - [FlexpriceClient.DtoUpdateCustomerRequest](docs/DtoUpdateCustomerRequest.md)
303
- - [FlexpriceClient.DtoUpdateEntitlementRequest](docs/DtoUpdateEntitlementRequest.md)
304
- - [FlexpriceClient.DtoUpdateEnvironmentRequest](docs/DtoUpdateEnvironmentRequest.md)
305
- - [FlexpriceClient.DtoUpdateFeatureRequest](docs/DtoUpdateFeatureRequest.md)
306
- - [FlexpriceClient.DtoUpdateMeterRequest](docs/DtoUpdateMeterRequest.md)
307
- - [FlexpriceClient.DtoUpdatePaymentRequest](docs/DtoUpdatePaymentRequest.md)
308
- - [FlexpriceClient.DtoUpdatePaymentStatusRequest](docs/DtoUpdatePaymentStatusRequest.md)
309
- - [FlexpriceClient.DtoUpdatePlanEntitlementRequest](docs/DtoUpdatePlanEntitlementRequest.md)
310
- - [FlexpriceClient.DtoUpdatePlanPriceRequest](docs/DtoUpdatePlanPriceRequest.md)
311
- - [FlexpriceClient.DtoUpdatePlanRequest](docs/DtoUpdatePlanRequest.md)
312
- - [FlexpriceClient.DtoUpdatePriceRequest](docs/DtoUpdatePriceRequest.md)
313
- - [FlexpriceClient.DtoUpdateTaskStatusRequest](docs/DtoUpdateTaskStatusRequest.md)
314
- - [FlexpriceClient.DtoUpdateTenantRequest](docs/DtoUpdateTenantRequest.md)
315
- - [FlexpriceClient.DtoUpdateWalletRequest](docs/DtoUpdateWalletRequest.md)
316
- - [FlexpriceClient.DtoUsageResult](docs/DtoUsageResult.md)
317
- - [FlexpriceClient.DtoUserResponse](docs/DtoUserResponse.md)
318
- - [FlexpriceClient.DtoWalletBalanceResponse](docs/DtoWalletBalanceResponse.md)
319
- - [FlexpriceClient.DtoWalletResponse](docs/DtoWalletResponse.md)
320
- - [FlexpriceClient.DtoWalletTransactionResponse](docs/DtoWalletTransactionResponse.md)
321
- - [FlexpriceClient.ErrorsErrorDetail](docs/ErrorsErrorDetail.md)
322
- - [FlexpriceClient.ErrorsErrorResponse](docs/ErrorsErrorResponse.md)
323
- - [FlexpriceClient.MeterAggregation](docs/MeterAggregation.md)
324
- - [FlexpriceClient.MeterFilter](docs/MeterFilter.md)
325
- - [FlexpriceClient.PriceJSONBTransformQuantity](docs/PriceJSONBTransformQuantity.md)
326
- - [FlexpriceClient.PricePrice](docs/PricePrice.md)
327
- - [FlexpriceClient.PricePriceTier](docs/PricePriceTier.md)
328
- - [FlexpriceClient.PriceTransformQuantity](docs/PriceTransformQuantity.md)
329
- - [FlexpriceClient.SubscriptionSubscriptionLineItem](docs/SubscriptionSubscriptionLineItem.md)
330
- - [FlexpriceClient.SubscriptionSubscriptionPause](docs/SubscriptionSubscriptionPause.md)
331
- - [FlexpriceClient.TypesAggregationType](docs/TypesAggregationType.md)
332
- - [FlexpriceClient.TypesAutoTopupTrigger](docs/TypesAutoTopupTrigger.md)
333
- - [FlexpriceClient.TypesBillingCadence](docs/TypesBillingCadence.md)
334
- - [FlexpriceClient.TypesBillingModel](docs/TypesBillingModel.md)
335
- - [FlexpriceClient.TypesBillingPeriod](docs/TypesBillingPeriod.md)
336
- - [FlexpriceClient.TypesBillingTier](docs/TypesBillingTier.md)
337
- - [FlexpriceClient.TypesEntityType](docs/TypesEntityType.md)
338
- - [FlexpriceClient.TypesFeatureType](docs/TypesFeatureType.md)
339
- - [FlexpriceClient.TypesFileType](docs/TypesFileType.md)
340
- - [FlexpriceClient.TypesInvoiceBillingReason](docs/TypesInvoiceBillingReason.md)
341
- - [FlexpriceClient.TypesInvoiceCadence](docs/TypesInvoiceCadence.md)
342
- - [FlexpriceClient.TypesInvoiceStatus](docs/TypesInvoiceStatus.md)
343
- - [FlexpriceClient.TypesInvoiceType](docs/TypesInvoiceType.md)
344
- - [FlexpriceClient.TypesPaginationResponse](docs/TypesPaginationResponse.md)
345
- - [FlexpriceClient.TypesPauseMode](docs/TypesPauseMode.md)
346
- - [FlexpriceClient.TypesPauseStatus](docs/TypesPauseStatus.md)
347
- - [FlexpriceClient.TypesPaymentDestinationType](docs/TypesPaymentDestinationType.md)
348
- - [FlexpriceClient.TypesPaymentMethodType](docs/TypesPaymentMethodType.md)
349
- - [FlexpriceClient.TypesPaymentStatus](docs/TypesPaymentStatus.md)
350
- - [FlexpriceClient.TypesPriceType](docs/TypesPriceType.md)
351
- - [FlexpriceClient.TypesResetUsage](docs/TypesResetUsage.md)
352
- - [FlexpriceClient.TypesResumeMode](docs/TypesResumeMode.md)
353
- - [FlexpriceClient.TypesSecretProvider](docs/TypesSecretProvider.md)
354
- - [FlexpriceClient.TypesSecretType](docs/TypesSecretType.md)
355
- - [FlexpriceClient.TypesStatus](docs/TypesStatus.md)
356
- - [FlexpriceClient.TypesSubscriptionStatus](docs/TypesSubscriptionStatus.md)
357
- - [FlexpriceClient.TypesTaskStatus](docs/TypesTaskStatus.md)
358
- - [FlexpriceClient.TypesTaskType](docs/TypesTaskType.md)
359
- - [FlexpriceClient.TypesTransactionReason](docs/TypesTransactionReason.md)
360
- - [FlexpriceClient.TypesTransactionStatus](docs/TypesTransactionStatus.md)
361
- - [FlexpriceClient.TypesTransactionType](docs/TypesTransactionType.md)
362
- - [FlexpriceClient.TypesWalletConfig](docs/TypesWalletConfig.md)
363
- - [FlexpriceClient.TypesWalletConfigPriceType](docs/TypesWalletConfigPriceType.md)
364
- - [FlexpriceClient.TypesWalletStatus](docs/TypesWalletStatus.md)
365
- - [FlexpriceClient.TypesWalletTxReferenceType](docs/TypesWalletTxReferenceType.md)
366
- - [FlexpriceClient.TypesWalletType](docs/TypesWalletType.md)
367
- - [FlexpriceClient.TypesWindowSize](docs/TypesWindowSize.md)
368
-
369
-
370
- ## Documentation for Authorization
371
-
372
-
373
- Authentication schemes defined for the API:
374
- ### ApiKeyAuth
375
-
376
-
377
- - **Type**: API key
378
- - **API key parameter name**: x-api-key
379
- - **Location**: HTTP header
380
-
255
+ });
256
+ ```
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _DtoBulkIngestEventRequest = _interopRequireDefault(require("../model/DtoBulkIngestEventRequest"));
9
+ var _DtoGetEventsRequest = _interopRequireDefault(require("../model/DtoGetEventsRequest"));
9
10
  var _DtoGetEventsResponse = _interopRequireDefault(require("../model/DtoGetEventsResponse"));
10
11
  var _DtoGetUsageByMeterRequest = _interopRequireDefault(require("../model/DtoGetUsageByMeterRequest"));
11
12
  var _DtoGetUsageRequest = _interopRequireDefault(require("../model/DtoGetUsageRequest"));
@@ -84,52 +85,6 @@ var EventsApi = exports["default"] = /*#__PURE__*/function () {
84
85
  return this.apiClient.callApi('/events/bulk', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
85
86
  }
86
87
 
87
- /**
88
- * Callback function to receive the result of the eventsGet operation.
89
- * @callback module:api/EventsApi~eventsGetCallback
90
- * @param {String} error Error message, if any.
91
- * @param {module:model/DtoGetEventsResponse} data The data returned by the service call.
92
- * @param {String} response The complete HTTP response.
93
- */
94
-
95
- /**
96
- * Get raw events
97
- * Retrieve raw events with pagination and filtering
98
- * @param {Object} opts Optional parameters
99
- * @param {String} [externalCustomerId] External Customer ID
100
- * @param {String} [eventName] Event Name
101
- * @param {String} [startTime] Start Time (RFC3339)
102
- * @param {String} [endTime] End Time (RFC3339)
103
- * @param {String} [iterFirstKey] Iter First Key (unix_timestamp_nanoseconds::event_id)
104
- * @param {String} [iterLastKey] Iter Last Key (unix_timestamp_nanoseconds::event_id)
105
- * @param {Number} [pageSize] Page Size (1-50)
106
- * @param {module:api/EventsApi~eventsGetCallback} callback The callback function, accepting three arguments: error, data, response
107
- * data is of type: {@link module:model/DtoGetEventsResponse}
108
- */
109
- }, {
110
- key: "eventsGet",
111
- value: function eventsGet(opts, callback) {
112
- opts = opts || {};
113
- var postBody = null;
114
- var pathParams = {};
115
- var queryParams = {
116
- 'external_customer_id': opts['externalCustomerId'],
117
- 'event_name': opts['eventName'],
118
- 'start_time': opts['startTime'],
119
- 'end_time': opts['endTime'],
120
- 'iter_first_key': opts['iterFirstKey'],
121
- 'iter_last_key': opts['iterLastKey'],
122
- 'page_size': opts['pageSize']
123
- };
124
- var headerParams = {};
125
- var formParams = {};
126
- var authNames = ['ApiKeyAuth'];
127
- var contentTypes = [];
128
- var accepts = ['application/json'];
129
- var returnType = _DtoGetEventsResponse["default"];
130
- return this.apiClient.callApi('/events', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
131
- }
132
-
133
88
  /**
134
89
  * Callback function to receive the result of the eventsPost operation.
135
90
  * @callback module:api/EventsApi~eventsPostCallback
@@ -166,6 +121,40 @@ var EventsApi = exports["default"] = /*#__PURE__*/function () {
166
121
  return this.apiClient.callApi('/events', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
167
122
  }
168
123
 
124
+ /**
125
+ * Callback function to receive the result of the eventsQueryPost operation.
126
+ * @callback module:api/EventsApi~eventsQueryPostCallback
127
+ * @param {String} error Error message, if any.
128
+ * @param {module:model/DtoGetEventsResponse} data The data returned by the service call.
129
+ * @param {String} response The complete HTTP response.
130
+ */
131
+
132
+ /**
133
+ * List raw events
134
+ * Retrieve raw events with pagination and filtering
135
+ * @param {module:model/DtoGetEventsRequest} request Request body
136
+ * @param {module:api/EventsApi~eventsQueryPostCallback} callback The callback function, accepting three arguments: error, data, response
137
+ * data is of type: {@link module:model/DtoGetEventsResponse}
138
+ */
139
+ }, {
140
+ key: "eventsQueryPost",
141
+ value: function eventsQueryPost(request, callback) {
142
+ var postBody = request;
143
+ // verify the required parameter 'request' is set
144
+ if (request === undefined || request === null) {
145
+ throw new Error("Missing the required parameter 'request' when calling eventsQueryPost");
146
+ }
147
+ var pathParams = {};
148
+ var queryParams = {};
149
+ var headerParams = {};
150
+ var formParams = {};
151
+ var authNames = ['ApiKeyAuth'];
152
+ var contentTypes = [];
153
+ var accepts = ['application/json'];
154
+ var returnType = _DtoGetEventsResponse["default"];
155
+ return this.apiClient.callApi('/events/query', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
156
+ }
157
+
169
158
  /**
170
159
  * Callback function to receive the result of the eventsUsageMeterPost operation.
171
160
  * @callback module:api/EventsApi~eventsUsageMeterPostCallback
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _DtoCreateMeterRequest = _interopRequireDefault(require("../model/DtoCreateMeterRequest"));
9
+ var _DtoListMetersResponse = _interopRequireDefault(require("../model/DtoListMetersResponse"));
9
10
  var _DtoMeterResponse = _interopRequireDefault(require("../model/DtoMeterResponse"));
10
11
  var _DtoUpdateMeterRequest = _interopRequireDefault(require("../model/DtoUpdateMeterRequest"));
11
12
  var _ErrorsErrorResponse = _interopRequireDefault(require("../model/ErrorsErrorResponse"));
@@ -49,7 +50,7 @@ var MetersApi = exports["default"] = /*#__PURE__*/function () {
49
50
  * Callback function to receive the result of the metersGet operation.
50
51
  * @callback module:api/MetersApi~metersGetCallback
51
52
  * @param {String} error Error message, if any.
52
- * @param {Array.<module:model/DtoMeterResponse>} data The data returned by the service call.
53
+ * @param {module:model/DtoListMetersResponse} data The data returned by the service call.
53
54
  * @param {String} response The complete HTTP response.
54
55
  */
55
56
 
@@ -68,7 +69,7 @@ var MetersApi = exports["default"] = /*#__PURE__*/function () {
68
69
  * @param {String} [startTime]
69
70
  * @param {module:model/String} [status]
70
71
  * @param {module:api/MetersApi~metersGetCallback} callback The callback function, accepting three arguments: error, data, response
71
- * data is of type: {@link Array.<module:model/DtoMeterResponse>}
72
+ * data is of type: {@link module:model/DtoListMetersResponse}
72
73
  */
73
74
  return _createClass(MetersApi, [{
74
75
  key: "metersGet",
@@ -93,7 +94,7 @@ var MetersApi = exports["default"] = /*#__PURE__*/function () {
93
94
  var authNames = ['ApiKeyAuth'];
94
95
  var contentTypes = [];
95
96
  var accepts = ['application/json'];
96
- var returnType = [_DtoMeterResponse["default"]];
97
+ var returnType = _DtoListMetersResponse["default"];
97
98
  return this.apiClient.callApi('/meters', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
98
99
  }
99
100
 
package/dist/index.js CHANGED
@@ -243,6 +243,12 @@ Object.defineProperty(exports, "DtoFeatureUsageSummary", {
243
243
  return _DtoFeatureUsageSummary["default"];
244
244
  }
245
245
  });
246
+ Object.defineProperty(exports, "DtoGetEventsRequest", {
247
+ enumerable: true,
248
+ get: function get() {
249
+ return _DtoGetEventsRequest["default"];
250
+ }
251
+ });
246
252
  Object.defineProperty(exports, "DtoGetEventsResponse", {
247
253
  enumerable: true,
248
254
  get: function get() {
@@ -339,6 +345,12 @@ Object.defineProperty(exports, "DtoListInvoicesResponse", {
339
345
  return _DtoListInvoicesResponse["default"];
340
346
  }
341
347
  });
348
+ Object.defineProperty(exports, "DtoListMetersResponse", {
349
+ enumerable: true,
350
+ get: function get() {
351
+ return _DtoListMetersResponse["default"];
352
+ }
353
+ });
342
354
  Object.defineProperty(exports, "DtoListPaymentsResponse", {
343
355
  enumerable: true,
344
356
  get: function get() {
@@ -1025,6 +1037,7 @@ var _DtoEnvironmentResponse = _interopRequireDefault(require("./model/DtoEnviron
1025
1037
  var _DtoEvent = _interopRequireDefault(require("./model/DtoEvent"));
1026
1038
  var _DtoFeatureResponse = _interopRequireDefault(require("./model/DtoFeatureResponse"));
1027
1039
  var _DtoFeatureUsageSummary = _interopRequireDefault(require("./model/DtoFeatureUsageSummary"));
1040
+ var _DtoGetEventsRequest = _interopRequireDefault(require("./model/DtoGetEventsRequest"));
1028
1041
  var _DtoGetEventsResponse = _interopRequireDefault(require("./model/DtoGetEventsResponse"));
1029
1042
  var _DtoGetPreviewInvoiceRequest = _interopRequireDefault(require("./model/DtoGetPreviewInvoiceRequest"));
1030
1043
  var _DtoGetUsageByMeterRequest = _interopRequireDefault(require("./model/DtoGetUsageByMeterRequest"));
@@ -1041,6 +1054,7 @@ var _DtoListEntitlementsResponse = _interopRequireDefault(require("./model/DtoLi
1041
1054
  var _DtoListEnvironmentsResponse = _interopRequireDefault(require("./model/DtoListEnvironmentsResponse"));
1042
1055
  var _DtoListFeaturesResponse = _interopRequireDefault(require("./model/DtoListFeaturesResponse"));
1043
1056
  var _DtoListInvoicesResponse = _interopRequireDefault(require("./model/DtoListInvoicesResponse"));
1057
+ var _DtoListMetersResponse = _interopRequireDefault(require("./model/DtoListMetersResponse"));
1044
1058
  var _DtoListPaymentsResponse = _interopRequireDefault(require("./model/DtoListPaymentsResponse"));
1045
1059
  var _DtoListPlansResponse = _interopRequireDefault(require("./model/DtoListPlansResponse"));
1046
1060
  var _DtoListPricesResponse = _interopRequireDefault(require("./model/DtoListPricesResponse"));
@@ -36,12 +36,11 @@ var DtoCreateInvoiceLineItemRequest = /*#__PURE__*/function () {
36
36
  * Constructs a new <code>DtoCreateInvoiceLineItemRequest</code>.
37
37
  * @alias module:model/DtoCreateInvoiceLineItemRequest
38
38
  * @param amount {Number}
39
- * @param priceId {String}
40
39
  * @param quantity {Number}
41
40
  */
42
- function DtoCreateInvoiceLineItemRequest(amount, priceId, quantity) {
41
+ function DtoCreateInvoiceLineItemRequest(amount, quantity) {
43
42
  _classCallCheck(this, DtoCreateInvoiceLineItemRequest);
44
- DtoCreateInvoiceLineItemRequest.initialize(this, amount, priceId, quantity);
43
+ DtoCreateInvoiceLineItemRequest.initialize(this, amount, quantity);
45
44
  }
46
45
 
47
46
  /**
@@ -51,9 +50,8 @@ var DtoCreateInvoiceLineItemRequest = /*#__PURE__*/function () {
51
50
  */
52
51
  return _createClass(DtoCreateInvoiceLineItemRequest, null, [{
53
52
  key: "initialize",
54
- value: function initialize(obj, amount, priceId, quantity) {
53
+ value: function initialize(obj, amount, quantity) {
55
54
  obj['amount'] = amount;
56
- obj['price_id'] = priceId;
57
55
  obj['quantity'] = quantity;
58
56
  }
59
57
 
@@ -174,7 +172,7 @@ var DtoCreateInvoiceLineItemRequest = /*#__PURE__*/function () {
174
172
  }
175
173
  }]);
176
174
  }();
177
- DtoCreateInvoiceLineItemRequest.RequiredProperties = ["amount", "price_id", "quantity"];
175
+ DtoCreateInvoiceLineItemRequest.RequiredProperties = ["amount", "quantity"];
178
176
 
179
177
  /**
180
178
  * @member {Number} amount
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15
+ * FlexPrice API
16
+ * FlexPrice API Service
17
+ *
18
+ * The version of the OpenAPI document: 1.0
19
+ *
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
26
+ /**
27
+ * The DtoGetEventsRequest model module.
28
+ * @module model/DtoGetEventsRequest
29
+ * @version 1.0
30
+ */
31
+ var DtoGetEventsRequest = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>DtoGetEventsRequest</code>.
34
+ * @alias module:model/DtoGetEventsRequest
35
+ */
36
+ function DtoGetEventsRequest() {
37
+ _classCallCheck(this, DtoGetEventsRequest);
38
+ DtoGetEventsRequest.initialize(this);
39
+ }
40
+
41
+ /**
42
+ * Initializes the fields of this object.
43
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
+ * Only for internal use.
45
+ */
46
+ return _createClass(DtoGetEventsRequest, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>DtoGetEventsRequest</code> from a plain JavaScript object, optionally creating a new instance.
52
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
54
+ * @param {module:model/DtoGetEventsRequest} obj Optional instance to populate.
55
+ * @return {module:model/DtoGetEventsRequest} The populated <code>DtoGetEventsRequest</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new DtoGetEventsRequest();
62
+ if (data.hasOwnProperty('count_total')) {
63
+ obj['count_total'] = _ApiClient["default"].convertToType(data['count_total'], 'Boolean');
64
+ }
65
+ if (data.hasOwnProperty('end_time')) {
66
+ obj['end_time'] = _ApiClient["default"].convertToType(data['end_time'], 'String');
67
+ }
68
+ if (data.hasOwnProperty('event_id')) {
69
+ obj['event_id'] = _ApiClient["default"].convertToType(data['event_id'], 'String');
70
+ }
71
+ if (data.hasOwnProperty('event_name')) {
72
+ obj['event_name'] = _ApiClient["default"].convertToType(data['event_name'], 'String');
73
+ }
74
+ if (data.hasOwnProperty('external_customer_id')) {
75
+ obj['external_customer_id'] = _ApiClient["default"].convertToType(data['external_customer_id'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('iter_first_key')) {
78
+ obj['iter_first_key'] = _ApiClient["default"].convertToType(data['iter_first_key'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('iter_last_key')) {
81
+ obj['iter_last_key'] = _ApiClient["default"].convertToType(data['iter_last_key'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('offset')) {
84
+ obj['offset'] = _ApiClient["default"].convertToType(data['offset'], 'Number');
85
+ }
86
+ if (data.hasOwnProperty('page_size')) {
87
+ obj['page_size'] = _ApiClient["default"].convertToType(data['page_size'], 'Number');
88
+ }
89
+ if (data.hasOwnProperty('property_filters')) {
90
+ obj['property_filters'] = _ApiClient["default"].convertToType(data['property_filters'], {
91
+ 'String': ['String']
92
+ });
93
+ }
94
+ if (data.hasOwnProperty('start_time')) {
95
+ obj['start_time'] = _ApiClient["default"].convertToType(data['start_time'], 'String');
96
+ }
97
+ }
98
+ return obj;
99
+ }
100
+
101
+ /**
102
+ * Validates the JSON data with respect to <code>DtoGetEventsRequest</code>.
103
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
104
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DtoGetEventsRequest</code>.
105
+ */
106
+ }, {
107
+ key: "validateJSON",
108
+ value: function validateJSON(data) {
109
+ // ensure the json data is a string
110
+ if (data['end_time'] && !(typeof data['end_time'] === 'string' || data['end_time'] instanceof String)) {
111
+ throw new Error("Expected the field `end_time` to be a primitive type in the JSON string but got " + data['end_time']);
112
+ }
113
+ // ensure the json data is a string
114
+ if (data['event_id'] && !(typeof data['event_id'] === 'string' || data['event_id'] instanceof String)) {
115
+ throw new Error("Expected the field `event_id` to be a primitive type in the JSON string but got " + data['event_id']);
116
+ }
117
+ // ensure the json data is a string
118
+ if (data['event_name'] && !(typeof data['event_name'] === 'string' || data['event_name'] instanceof String)) {
119
+ throw new Error("Expected the field `event_name` to be a primitive type in the JSON string but got " + data['event_name']);
120
+ }
121
+ // ensure the json data is a string
122
+ if (data['external_customer_id'] && !(typeof data['external_customer_id'] === 'string' || data['external_customer_id'] instanceof String)) {
123
+ throw new Error("Expected the field `external_customer_id` to be a primitive type in the JSON string but got " + data['external_customer_id']);
124
+ }
125
+ // ensure the json data is a string
126
+ if (data['iter_first_key'] && !(typeof data['iter_first_key'] === 'string' || data['iter_first_key'] instanceof String)) {
127
+ throw new Error("Expected the field `iter_first_key` to be a primitive type in the JSON string but got " + data['iter_first_key']);
128
+ }
129
+ // ensure the json data is a string
130
+ if (data['iter_last_key'] && !(typeof data['iter_last_key'] === 'string' || data['iter_last_key'] instanceof String)) {
131
+ throw new Error("Expected the field `iter_last_key` to be a primitive type in the JSON string but got " + data['iter_last_key']);
132
+ }
133
+ // ensure the json data is a string
134
+ if (data['start_time'] && !(typeof data['start_time'] === 'string' || data['start_time'] instanceof String)) {
135
+ throw new Error("Expected the field `start_time` to be a primitive type in the JSON string but got " + data['start_time']);
136
+ }
137
+ return true;
138
+ }
139
+ }]);
140
+ }();
141
+ /**
142
+ * @member {Boolean} count_total
143
+ */
144
+ DtoGetEventsRequest.prototype['count_total'] = undefined;
145
+
146
+ /**
147
+ * @member {String} end_time
148
+ */
149
+ DtoGetEventsRequest.prototype['end_time'] = undefined;
150
+
151
+ /**
152
+ * @member {String} event_id
153
+ */
154
+ DtoGetEventsRequest.prototype['event_id'] = undefined;
155
+
156
+ /**
157
+ * @member {String} event_name
158
+ */
159
+ DtoGetEventsRequest.prototype['event_name'] = undefined;
160
+
161
+ /**
162
+ * @member {String} external_customer_id
163
+ */
164
+ DtoGetEventsRequest.prototype['external_customer_id'] = undefined;
165
+
166
+ /**
167
+ * @member {String} iter_first_key
168
+ */
169
+ DtoGetEventsRequest.prototype['iter_first_key'] = undefined;
170
+
171
+ /**
172
+ * @member {String} iter_last_key
173
+ */
174
+ DtoGetEventsRequest.prototype['iter_last_key'] = undefined;
175
+
176
+ /**
177
+ * @member {Number} offset
178
+ */
179
+ DtoGetEventsRequest.prototype['offset'] = undefined;
180
+
181
+ /**
182
+ * @member {Number} page_size
183
+ */
184
+ DtoGetEventsRequest.prototype['page_size'] = undefined;
185
+
186
+ /**
187
+ * @member {Object.<String, Array.<String>>} property_filters
188
+ */
189
+ DtoGetEventsRequest.prototype['property_filters'] = undefined;
190
+
191
+ /**
192
+ * @member {String} start_time
193
+ */
194
+ DtoGetEventsRequest.prototype['start_time'] = undefined;
195
+ var _default = exports["default"] = DtoGetEventsRequest;
@@ -75,6 +75,12 @@ var DtoGetEventsResponse = /*#__PURE__*/function () {
75
75
  if (data.hasOwnProperty('iter_last_key')) {
76
76
  obj['iter_last_key'] = _ApiClient["default"].convertToType(data['iter_last_key'], 'String');
77
77
  }
78
+ if (data.hasOwnProperty('offset')) {
79
+ obj['offset'] = _ApiClient["default"].convertToType(data['offset'], 'Number');
80
+ }
81
+ if (data.hasOwnProperty('total_count')) {
82
+ obj['total_count'] = _ApiClient["default"].convertToType(data['total_count'], 'Number');
83
+ }
78
84
  }
79
85
  return obj;
80
86
  }
@@ -139,4 +145,14 @@ DtoGetEventsResponse.prototype['iter_first_key'] = undefined;
139
145
  * @member {String} iter_last_key
140
146
  */
141
147
  DtoGetEventsResponse.prototype['iter_last_key'] = undefined;
148
+
149
+ /**
150
+ * @member {Number} offset
151
+ */
152
+ DtoGetEventsResponse.prototype['offset'] = undefined;
153
+
154
+ /**
155
+ * @member {Number} total_count
156
+ */
157
+ DtoGetEventsResponse.prototype['total_count'] = undefined;
142
158
  var _default = exports["default"] = DtoGetEventsResponse;
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _DtoMeterResponse = _interopRequireDefault(require("./DtoMeterResponse"));
9
+ var _TypesPaginationResponse = _interopRequireDefault(require("./TypesPaginationResponse"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
20
+ * FlexPrice API
21
+ * FlexPrice API Service
22
+ *
23
+ * The version of the OpenAPI document: 1.0
24
+ *
25
+ *
26
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
27
+ * https://openapi-generator.tech
28
+ * Do not edit the class manually.
29
+ *
30
+ */
31
+ /**
32
+ * The DtoListMetersResponse model module.
33
+ * @module model/DtoListMetersResponse
34
+ * @version 1.0
35
+ */
36
+ var DtoListMetersResponse = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>DtoListMetersResponse</code>.
39
+ * @alias module:model/DtoListMetersResponse
40
+ */
41
+ function DtoListMetersResponse() {
42
+ _classCallCheck(this, DtoListMetersResponse);
43
+ DtoListMetersResponse.initialize(this);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(DtoListMetersResponse, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj) {}
54
+
55
+ /**
56
+ * Constructs a <code>DtoListMetersResponse</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/DtoListMetersResponse} obj Optional instance to populate.
60
+ * @return {module:model/DtoListMetersResponse} The populated <code>DtoListMetersResponse</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new DtoListMetersResponse();
67
+ if (data.hasOwnProperty('items')) {
68
+ obj['items'] = _ApiClient["default"].convertToType(data['items'], [_DtoMeterResponse["default"]]);
69
+ }
70
+ if (data.hasOwnProperty('pagination')) {
71
+ obj['pagination'] = _TypesPaginationResponse["default"].constructFromObject(data['pagination']);
72
+ }
73
+ }
74
+ return obj;
75
+ }
76
+
77
+ /**
78
+ * Validates the JSON data with respect to <code>DtoListMetersResponse</code>.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DtoListMetersResponse</code>.
81
+ */
82
+ }, {
83
+ key: "validateJSON",
84
+ value: function validateJSON(data) {
85
+ if (data['items']) {
86
+ // data not null
87
+ // ensure the json data is an array
88
+ if (!Array.isArray(data['items'])) {
89
+ throw new Error("Expected the field `items` to be an array in the JSON data but got " + data['items']);
90
+ }
91
+ // validate the optional field `items` (array)
92
+ var _iterator = _createForOfIteratorHelper(data['items']),
93
+ _step;
94
+ try {
95
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
96
+ var item = _step.value;
97
+ _DtoMeterResponse["default"].validateJSON(item);
98
+ }
99
+ } catch (err) {
100
+ _iterator.e(err);
101
+ } finally {
102
+ _iterator.f();
103
+ }
104
+ ;
105
+ }
106
+ // validate the optional field `pagination`
107
+ if (data['pagination']) {
108
+ // data not null
109
+ _TypesPaginationResponse["default"].validateJSON(data['pagination']);
110
+ }
111
+ return true;
112
+ }
113
+ }]);
114
+ }();
115
+ /**
116
+ * @member {Array.<module:model/DtoMeterResponse>} items
117
+ */
118
+ DtoListMetersResponse.prototype['items'] = undefined;
119
+
120
+ /**
121
+ * @member {module:model/TypesPaginationResponse} pagination
122
+ */
123
+ DtoListMetersResponse.prototype['pagination'] = undefined;
124
+ var _default = exports["default"] = DtoListMetersResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexprice/sdk",
3
- "version": "0.1.2",
3
+ "version": "1.0.13",
4
4
  "description": "Official JavaScript SDK of Flexprice",
5
5
  "license": "Apache 2.0",
6
6
  "homepage": "https://flexprice.io",