@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.
- package/dist/api/CustomersApi.js +33 -2
- package/dist/api/EventsApi.js +34 -0
- package/dist/api/FeaturesApi.js +35 -2
- package/dist/index.js +72 -0
- package/dist/model/DtoGetUsageAnalyticsRequest.js +156 -0
- package/dist/model/DtoGetUsageAnalyticsResponse.js +101 -0
- package/dist/model/DtoUsageAnalyticItem.js +190 -0
- package/dist/model/DtoUsageAnalyticPoint.js +88 -0
- package/dist/model/GithubComFlexpriceFlexpriceInternalTypesValue.js +112 -0
- package/dist/model/TypesCustomerFilter.js +230 -0
- package/dist/model/TypesDataType.js +53 -0
- package/dist/model/TypesFeatureFilter.js +243 -0
- package/dist/model/TypesFilterCondition.js +104 -0
- package/dist/model/TypesFilterOperatorType.js +77 -0
- package/dist/model/TypesSortCondition.js +81 -0
- package/dist/model/TypesSortDirection.js +41 -0
- package/package.json +1 -1
|
@@ -0,0 +1,243 @@
|
|
|
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 TypesFilterCondition from './TypesFilterCondition';
|
|
16
|
+
import TypesSortCondition from './TypesSortCondition';
|
|
17
|
+
import TypesStatus from './TypesStatus';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The TypesFeatureFilter model module.
|
|
21
|
+
* @module model/TypesFeatureFilter
|
|
22
|
+
* @version 1.0
|
|
23
|
+
*/
|
|
24
|
+
class TypesFeatureFilter {
|
|
25
|
+
/**
|
|
26
|
+
* Constructs a new <code>TypesFeatureFilter</code>.
|
|
27
|
+
* @alias module:model/TypesFeatureFilter
|
|
28
|
+
*/
|
|
29
|
+
constructor() {
|
|
30
|
+
TypesFeatureFilter.initialize(this);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Initializes the fields of this object.
|
|
35
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
36
|
+
* Only for internal use.
|
|
37
|
+
*/
|
|
38
|
+
static initialize(obj) {}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Constructs a <code>TypesFeatureFilter</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/TypesFeatureFilter} obj Optional instance to populate.
|
|
45
|
+
* @return {module:model/TypesFeatureFilter} The populated <code>TypesFeatureFilter</code> instance.
|
|
46
|
+
*/
|
|
47
|
+
static constructFromObject(data, obj) {
|
|
48
|
+
if (data) {
|
|
49
|
+
obj = obj || new TypesFeatureFilter();
|
|
50
|
+
if (data.hasOwnProperty('end_time')) {
|
|
51
|
+
obj['end_time'] = ApiClient.convertToType(data['end_time'], 'String');
|
|
52
|
+
}
|
|
53
|
+
if (data.hasOwnProperty('expand')) {
|
|
54
|
+
obj['expand'] = ApiClient.convertToType(data['expand'], 'String');
|
|
55
|
+
}
|
|
56
|
+
if (data.hasOwnProperty('feature_ids')) {
|
|
57
|
+
obj['feature_ids'] = ApiClient.convertToType(data['feature_ids'], ['String']);
|
|
58
|
+
}
|
|
59
|
+
if (data.hasOwnProperty('filters')) {
|
|
60
|
+
obj['filters'] = ApiClient.convertToType(data['filters'], [TypesFilterCondition]);
|
|
61
|
+
}
|
|
62
|
+
if (data.hasOwnProperty('limit')) {
|
|
63
|
+
obj['limit'] = ApiClient.convertToType(data['limit'], 'Number');
|
|
64
|
+
}
|
|
65
|
+
if (data.hasOwnProperty('lookup_key')) {
|
|
66
|
+
obj['lookup_key'] = ApiClient.convertToType(data['lookup_key'], 'String');
|
|
67
|
+
}
|
|
68
|
+
if (data.hasOwnProperty('meter_ids')) {
|
|
69
|
+
obj['meter_ids'] = ApiClient.convertToType(data['meter_ids'], ['String']);
|
|
70
|
+
}
|
|
71
|
+
if (data.hasOwnProperty('name_contains')) {
|
|
72
|
+
obj['name_contains'] = ApiClient.convertToType(data['name_contains'], 'String');
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('offset')) {
|
|
75
|
+
obj['offset'] = ApiClient.convertToType(data['offset'], 'Number');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('order')) {
|
|
78
|
+
obj['order'] = ApiClient.convertToType(data['order'], 'String');
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('sort')) {
|
|
81
|
+
obj['sort'] = ApiClient.convertToType(data['sort'], [TypesSortCondition]);
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('start_time')) {
|
|
84
|
+
obj['start_time'] = ApiClient.convertToType(data['start_time'], 'String');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('status')) {
|
|
87
|
+
obj['status'] = TypesStatus.constructFromObject(data['status']);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Validates the JSON data with respect to <code>TypesFeatureFilter</code>.
|
|
95
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
96
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TypesFeatureFilter</code>.
|
|
97
|
+
*/
|
|
98
|
+
static validateJSON(data) {
|
|
99
|
+
// ensure the json data is a string
|
|
100
|
+
if (data['end_time'] && !(typeof data['end_time'] === 'string' || data['end_time'] instanceof String)) {
|
|
101
|
+
throw new Error("Expected the field `end_time` to be a primitive type in the JSON string but got " + data['end_time']);
|
|
102
|
+
}
|
|
103
|
+
// ensure the json data is a string
|
|
104
|
+
if (data['expand'] && !(typeof data['expand'] === 'string' || data['expand'] instanceof String)) {
|
|
105
|
+
throw new Error("Expected the field `expand` to be a primitive type in the JSON string but got " + data['expand']);
|
|
106
|
+
}
|
|
107
|
+
// ensure the json data is an array
|
|
108
|
+
if (!Array.isArray(data['feature_ids'])) {
|
|
109
|
+
throw new Error("Expected the field `feature_ids` to be an array in the JSON data but got " + data['feature_ids']);
|
|
110
|
+
}
|
|
111
|
+
if (data['filters']) {
|
|
112
|
+
// data not null
|
|
113
|
+
// ensure the json data is an array
|
|
114
|
+
if (!Array.isArray(data['filters'])) {
|
|
115
|
+
throw new Error("Expected the field `filters` to be an array in the JSON data but got " + data['filters']);
|
|
116
|
+
}
|
|
117
|
+
// validate the optional field `filters` (array)
|
|
118
|
+
for (const item of data['filters']) {
|
|
119
|
+
TypesFilterCondition.validateJSON(item);
|
|
120
|
+
}
|
|
121
|
+
;
|
|
122
|
+
}
|
|
123
|
+
// ensure the json data is a string
|
|
124
|
+
if (data['lookup_key'] && !(typeof data['lookup_key'] === 'string' || data['lookup_key'] instanceof String)) {
|
|
125
|
+
throw new Error("Expected the field `lookup_key` to be a primitive type in the JSON string but got " + data['lookup_key']);
|
|
126
|
+
}
|
|
127
|
+
// ensure the json data is an array
|
|
128
|
+
if (!Array.isArray(data['meter_ids'])) {
|
|
129
|
+
throw new Error("Expected the field `meter_ids` to be an array in the JSON data but got " + data['meter_ids']);
|
|
130
|
+
}
|
|
131
|
+
// ensure the json data is a string
|
|
132
|
+
if (data['name_contains'] && !(typeof data['name_contains'] === 'string' || data['name_contains'] instanceof String)) {
|
|
133
|
+
throw new Error("Expected the field `name_contains` to be a primitive type in the JSON string but got " + data['name_contains']);
|
|
134
|
+
}
|
|
135
|
+
// ensure the json data is a string
|
|
136
|
+
if (data['order'] && !(typeof data['order'] === 'string' || data['order'] instanceof String)) {
|
|
137
|
+
throw new Error("Expected the field `order` to be a primitive type in the JSON string but got " + data['order']);
|
|
138
|
+
}
|
|
139
|
+
if (data['sort']) {
|
|
140
|
+
// data not null
|
|
141
|
+
// ensure the json data is an array
|
|
142
|
+
if (!Array.isArray(data['sort'])) {
|
|
143
|
+
throw new Error("Expected the field `sort` to be an array in the JSON data but got " + data['sort']);
|
|
144
|
+
}
|
|
145
|
+
// validate the optional field `sort` (array)
|
|
146
|
+
for (const item of data['sort']) {
|
|
147
|
+
TypesSortCondition.validateJSON(item);
|
|
148
|
+
}
|
|
149
|
+
;
|
|
150
|
+
}
|
|
151
|
+
// ensure the json data is a string
|
|
152
|
+
if (data['start_time'] && !(typeof data['start_time'] === 'string' || data['start_time'] instanceof String)) {
|
|
153
|
+
throw new Error("Expected the field `start_time` to be a primitive type in the JSON string but got " + data['start_time']);
|
|
154
|
+
}
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @member {String} end_time
|
|
161
|
+
*/
|
|
162
|
+
TypesFeatureFilter.prototype['end_time'] = undefined;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @member {String} expand
|
|
166
|
+
*/
|
|
167
|
+
TypesFeatureFilter.prototype['expand'] = undefined;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Feature specific filters
|
|
171
|
+
* @member {Array.<String>} feature_ids
|
|
172
|
+
*/
|
|
173
|
+
TypesFeatureFilter.prototype['feature_ids'] = undefined;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* filters allows complex filtering based on multiple fields
|
|
177
|
+
* @member {Array.<module:model/TypesFilterCondition>} filters
|
|
178
|
+
*/
|
|
179
|
+
TypesFeatureFilter.prototype['filters'] = undefined;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @member {Number} limit
|
|
183
|
+
*/
|
|
184
|
+
TypesFeatureFilter.prototype['limit'] = undefined;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @member {String} lookup_key
|
|
188
|
+
*/
|
|
189
|
+
TypesFeatureFilter.prototype['lookup_key'] = undefined;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @member {Array.<String>} meter_ids
|
|
193
|
+
*/
|
|
194
|
+
TypesFeatureFilter.prototype['meter_ids'] = undefined;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @member {String} name_contains
|
|
198
|
+
*/
|
|
199
|
+
TypesFeatureFilter.prototype['name_contains'] = undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @member {Number} offset
|
|
203
|
+
*/
|
|
204
|
+
TypesFeatureFilter.prototype['offset'] = undefined;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @member {module:model/TypesFeatureFilter.OrderEnum} order
|
|
208
|
+
*/
|
|
209
|
+
TypesFeatureFilter.prototype['order'] = undefined;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @member {Array.<module:model/TypesSortCondition>} sort
|
|
213
|
+
*/
|
|
214
|
+
TypesFeatureFilter.prototype['sort'] = undefined;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @member {String} start_time
|
|
218
|
+
*/
|
|
219
|
+
TypesFeatureFilter.prototype['start_time'] = undefined;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @member {module:model/TypesStatus} status
|
|
223
|
+
*/
|
|
224
|
+
TypesFeatureFilter.prototype['status'] = undefined;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Allowed values for the <code>order</code> property.
|
|
228
|
+
* @enum {String}
|
|
229
|
+
* @readonly
|
|
230
|
+
*/
|
|
231
|
+
TypesFeatureFilter['OrderEnum'] = {
|
|
232
|
+
/**
|
|
233
|
+
* value: "asc"
|
|
234
|
+
* @const
|
|
235
|
+
*/
|
|
236
|
+
"asc": "asc",
|
|
237
|
+
/**
|
|
238
|
+
* value: "desc"
|
|
239
|
+
* @const
|
|
240
|
+
*/
|
|
241
|
+
"desc": "desc"
|
|
242
|
+
};
|
|
243
|
+
export default TypesFeatureFilter;
|
|
@@ -0,0 +1,104 @@
|
|
|
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 GithubComFlexpriceFlexpriceInternalTypesValue from './GithubComFlexpriceFlexpriceInternalTypesValue';
|
|
16
|
+
import TypesDataType from './TypesDataType';
|
|
17
|
+
import TypesFilterOperatorType from './TypesFilterOperatorType';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The TypesFilterCondition model module.
|
|
21
|
+
* @module model/TypesFilterCondition
|
|
22
|
+
* @version 1.0
|
|
23
|
+
*/
|
|
24
|
+
class TypesFilterCondition {
|
|
25
|
+
/**
|
|
26
|
+
* Constructs a new <code>TypesFilterCondition</code>.
|
|
27
|
+
* @alias module:model/TypesFilterCondition
|
|
28
|
+
*/
|
|
29
|
+
constructor() {
|
|
30
|
+
TypesFilterCondition.initialize(this);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Initializes the fields of this object.
|
|
35
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
36
|
+
* Only for internal use.
|
|
37
|
+
*/
|
|
38
|
+
static initialize(obj) {}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Constructs a <code>TypesFilterCondition</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/TypesFilterCondition} obj Optional instance to populate.
|
|
45
|
+
* @return {module:model/TypesFilterCondition} The populated <code>TypesFilterCondition</code> instance.
|
|
46
|
+
*/
|
|
47
|
+
static constructFromObject(data, obj) {
|
|
48
|
+
if (data) {
|
|
49
|
+
obj = obj || new TypesFilterCondition();
|
|
50
|
+
if (data.hasOwnProperty('data_type')) {
|
|
51
|
+
obj['data_type'] = TypesDataType.constructFromObject(data['data_type']);
|
|
52
|
+
}
|
|
53
|
+
if (data.hasOwnProperty('field')) {
|
|
54
|
+
obj['field'] = ApiClient.convertToType(data['field'], 'String');
|
|
55
|
+
}
|
|
56
|
+
if (data.hasOwnProperty('operator')) {
|
|
57
|
+
obj['operator'] = TypesFilterOperatorType.constructFromObject(data['operator']);
|
|
58
|
+
}
|
|
59
|
+
if (data.hasOwnProperty('value')) {
|
|
60
|
+
obj['value'] = GithubComFlexpriceFlexpriceInternalTypesValue.constructFromObject(data['value']);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return obj;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Validates the JSON data with respect to <code>TypesFilterCondition</code>.
|
|
68
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
69
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TypesFilterCondition</code>.
|
|
70
|
+
*/
|
|
71
|
+
static validateJSON(data) {
|
|
72
|
+
// ensure the json data is a string
|
|
73
|
+
if (data['field'] && !(typeof data['field'] === 'string' || data['field'] instanceof String)) {
|
|
74
|
+
throw new Error("Expected the field `field` to be a primitive type in the JSON string but got " + data['field']);
|
|
75
|
+
}
|
|
76
|
+
// validate the optional field `value`
|
|
77
|
+
if (data['value']) {
|
|
78
|
+
// data not null
|
|
79
|
+
GithubComFlexpriceFlexpriceInternalTypesValue.validateJSON(data['value']);
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @member {module:model/TypesDataType} data_type
|
|
87
|
+
*/
|
|
88
|
+
TypesFilterCondition.prototype['data_type'] = undefined;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @member {String} field
|
|
92
|
+
*/
|
|
93
|
+
TypesFilterCondition.prototype['field'] = undefined;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @member {module:model/TypesFilterOperatorType} operator
|
|
97
|
+
*/
|
|
98
|
+
TypesFilterCondition.prototype['operator'] = undefined;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @member {module:model/GithubComFlexpriceFlexpriceInternalTypesValue} value
|
|
102
|
+
*/
|
|
103
|
+
TypesFilterCondition.prototype['value'] = undefined;
|
|
104
|
+
export default TypesFilterCondition;
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
* Enum class TypesFilterOperatorType.
|
|
17
|
+
* @enum {}
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
export default class TypesFilterOperatorType {
|
|
21
|
+
/**
|
|
22
|
+
* value: "eq"
|
|
23
|
+
* @const
|
|
24
|
+
*/
|
|
25
|
+
"EQUAL" = "eq";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* value: "contains"
|
|
29
|
+
* @const
|
|
30
|
+
*/
|
|
31
|
+
"CONTAINS" = "contains";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* value: "gt"
|
|
35
|
+
* @const
|
|
36
|
+
*/
|
|
37
|
+
"GREATER_THAN" = "gt";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* value: "lt"
|
|
41
|
+
* @const
|
|
42
|
+
*/
|
|
43
|
+
"LESS_THAN" = "lt";
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* value: "in"
|
|
47
|
+
* @const
|
|
48
|
+
*/
|
|
49
|
+
"IN" = "in";
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* value: "not_in"
|
|
53
|
+
* @const
|
|
54
|
+
*/
|
|
55
|
+
"NOT_IN" = "not_in";
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* value: "before"
|
|
59
|
+
* @const
|
|
60
|
+
*/
|
|
61
|
+
"BEFORE" = "before";
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* value: "after"
|
|
65
|
+
* @const
|
|
66
|
+
*/
|
|
67
|
+
"AFTER" = "after";
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Returns a <code>TypesFilterOperatorType</code> enum value from a Javascript object name.
|
|
71
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
72
|
+
* @return {module:model/TypesFilterOperatorType} The enum <code>TypesFilterOperatorType</code> value.
|
|
73
|
+
*/
|
|
74
|
+
static constructFromObject(object) {
|
|
75
|
+
return object;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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 TypesSortDirection from './TypesSortDirection';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The TypesSortCondition model module.
|
|
19
|
+
* @module model/TypesSortCondition
|
|
20
|
+
* @version 1.0
|
|
21
|
+
*/
|
|
22
|
+
class TypesSortCondition {
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a new <code>TypesSortCondition</code>.
|
|
25
|
+
* @alias module:model/TypesSortCondition
|
|
26
|
+
*/
|
|
27
|
+
constructor() {
|
|
28
|
+
TypesSortCondition.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>TypesSortCondition</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/TypesSortCondition} obj Optional instance to populate.
|
|
43
|
+
* @return {module:model/TypesSortCondition} The populated <code>TypesSortCondition</code> instance.
|
|
44
|
+
*/
|
|
45
|
+
static constructFromObject(data, obj) {
|
|
46
|
+
if (data) {
|
|
47
|
+
obj = obj || new TypesSortCondition();
|
|
48
|
+
if (data.hasOwnProperty('direction')) {
|
|
49
|
+
obj['direction'] = TypesSortDirection.constructFromObject(data['direction']);
|
|
50
|
+
}
|
|
51
|
+
if (data.hasOwnProperty('field')) {
|
|
52
|
+
obj['field'] = ApiClient.convertToType(data['field'], 'String');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Validates the JSON data with respect to <code>TypesSortCondition</code>.
|
|
60
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
61
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TypesSortCondition</code>.
|
|
62
|
+
*/
|
|
63
|
+
static validateJSON(data) {
|
|
64
|
+
// ensure the json data is a string
|
|
65
|
+
if (data['field'] && !(typeof data['field'] === 'string' || data['field'] instanceof String)) {
|
|
66
|
+
throw new Error("Expected the field `field` to be a primitive type in the JSON string but got " + data['field']);
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @member {module:model/TypesSortDirection} direction
|
|
74
|
+
*/
|
|
75
|
+
TypesSortCondition.prototype['direction'] = undefined;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @member {String} field
|
|
79
|
+
*/
|
|
80
|
+
TypesSortCondition.prototype['field'] = undefined;
|
|
81
|
+
export default TypesSortCondition;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* Enum class TypesSortDirection.
|
|
17
|
+
* @enum {}
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
export default class TypesSortDirection {
|
|
21
|
+
/**
|
|
22
|
+
* value: "asc"
|
|
23
|
+
* @const
|
|
24
|
+
*/
|
|
25
|
+
"SortDirectionAsc" = "asc";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* value: "desc"
|
|
29
|
+
* @const
|
|
30
|
+
*/
|
|
31
|
+
"SortDirectionDesc" = "desc";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Returns a <code>TypesSortDirection</code> enum value from a Javascript object name.
|
|
35
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
36
|
+
* @return {module:model/TypesSortDirection} The enum <code>TypesSortDirection</code> value.
|
|
37
|
+
*/
|
|
38
|
+
static constructFromObject(object) {
|
|
39
|
+
return object;
|
|
40
|
+
}
|
|
41
|
+
}
|