@flexprice/sdk 1.0.15 → 1.0.16

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.
@@ -19,6 +19,7 @@ import DtoCustomerUsageSummaryResponse from '../model/DtoCustomerUsageSummaryRes
19
19
  import DtoListCustomersResponse from '../model/DtoListCustomersResponse';
20
20
  import DtoUpdateCustomerRequest from '../model/DtoUpdateCustomerRequest';
21
21
  import ErrorsErrorResponse from '../model/ErrorsErrorResponse';
22
+ import TypesCustomerFilter from '../model/TypesCustomerFilter';
22
23
 
23
24
  /**
24
25
  * Customers service.
@@ -57,7 +58,6 @@ export default class CustomersApi {
57
58
  * @param {Number} [limit]
58
59
  * @param {Number} [offset]
59
60
  * @param {module:model/String} [order]
60
- * @param {String} [sort]
61
61
  * @param {String} [startTime]
62
62
  * @param {module:model/String} [status]
63
63
  * @param {module:api/CustomersApi~customersGetCallback} callback The callback function, accepting three arguments: error, data, response
@@ -76,7 +76,6 @@ export default class CustomersApi {
76
76
  'limit': opts['limit'],
77
77
  'offset': opts['offset'],
78
78
  'order': opts['order'],
79
- 'sort': opts['sort'],
80
79
  'start_time': opts['startTime'],
81
80
  'status': opts['status']
82
81
  };
@@ -342,4 +341,36 @@ export default class CustomersApi {
342
341
  let returnType = DtoCustomerResponse;
343
342
  return this.apiClient.callApi('/customers', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
344
343
  }
344
+
345
+ /**
346
+ * Callback function to receive the result of the customersSearchPost operation.
347
+ * @callback module:api/CustomersApi~customersSearchPostCallback
348
+ * @param {String} error Error message, if any.
349
+ * @param {module:model/DtoListCustomersResponse} data The data returned by the service call.
350
+ * @param {String} response The complete HTTP response.
351
+ */
352
+
353
+ /**
354
+ * List customers by filter
355
+ * List customers by filter
356
+ * @param {module:model/TypesCustomerFilter} filter Filter
357
+ * @param {module:api/CustomersApi~customersSearchPostCallback} callback The callback function, accepting three arguments: error, data, response
358
+ * data is of type: {@link module:model/DtoListCustomersResponse}
359
+ */
360
+ customersSearchPost(filter, callback) {
361
+ let postBody = filter;
362
+ // verify the required parameter 'filter' is set
363
+ if (filter === undefined || filter === null) {
364
+ throw new Error("Missing the required parameter 'filter' when calling customersSearchPost");
365
+ }
366
+ let pathParams = {};
367
+ let queryParams = {};
368
+ let headerParams = {};
369
+ let formParams = {};
370
+ let authNames = ['ApiKeyAuth'];
371
+ let contentTypes = ['application/json'];
372
+ let accepts = ['application/json'];
373
+ let returnType = DtoListCustomersResponse;
374
+ return this.apiClient.callApi('/customers/search', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
375
+ }
345
376
  }
@@ -15,6 +15,8 @@ import ApiClient from "../ApiClient";
15
15
  import DtoBulkIngestEventRequest from '../model/DtoBulkIngestEventRequest';
16
16
  import DtoGetEventsRequest from '../model/DtoGetEventsRequest';
17
17
  import DtoGetEventsResponse from '../model/DtoGetEventsResponse';
18
+ import DtoGetUsageAnalyticsRequest from '../model/DtoGetUsageAnalyticsRequest';
19
+ import DtoGetUsageAnalyticsResponse from '../model/DtoGetUsageAnalyticsResponse';
18
20
  import DtoGetUsageByMeterRequest from '../model/DtoGetUsageByMeterRequest';
19
21
  import DtoGetUsageRequest from '../model/DtoGetUsageRequest';
20
22
  import DtoGetUsageResponse from '../model/DtoGetUsageResponse';
@@ -38,6 +40,38 @@ export default class EventsApi {
38
40
  this.apiClient = apiClient || ApiClient.instance;
39
41
  }
40
42
 
43
+ /**
44
+ * Callback function to receive the result of the eventsAnalyticsPost operation.
45
+ * @callback module:api/EventsApi~eventsAnalyticsPostCallback
46
+ * @param {String} error Error message, if any.
47
+ * @param {module:model/DtoGetUsageAnalyticsResponse} data The data returned by the service call.
48
+ * @param {String} response The complete HTTP response.
49
+ */
50
+
51
+ /**
52
+ * Get usage analytics
53
+ * Retrieve comprehensive usage analytics with filtering, grouping, and time-series data
54
+ * @param {module:model/DtoGetUsageAnalyticsRequest} request Request body
55
+ * @param {module:api/EventsApi~eventsAnalyticsPostCallback} callback The callback function, accepting three arguments: error, data, response
56
+ * data is of type: {@link module:model/DtoGetUsageAnalyticsResponse}
57
+ */
58
+ eventsAnalyticsPost(request, callback) {
59
+ let postBody = request;
60
+ // verify the required parameter 'request' is set
61
+ if (request === undefined || request === null) {
62
+ throw new Error("Missing the required parameter 'request' when calling eventsAnalyticsPost");
63
+ }
64
+ let pathParams = {};
65
+ let queryParams = {};
66
+ let headerParams = {};
67
+ let formParams = {};
68
+ let authNames = ['ApiKeyAuth'];
69
+ let contentTypes = [];
70
+ let accepts = ['application/json'];
71
+ let returnType = DtoGetUsageAnalyticsResponse;
72
+ return this.apiClient.callApi('/events/analytics', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
73
+ }
74
+
41
75
  /**
42
76
  * Callback function to receive the result of the eventsBulkPost operation.
43
77
  * @callback module:api/EventsApi~eventsBulkPostCallback
@@ -17,6 +17,7 @@ import DtoFeatureResponse from '../model/DtoFeatureResponse';
17
17
  import DtoListFeaturesResponse from '../model/DtoListFeaturesResponse';
18
18
  import DtoUpdateFeatureRequest from '../model/DtoUpdateFeatureRequest';
19
19
  import ErrorsErrorResponse from '../model/ErrorsErrorResponse';
20
+ import TypesFeatureFilter from '../model/TypesFeatureFilter';
20
21
 
21
22
  /**
22
23
  * Features service.
@@ -53,9 +54,9 @@ export default class FeaturesApi {
53
54
  * @param {Number} [limit]
54
55
  * @param {String} [lookupKey]
55
56
  * @param {Array.<String>} [meterIds]
57
+ * @param {String} [nameContains]
56
58
  * @param {Number} [offset]
57
59
  * @param {module:model/String} [order]
58
- * @param {String} [sort]
59
60
  * @param {String} [startTime]
60
61
  * @param {module:model/String} [status]
61
62
  * @param {module:api/FeaturesApi~featuresGetCallback} callback The callback function, accepting three arguments: error, data, response
@@ -72,9 +73,9 @@ export default class FeaturesApi {
72
73
  'limit': opts['limit'],
73
74
  'lookup_key': opts['lookupKey'],
74
75
  'meter_ids': this.apiClient.buildCollectionParam(opts['meterIds'], 'csv'),
76
+ 'name_contains': opts['nameContains'],
75
77
  'offset': opts['offset'],
76
78
  'order': opts['order'],
77
- 'sort': opts['sort'],
78
79
  'start_time': opts['startTime'],
79
80
  'status': opts['status']
80
81
  };
@@ -227,4 +228,36 @@ export default class FeaturesApi {
227
228
  let returnType = DtoFeatureResponse;
228
229
  return this.apiClient.callApi('/features', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
229
230
  }
231
+
232
+ /**
233
+ * Callback function to receive the result of the featuresSearchPost operation.
234
+ * @callback module:api/FeaturesApi~featuresSearchPostCallback
235
+ * @param {String} error Error message, if any.
236
+ * @param {module:model/DtoListFeaturesResponse} data The data returned by the service call.
237
+ * @param {String} response The complete HTTP response.
238
+ */
239
+
240
+ /**
241
+ * List features by filter
242
+ * List features by filter
243
+ * @param {module:model/TypesFeatureFilter} filter Filter
244
+ * @param {module:api/FeaturesApi~featuresSearchPostCallback} callback The callback function, accepting three arguments: error, data, response
245
+ * data is of type: {@link module:model/DtoListFeaturesResponse}
246
+ */
247
+ featuresSearchPost(filter, callback) {
248
+ let postBody = filter;
249
+ // verify the required parameter 'filter' is set
250
+ if (filter === undefined || filter === null) {
251
+ throw new Error("Missing the required parameter 'filter' when calling featuresSearchPost");
252
+ }
253
+ let pathParams = {};
254
+ let queryParams = {};
255
+ let headerParams = {};
256
+ let formParams = {};
257
+ let authNames = ['ApiKeyAuth'];
258
+ let contentTypes = ['application/json'];
259
+ let accepts = ['application/json'];
260
+ let returnType = DtoListFeaturesResponse;
261
+ return this.apiClient.callApi('/features/search', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
262
+ }
230
263
  }
package/dist/index.js CHANGED
@@ -52,6 +52,8 @@ import DtoFeatureUsageSummary from './model/DtoFeatureUsageSummary';
52
52
  import DtoGetEventsRequest from './model/DtoGetEventsRequest';
53
53
  import DtoGetEventsResponse from './model/DtoGetEventsResponse';
54
54
  import DtoGetPreviewInvoiceRequest from './model/DtoGetPreviewInvoiceRequest';
55
+ import DtoGetUsageAnalyticsRequest from './model/DtoGetUsageAnalyticsRequest';
56
+ import DtoGetUsageAnalyticsResponse from './model/DtoGetUsageAnalyticsResponse';
55
57
  import DtoGetUsageByMeterRequest from './model/DtoGetUsageByMeterRequest';
56
58
  import DtoGetUsageBySubscriptionRequest from './model/DtoGetUsageBySubscriptionRequest';
57
59
  import DtoGetUsageBySubscriptionResponse from './model/DtoGetUsageBySubscriptionResponse';
@@ -105,6 +107,8 @@ import DtoUpdatePriceRequest from './model/DtoUpdatePriceRequest';
105
107
  import DtoUpdateTaskStatusRequest from './model/DtoUpdateTaskStatusRequest';
106
108
  import DtoUpdateTenantRequest from './model/DtoUpdateTenantRequest';
107
109
  import DtoUpdateWalletRequest from './model/DtoUpdateWalletRequest';
110
+ import DtoUsageAnalyticItem from './model/DtoUsageAnalyticItem';
111
+ import DtoUsageAnalyticPoint from './model/DtoUsageAnalyticPoint';
108
112
  import DtoUsageResult from './model/DtoUsageResult';
109
113
  import DtoUserResponse from './model/DtoUserResponse';
110
114
  import DtoWalletBalanceResponse from './model/DtoWalletBalanceResponse';
@@ -112,6 +116,7 @@ import DtoWalletResponse from './model/DtoWalletResponse';
112
116
  import DtoWalletTransactionResponse from './model/DtoWalletTransactionResponse';
113
117
  import ErrorsErrorDetail from './model/ErrorsErrorDetail';
114
118
  import ErrorsErrorResponse from './model/ErrorsErrorResponse';
119
+ import GithubComFlexpriceFlexpriceInternalTypesValue from './model/GithubComFlexpriceFlexpriceInternalTypesValue';
115
120
  import MeterAggregation from './model/MeterAggregation';
116
121
  import MeterFilter from './model/MeterFilter';
117
122
  import PriceJSONBTransformQuantity from './model/PriceJSONBTransformQuantity';
@@ -127,9 +132,14 @@ import TypesBillingCycle from './model/TypesBillingCycle';
127
132
  import TypesBillingModel from './model/TypesBillingModel';
128
133
  import TypesBillingPeriod from './model/TypesBillingPeriod';
129
134
  import TypesBillingTier from './model/TypesBillingTier';
135
+ import TypesCustomerFilter from './model/TypesCustomerFilter';
136
+ import TypesDataType from './model/TypesDataType';
130
137
  import TypesEntityType from './model/TypesEntityType';
138
+ import TypesFeatureFilter from './model/TypesFeatureFilter';
131
139
  import TypesFeatureType from './model/TypesFeatureType';
132
140
  import TypesFileType from './model/TypesFileType';
141
+ import TypesFilterCondition from './model/TypesFilterCondition';
142
+ import TypesFilterOperatorType from './model/TypesFilterOperatorType';
133
143
  import TypesInvoiceBillingReason from './model/TypesInvoiceBillingReason';
134
144
  import TypesInvoiceCadence from './model/TypesInvoiceCadence';
135
145
  import TypesInvoiceStatus from './model/TypesInvoiceStatus';
@@ -145,6 +155,8 @@ import TypesResetUsage from './model/TypesResetUsage';
145
155
  import TypesResumeMode from './model/TypesResumeMode';
146
156
  import TypesSecretProvider from './model/TypesSecretProvider';
147
157
  import TypesSecretType from './model/TypesSecretType';
158
+ import TypesSortCondition from './model/TypesSortCondition';
159
+ import TypesSortDirection from './model/TypesSortDirection';
148
160
  import TypesStatus from './model/TypesStatus';
149
161
  import TypesSubscriptionStatus from './model/TypesSubscriptionStatus';
150
162
  import TypesTaskStatus from './model/TypesTaskStatus';
@@ -413,6 +425,16 @@ DtoGetEventsResponse,
413
425
  * @property {module:model/DtoGetPreviewInvoiceRequest}
414
426
  */
415
427
  DtoGetPreviewInvoiceRequest,
428
+ /**
429
+ * The DtoGetUsageAnalyticsRequest model constructor.
430
+ * @property {module:model/DtoGetUsageAnalyticsRequest}
431
+ */
432
+ DtoGetUsageAnalyticsRequest,
433
+ /**
434
+ * The DtoGetUsageAnalyticsResponse model constructor.
435
+ * @property {module:model/DtoGetUsageAnalyticsResponse}
436
+ */
437
+ DtoGetUsageAnalyticsResponse,
416
438
  /**
417
439
  * The DtoGetUsageByMeterRequest model constructor.
418
440
  * @property {module:model/DtoGetUsageByMeterRequest}
@@ -678,6 +700,16 @@ DtoUpdateTenantRequest,
678
700
  * @property {module:model/DtoUpdateWalletRequest}
679
701
  */
680
702
  DtoUpdateWalletRequest,
703
+ /**
704
+ * The DtoUsageAnalyticItem model constructor.
705
+ * @property {module:model/DtoUsageAnalyticItem}
706
+ */
707
+ DtoUsageAnalyticItem,
708
+ /**
709
+ * The DtoUsageAnalyticPoint model constructor.
710
+ * @property {module:model/DtoUsageAnalyticPoint}
711
+ */
712
+ DtoUsageAnalyticPoint,
681
713
  /**
682
714
  * The DtoUsageResult model constructor.
683
715
  * @property {module:model/DtoUsageResult}
@@ -713,6 +745,11 @@ ErrorsErrorDetail,
713
745
  * @property {module:model/ErrorsErrorResponse}
714
746
  */
715
747
  ErrorsErrorResponse,
748
+ /**
749
+ * The GithubComFlexpriceFlexpriceInternalTypesValue model constructor.
750
+ * @property {module:model/GithubComFlexpriceFlexpriceInternalTypesValue}
751
+ */
752
+ GithubComFlexpriceFlexpriceInternalTypesValue,
716
753
  /**
717
754
  * The MeterAggregation model constructor.
718
755
  * @property {module:model/MeterAggregation}
@@ -788,11 +825,26 @@ TypesBillingPeriod,
788
825
  * @property {module:model/TypesBillingTier}
789
826
  */
790
827
  TypesBillingTier,
828
+ /**
829
+ * The TypesCustomerFilter model constructor.
830
+ * @property {module:model/TypesCustomerFilter}
831
+ */
832
+ TypesCustomerFilter,
833
+ /**
834
+ * The TypesDataType model constructor.
835
+ * @property {module:model/TypesDataType}
836
+ */
837
+ TypesDataType,
791
838
  /**
792
839
  * The TypesEntityType model constructor.
793
840
  * @property {module:model/TypesEntityType}
794
841
  */
795
842
  TypesEntityType,
843
+ /**
844
+ * The TypesFeatureFilter model constructor.
845
+ * @property {module:model/TypesFeatureFilter}
846
+ */
847
+ TypesFeatureFilter,
796
848
  /**
797
849
  * The TypesFeatureType model constructor.
798
850
  * @property {module:model/TypesFeatureType}
@@ -803,6 +855,16 @@ TypesFeatureType,
803
855
  * @property {module:model/TypesFileType}
804
856
  */
805
857
  TypesFileType,
858
+ /**
859
+ * The TypesFilterCondition model constructor.
860
+ * @property {module:model/TypesFilterCondition}
861
+ */
862
+ TypesFilterCondition,
863
+ /**
864
+ * The TypesFilterOperatorType model constructor.
865
+ * @property {module:model/TypesFilterOperatorType}
866
+ */
867
+ TypesFilterOperatorType,
806
868
  /**
807
869
  * The TypesInvoiceBillingReason model constructor.
808
870
  * @property {module:model/TypesInvoiceBillingReason}
@@ -878,6 +940,16 @@ TypesSecretProvider,
878
940
  * @property {module:model/TypesSecretType}
879
941
  */
880
942
  TypesSecretType,
943
+ /**
944
+ * The TypesSortCondition model constructor.
945
+ * @property {module:model/TypesSortCondition}
946
+ */
947
+ TypesSortCondition,
948
+ /**
949
+ * The TypesSortDirection model constructor.
950
+ * @property {module:model/TypesSortDirection}
951
+ */
952
+ TypesSortDirection,
881
953
  /**
882
954
  * The TypesStatus model constructor.
883
955
  * @property {module:model/TypesStatus}
@@ -0,0 +1,156 @@
1
+ /**
2
+ * FlexPrice API
3
+ * FlexPrice API Service
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ *
12
+ */
13
+
14
+ import ApiClient from '../ApiClient';
15
+
16
+ /**
17
+ * The DtoGetUsageAnalyticsRequest model module.
18
+ * @module model/DtoGetUsageAnalyticsRequest
19
+ * @version 1.0
20
+ */
21
+ class DtoGetUsageAnalyticsRequest {
22
+ /**
23
+ * Constructs a new <code>DtoGetUsageAnalyticsRequest</code>.
24
+ * @alias module:model/DtoGetUsageAnalyticsRequest
25
+ * @param externalCustomerId {String}
26
+ */
27
+ constructor(externalCustomerId) {
28
+ DtoGetUsageAnalyticsRequest.initialize(this, externalCustomerId);
29
+ }
30
+
31
+ /**
32
+ * Initializes the fields of this object.
33
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
34
+ * Only for internal use.
35
+ */
36
+ static initialize(obj, externalCustomerId) {
37
+ obj['external_customer_id'] = externalCustomerId;
38
+ }
39
+
40
+ /**
41
+ * Constructs a <code>DtoGetUsageAnalyticsRequest</code> from a plain JavaScript object, optionally creating a new instance.
42
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
43
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
44
+ * @param {module:model/DtoGetUsageAnalyticsRequest} obj Optional instance to populate.
45
+ * @return {module:model/DtoGetUsageAnalyticsRequest} The populated <code>DtoGetUsageAnalyticsRequest</code> instance.
46
+ */
47
+ static constructFromObject(data, obj) {
48
+ if (data) {
49
+ obj = obj || new DtoGetUsageAnalyticsRequest();
50
+ if (data.hasOwnProperty('end_time')) {
51
+ obj['end_time'] = ApiClient.convertToType(data['end_time'], 'String');
52
+ }
53
+ if (data.hasOwnProperty('external_customer_id')) {
54
+ obj['external_customer_id'] = ApiClient.convertToType(data['external_customer_id'], 'String');
55
+ }
56
+ if (data.hasOwnProperty('feature_ids')) {
57
+ obj['feature_ids'] = ApiClient.convertToType(data['feature_ids'], ['String']);
58
+ }
59
+ if (data.hasOwnProperty('group_by')) {
60
+ obj['group_by'] = ApiClient.convertToType(data['group_by'], ['String']);
61
+ }
62
+ if (data.hasOwnProperty('sources')) {
63
+ obj['sources'] = ApiClient.convertToType(data['sources'], ['String']);
64
+ }
65
+ if (data.hasOwnProperty('start_time')) {
66
+ obj['start_time'] = ApiClient.convertToType(data['start_time'], 'String');
67
+ }
68
+ if (data.hasOwnProperty('window_size')) {
69
+ obj['window_size'] = ApiClient.convertToType(data['window_size'], 'String');
70
+ }
71
+ }
72
+ return obj;
73
+ }
74
+
75
+ /**
76
+ * Validates the JSON data with respect to <code>DtoGetUsageAnalyticsRequest</code>.
77
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
78
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DtoGetUsageAnalyticsRequest</code>.
79
+ */
80
+ static validateJSON(data) {
81
+ // check to make sure all required properties are present in the JSON string
82
+ for (const property of DtoGetUsageAnalyticsRequest.RequiredProperties) {
83
+ if (!data.hasOwnProperty(property)) {
84
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
85
+ }
86
+ }
87
+ // ensure the json data is a string
88
+ if (data['end_time'] && !(typeof data['end_time'] === 'string' || data['end_time'] instanceof String)) {
89
+ throw new Error("Expected the field `end_time` to be a primitive type in the JSON string but got " + data['end_time']);
90
+ }
91
+ // ensure the json data is a string
92
+ if (data['external_customer_id'] && !(typeof data['external_customer_id'] === 'string' || data['external_customer_id'] instanceof String)) {
93
+ throw new Error("Expected the field `external_customer_id` to be a primitive type in the JSON string but got " + data['external_customer_id']);
94
+ }
95
+ // ensure the json data is an array
96
+ if (!Array.isArray(data['feature_ids'])) {
97
+ throw new Error("Expected the field `feature_ids` to be an array in the JSON data but got " + data['feature_ids']);
98
+ }
99
+ // ensure the json data is an array
100
+ if (!Array.isArray(data['group_by'])) {
101
+ throw new Error("Expected the field `group_by` to be an array in the JSON data but got " + data['group_by']);
102
+ }
103
+ // ensure the json data is an array
104
+ if (!Array.isArray(data['sources'])) {
105
+ throw new Error("Expected the field `sources` to be an array in the JSON data but got " + data['sources']);
106
+ }
107
+ // ensure the json data is a string
108
+ if (data['start_time'] && !(typeof data['start_time'] === 'string' || data['start_time'] instanceof String)) {
109
+ throw new Error("Expected the field `start_time` to be a primitive type in the JSON string but got " + data['start_time']);
110
+ }
111
+ // ensure the json data is a string
112
+ if (data['window_size'] && !(typeof data['window_size'] === 'string' || data['window_size'] instanceof String)) {
113
+ throw new Error("Expected the field `window_size` to be a primitive type in the JSON string but got " + data['window_size']);
114
+ }
115
+ return true;
116
+ }
117
+ }
118
+ DtoGetUsageAnalyticsRequest.RequiredProperties = ["external_customer_id"];
119
+
120
+ /**
121
+ * @member {String} end_time
122
+ */
123
+ DtoGetUsageAnalyticsRequest.prototype['end_time'] = undefined;
124
+
125
+ /**
126
+ * @member {String} external_customer_id
127
+ */
128
+ DtoGetUsageAnalyticsRequest.prototype['external_customer_id'] = undefined;
129
+
130
+ /**
131
+ * @member {Array.<String>} feature_ids
132
+ */
133
+ DtoGetUsageAnalyticsRequest.prototype['feature_ids'] = undefined;
134
+
135
+ /**
136
+ * allowed values: \"source\", \"feature_id\"
137
+ * @member {Array.<String>} group_by
138
+ */
139
+ DtoGetUsageAnalyticsRequest.prototype['group_by'] = undefined;
140
+
141
+ /**
142
+ * @member {Array.<String>} sources
143
+ */
144
+ DtoGetUsageAnalyticsRequest.prototype['sources'] = undefined;
145
+
146
+ /**
147
+ * @member {String} start_time
148
+ */
149
+ DtoGetUsageAnalyticsRequest.prototype['start_time'] = undefined;
150
+
151
+ /**
152
+ * e.g., \"MINUTE\", \"HOUR\", \"DAY\"
153
+ * @member {String} window_size
154
+ */
155
+ DtoGetUsageAnalyticsRequest.prototype['window_size'] = undefined;
156
+ export default DtoGetUsageAnalyticsRequest;
@@ -0,0 +1,101 @@
1
+ /**
2
+ * FlexPrice API
3
+ * FlexPrice API Service
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ *
12
+ */
13
+
14
+ import ApiClient from '../ApiClient';
15
+ import DtoUsageAnalyticItem from './DtoUsageAnalyticItem';
16
+
17
+ /**
18
+ * The DtoGetUsageAnalyticsResponse model module.
19
+ * @module model/DtoGetUsageAnalyticsResponse
20
+ * @version 1.0
21
+ */
22
+ class DtoGetUsageAnalyticsResponse {
23
+ /**
24
+ * Constructs a new <code>DtoGetUsageAnalyticsResponse</code>.
25
+ * @alias module:model/DtoGetUsageAnalyticsResponse
26
+ */
27
+ constructor() {
28
+ DtoGetUsageAnalyticsResponse.initialize(this);
29
+ }
30
+
31
+ /**
32
+ * Initializes the fields of this object.
33
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
34
+ * Only for internal use.
35
+ */
36
+ static initialize(obj) {}
37
+
38
+ /**
39
+ * Constructs a <code>DtoGetUsageAnalyticsResponse</code> from a plain JavaScript object, optionally creating a new instance.
40
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
41
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
42
+ * @param {module:model/DtoGetUsageAnalyticsResponse} obj Optional instance to populate.
43
+ * @return {module:model/DtoGetUsageAnalyticsResponse} The populated <code>DtoGetUsageAnalyticsResponse</code> instance.
44
+ */
45
+ static constructFromObject(data, obj) {
46
+ if (data) {
47
+ obj = obj || new DtoGetUsageAnalyticsResponse();
48
+ if (data.hasOwnProperty('currency')) {
49
+ obj['currency'] = ApiClient.convertToType(data['currency'], 'String');
50
+ }
51
+ if (data.hasOwnProperty('items')) {
52
+ obj['items'] = ApiClient.convertToType(data['items'], [DtoUsageAnalyticItem]);
53
+ }
54
+ if (data.hasOwnProperty('total_cost')) {
55
+ obj['total_cost'] = ApiClient.convertToType(data['total_cost'], 'Number');
56
+ }
57
+ }
58
+ return obj;
59
+ }
60
+
61
+ /**
62
+ * Validates the JSON data with respect to <code>DtoGetUsageAnalyticsResponse</code>.
63
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
64
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DtoGetUsageAnalyticsResponse</code>.
65
+ */
66
+ static validateJSON(data) {
67
+ // ensure the json data is a string
68
+ if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) {
69
+ throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']);
70
+ }
71
+ if (data['items']) {
72
+ // data not null
73
+ // ensure the json data is an array
74
+ if (!Array.isArray(data['items'])) {
75
+ throw new Error("Expected the field `items` to be an array in the JSON data but got " + data['items']);
76
+ }
77
+ // validate the optional field `items` (array)
78
+ for (const item of data['items']) {
79
+ DtoUsageAnalyticItem.validateJSON(item);
80
+ }
81
+ ;
82
+ }
83
+ return true;
84
+ }
85
+ }
86
+
87
+ /**
88
+ * @member {String} currency
89
+ */
90
+ DtoGetUsageAnalyticsResponse.prototype['currency'] = undefined;
91
+
92
+ /**
93
+ * @member {Array.<module:model/DtoUsageAnalyticItem>} items
94
+ */
95
+ DtoGetUsageAnalyticsResponse.prototype['items'] = undefined;
96
+
97
+ /**
98
+ * @member {Number} total_cost
99
+ */
100
+ DtoGetUsageAnalyticsResponse.prototype['total_cost'] = undefined;
101
+ export default DtoGetUsageAnalyticsResponse;