@flexprice/sdk 1.0.17 → 1.0.28
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 +281 -200
- package/package.json +29 -41
- package/LICENSE +0 -663
- package/dist/ApiClient.js +0 -653
- package/dist/api/AuthApi.js +0 -100
- package/dist/api/CustomersApi.js +0 -376
- package/dist/api/EntitlementsApi.js +0 -267
- package/dist/api/EnvironmentsApi.js +0 -184
- package/dist/api/EventsApi.js +0 -238
- package/dist/api/FeaturesApi.js +0 -263
- package/dist/api/IntegrationsApi.js +0 -169
- package/dist/api/InvoicesApi.js +0 -419
- package/dist/api/PaymentsApi.js +0 -272
- package/dist/api/PlansApi.js +0 -226
- package/dist/api/PricesApi.js +0 -228
- package/dist/api/SecretsApi.js +0 -137
- package/dist/api/SubscriptionsApi.js +0 -353
- package/dist/api/TasksApi.js +0 -232
- package/dist/api/TenantsApi.js +0 -162
- package/dist/api/UsersApi.js +0 -61
- package/dist/api/WalletsApi.js +0 -392
- package/dist/index.js +0 -1102
- package/dist/model/DtoAddress.js +0 -132
- package/dist/model/DtoAggregatedEntitlement.js +0 -106
- package/dist/model/DtoAggregatedFeature.js +0 -109
- package/dist/model/DtoAuthResponse.js +0 -96
- package/dist/model/DtoBillingPeriodInfo.js +0 -97
- package/dist/model/DtoBulkIngestEventRequest.js +0 -91
- package/dist/model/DtoCreateAPIKeyRequest.js +0 -117
- package/dist/model/DtoCreateAPIKeyResponse.js +0 -86
- package/dist/model/DtoCreateCustomerRequest.js +0 -188
- package/dist/model/DtoCreateEntitlementRequest.js +0 -150
- package/dist/model/DtoCreateEnvironmentRequest.js +0 -96
- package/dist/model/DtoCreateFeatureRequest.js +0 -177
- package/dist/model/DtoCreateIntegrationRequest.js +0 -105
- package/dist/model/DtoCreateInvoiceLineItemRequest.js +0 -206
- package/dist/model/DtoCreateInvoiceRequest.js +0 -289
- package/dist/model/DtoCreateMeterRequest.js +0 -144
- package/dist/model/DtoCreatePaymentRequest.js +0 -172
- package/dist/model/DtoCreatePlanEntitlementRequest.js +0 -150
- package/dist/model/DtoCreatePlanPriceRequest.js +0 -279
- package/dist/model/DtoCreatePlanRequest.js +0 -148
- package/dist/model/DtoCreatePriceRequest.js +0 -279
- package/dist/model/DtoCreatePriceTier.js +0 -102
- package/dist/model/DtoCreateSubscriptionRequest.js +0 -223
- package/dist/model/DtoCreateTaskRequest.js +0 -137
- package/dist/model/DtoCreateTenantRequest.js +0 -96
- package/dist/model/DtoCreateWalletRequest.js +0 -205
- package/dist/model/DtoCustomerEntitlementsResponse.js +0 -93
- package/dist/model/DtoCustomerInvoiceSummary.js +0 -148
- package/dist/model/DtoCustomerMultiCurrencyInvoiceSummary.js +0 -105
- package/dist/model/DtoCustomerResponse.js +0 -283
- package/dist/model/DtoCustomerUsageSummaryResponse.js +0 -121
- package/dist/model/DtoEntitlementResponse.js +0 -259
- package/dist/model/DtoEntitlementSource.js +0 -144
- package/dist/model/DtoEnvironmentResponse.js +0 -120
- package/dist/model/DtoEvent.js +0 -154
- package/dist/model/DtoFeatureResponse.js +0 -258
- package/dist/model/DtoFeatureUsageSummary.js +0 -135
- package/dist/model/DtoGetEventsRequest.js +0 -219
- package/dist/model/DtoGetEventsResponse.js +0 -129
- package/dist/model/DtoGetPreviewInvoiceRequest.js +0 -106
- package/dist/model/DtoGetUsageAnalyticsRequest.js +0 -152
- package/dist/model/DtoGetUsageAnalyticsResponse.js +0 -101
- package/dist/model/DtoGetUsageByMeterRequest.js +0 -149
- package/dist/model/DtoGetUsageBySubscriptionRequest.js +0 -114
- package/dist/model/DtoGetUsageBySubscriptionResponse.js +0 -137
- package/dist/model/DtoGetUsageRequest.js +0 -173
- package/dist/model/DtoGetUsageResponse.js +0 -110
- package/dist/model/DtoIngestEventRequest.js +0 -156
- package/dist/model/DtoInvoiceLineItemResponse.js +0 -326
- package/dist/model/DtoInvoiceResponse.js +0 -450
- package/dist/model/DtoLinkedIntegrationsResponse.js +0 -72
- package/dist/model/DtoListCustomersResponse.js +0 -95
- package/dist/model/DtoListEntitlementsResponse.js +0 -95
- package/dist/model/DtoListEnvironmentsResponse.js +0 -105
- package/dist/model/DtoListFeaturesResponse.js +0 -95
- package/dist/model/DtoListInvoicesResponse.js +0 -95
- package/dist/model/DtoListPaymentsResponse.js +0 -95
- package/dist/model/DtoListPlansResponse.js +0 -95
- package/dist/model/DtoListPricesResponse.js +0 -95
- package/dist/model/DtoListSecretsResponse.js +0 -95
- package/dist/model/DtoListSubscriptionPausesResponse.js +0 -89
- package/dist/model/DtoListSubscriptionsResponse.js +0 -95
- package/dist/model/DtoListTasksResponse.js +0 -95
- package/dist/model/DtoListWalletTransactionsResponse.js +0 -95
- package/dist/model/DtoLoginRequest.js +0 -108
- package/dist/model/DtoMeterResponse.js +0 -188
- package/dist/model/DtoPauseSubscriptionRequest.js +0 -141
- package/dist/model/DtoPaymentAttemptResponse.js +0 -174
- package/dist/model/DtoPaymentResponse.js +0 -314
- package/dist/model/DtoPlanResponse.js +0 -231
- package/dist/model/DtoPriceResponse.js +0 -373
- package/dist/model/DtoResumeSubscriptionRequest.js +0 -97
- package/dist/model/DtoSecretResponse.js +0 -183
- package/dist/model/DtoSignUpRequest.js +0 -118
- package/dist/model/DtoSubscriptionPauseResponse.js +0 -283
- package/dist/model/DtoSubscriptionResponse.js +0 -489
- package/dist/model/DtoSubscriptionUsageByMetersResponse.js +0 -148
- package/dist/model/DtoTaskResponse.js +0 -294
- package/dist/model/DtoTenantBillingDetails.js +0 -110
- package/dist/model/DtoTenantBillingUsage.js +0 -95
- package/dist/model/DtoTenantResponse.js +0 -134
- package/dist/model/DtoTopUpWalletRequest.js +0 -148
- package/dist/model/DtoUpdateCustomerRequest.js +0 -178
- package/dist/model/DtoUpdateEntitlementRequest.js +0 -105
- package/dist/model/DtoUpdateEnvironmentRequest.js +0 -84
- package/dist/model/DtoUpdateFeatureRequest.js +0 -139
- package/dist/model/DtoUpdatePaymentRequest.js +0 -82
- package/dist/model/DtoUpdatePaymentStatusRequest.js +0 -87
- package/dist/model/DtoUpdatePlanEntitlementRequest.js +0 -163
- package/dist/model/DtoUpdatePlanPriceRequest.js +0 -292
- package/dist/model/DtoUpdatePlanRequest.js +0 -138
- package/dist/model/DtoUpdatePriceRequest.js +0 -94
- package/dist/model/DtoUpdateTaskStatusRequest.js +0 -79
- package/dist/model/DtoUpdateTenantRequest.js +0 -86
- package/dist/model/DtoUpdateWalletRequest.js +0 -133
- package/dist/model/DtoUsageAnalyticItem.js +0 -190
- package/dist/model/DtoUsageAnalyticPoint.js +0 -88
- package/dist/model/DtoUsageResult.js +0 -80
- package/dist/model/DtoUserResponse.js +0 -98
- package/dist/model/DtoWalletBalanceResponse.js +0 -336
- package/dist/model/DtoWalletResponse.js +0 -235
- package/dist/model/DtoWalletTransactionResponse.js +0 -221
- package/dist/model/ErrorsErrorDetail.js +0 -94
- package/dist/model/ErrorsErrorResponse.js +0 -82
- package/dist/model/GithubComFlexpriceFlexpriceInternalTypesValue.js +0 -112
- package/dist/model/MeterAggregation.js +0 -82
- package/dist/model/MeterFilter.js +0 -86
- package/dist/model/PriceJSONBTransformQuantity.js +0 -82
- package/dist/model/PricePrice.js +0 -359
- package/dist/model/PricePriceTier.js +0 -87
- package/dist/model/PriceTransformQuantity.js +0 -82
- package/dist/model/SubscriptionSubscriptionLineItem.js +0 -338
- package/dist/model/SubscriptionSubscriptionPause.js +0 -283
- package/dist/model/TypesAggregationType.js +0 -53
- package/dist/model/TypesAutoTopupTrigger.js +0 -41
- package/dist/model/TypesBillingCadence.js +0 -41
- package/dist/model/TypesBillingCycle.js +0 -41
- package/dist/model/TypesBillingModel.js +0 -47
- package/dist/model/TypesBillingPeriod.js +0 -65
- package/dist/model/TypesBillingTier.js +0 -41
- package/dist/model/TypesCustomerFilter.js +0 -230
- package/dist/model/TypesDataType.js +0 -53
- package/dist/model/TypesEntityType.js +0 -47
- package/dist/model/TypesFeatureFilter.js +0 -243
- package/dist/model/TypesFeatureType.js +0 -47
- package/dist/model/TypesFileType.js +0 -41
- package/dist/model/TypesFilterCondition.js +0 -104
- package/dist/model/TypesFilterOperatorType.js +0 -77
- package/dist/model/TypesInvoiceBillingReason.js +0 -53
- package/dist/model/TypesInvoiceCadence.js +0 -41
- package/dist/model/TypesInvoiceStatus.js +0 -47
- package/dist/model/TypesInvoiceType.js +0 -47
- package/dist/model/TypesPaginationResponse.js +0 -84
- package/dist/model/TypesPauseMode.js +0 -47
- package/dist/model/TypesPauseStatus.js +0 -59
- package/dist/model/TypesPaymentDestinationType.js +0 -35
- package/dist/model/TypesPaymentMethodType.js +0 -53
- package/dist/model/TypesPaymentStatus.js +0 -65
- package/dist/model/TypesPriceType.js +0 -41
- package/dist/model/TypesResetUsage.js +0 -41
- package/dist/model/TypesResumeMode.js +0 -47
- package/dist/model/TypesSecretProvider.js +0 -47
- package/dist/model/TypesSecretType.js +0 -47
- package/dist/model/TypesSortCondition.js +0 -81
- package/dist/model/TypesSortDirection.js +0 -41
- package/dist/model/TypesStatus.js +0 -47
- package/dist/model/TypesSubscriptionStatus.js +0 -77
- package/dist/model/TypesTaskStatus.js +0 -53
- package/dist/model/TypesTaskType.js +0 -41
- package/dist/model/TypesTransactionReason.js +0 -77
- package/dist/model/TypesTransactionStatus.js +0 -47
- package/dist/model/TypesTransactionType.js +0 -41
- package/dist/model/TypesWalletConfig.js +0 -74
- package/dist/model/TypesWalletConfigPriceType.js +0 -47
- package/dist/model/TypesWalletStatus.js +0 -47
- package/dist/model/TypesWalletTxReferenceType.js +0 -47
- package/dist/model/TypesWalletType.js +0 -41
- package/dist/model/TypesWindowSize.js +0 -83
|
@@ -1,150 +0,0 @@
|
|
|
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 TypesBillingPeriod from './TypesBillingPeriod';
|
|
16
|
-
import TypesFeatureType from './TypesFeatureType';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* The DtoCreatePlanEntitlementRequest model module.
|
|
20
|
-
* @module model/DtoCreatePlanEntitlementRequest
|
|
21
|
-
* @version 1.0
|
|
22
|
-
*/
|
|
23
|
-
class DtoCreatePlanEntitlementRequest {
|
|
24
|
-
/**
|
|
25
|
-
* Constructs a new <code>DtoCreatePlanEntitlementRequest</code>.
|
|
26
|
-
* @alias module:model/DtoCreatePlanEntitlementRequest
|
|
27
|
-
* @param featureId {String}
|
|
28
|
-
* @param featureType {module:model/TypesFeatureType}
|
|
29
|
-
*/
|
|
30
|
-
constructor(featureId, featureType) {
|
|
31
|
-
DtoCreatePlanEntitlementRequest.initialize(this, featureId, featureType);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Initializes the fields of this object.
|
|
36
|
-
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
37
|
-
* Only for internal use.
|
|
38
|
-
*/
|
|
39
|
-
static initialize(obj, featureId, featureType) {
|
|
40
|
-
obj['feature_id'] = featureId;
|
|
41
|
-
obj['feature_type'] = featureType;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Constructs a <code>DtoCreatePlanEntitlementRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
46
|
-
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
47
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
48
|
-
* @param {module:model/DtoCreatePlanEntitlementRequest} obj Optional instance to populate.
|
|
49
|
-
* @return {module:model/DtoCreatePlanEntitlementRequest} The populated <code>DtoCreatePlanEntitlementRequest</code> instance.
|
|
50
|
-
*/
|
|
51
|
-
static constructFromObject(data, obj) {
|
|
52
|
-
if (data) {
|
|
53
|
-
obj = obj || new DtoCreatePlanEntitlementRequest();
|
|
54
|
-
if (data.hasOwnProperty('feature_id')) {
|
|
55
|
-
obj['feature_id'] = ApiClient.convertToType(data['feature_id'], 'String');
|
|
56
|
-
}
|
|
57
|
-
if (data.hasOwnProperty('feature_type')) {
|
|
58
|
-
obj['feature_type'] = TypesFeatureType.constructFromObject(data['feature_type']);
|
|
59
|
-
}
|
|
60
|
-
if (data.hasOwnProperty('is_enabled')) {
|
|
61
|
-
obj['is_enabled'] = ApiClient.convertToType(data['is_enabled'], 'Boolean');
|
|
62
|
-
}
|
|
63
|
-
if (data.hasOwnProperty('is_soft_limit')) {
|
|
64
|
-
obj['is_soft_limit'] = ApiClient.convertToType(data['is_soft_limit'], 'Boolean');
|
|
65
|
-
}
|
|
66
|
-
if (data.hasOwnProperty('plan_id')) {
|
|
67
|
-
obj['plan_id'] = ApiClient.convertToType(data['plan_id'], 'String');
|
|
68
|
-
}
|
|
69
|
-
if (data.hasOwnProperty('static_value')) {
|
|
70
|
-
obj['static_value'] = ApiClient.convertToType(data['static_value'], 'String');
|
|
71
|
-
}
|
|
72
|
-
if (data.hasOwnProperty('usage_limit')) {
|
|
73
|
-
obj['usage_limit'] = ApiClient.convertToType(data['usage_limit'], 'Number');
|
|
74
|
-
}
|
|
75
|
-
if (data.hasOwnProperty('usage_reset_period')) {
|
|
76
|
-
obj['usage_reset_period'] = TypesBillingPeriod.constructFromObject(data['usage_reset_period']);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return obj;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Validates the JSON data with respect to <code>DtoCreatePlanEntitlementRequest</code>.
|
|
84
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
85
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DtoCreatePlanEntitlementRequest</code>.
|
|
86
|
-
*/
|
|
87
|
-
static validateJSON(data) {
|
|
88
|
-
// check to make sure all required properties are present in the JSON string
|
|
89
|
-
for (const property of DtoCreatePlanEntitlementRequest.RequiredProperties) {
|
|
90
|
-
if (!data.hasOwnProperty(property)) {
|
|
91
|
-
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// ensure the json data is a string
|
|
95
|
-
if (data['feature_id'] && !(typeof data['feature_id'] === 'string' || data['feature_id'] instanceof String)) {
|
|
96
|
-
throw new Error("Expected the field `feature_id` to be a primitive type in the JSON string but got " + data['feature_id']);
|
|
97
|
-
}
|
|
98
|
-
// ensure the json data is a string
|
|
99
|
-
if (data['plan_id'] && !(typeof data['plan_id'] === 'string' || data['plan_id'] instanceof String)) {
|
|
100
|
-
throw new Error("Expected the field `plan_id` to be a primitive type in the JSON string but got " + data['plan_id']);
|
|
101
|
-
}
|
|
102
|
-
// ensure the json data is a string
|
|
103
|
-
if (data['static_value'] && !(typeof data['static_value'] === 'string' || data['static_value'] instanceof String)) {
|
|
104
|
-
throw new Error("Expected the field `static_value` to be a primitive type in the JSON string but got " + data['static_value']);
|
|
105
|
-
}
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
DtoCreatePlanEntitlementRequest.RequiredProperties = ["feature_id", "feature_type"];
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @member {String} feature_id
|
|
113
|
-
*/
|
|
114
|
-
DtoCreatePlanEntitlementRequest.prototype['feature_id'] = undefined;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @member {module:model/TypesFeatureType} feature_type
|
|
118
|
-
*/
|
|
119
|
-
DtoCreatePlanEntitlementRequest.prototype['feature_type'] = undefined;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* @member {Boolean} is_enabled
|
|
123
|
-
*/
|
|
124
|
-
DtoCreatePlanEntitlementRequest.prototype['is_enabled'] = undefined;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @member {Boolean} is_soft_limit
|
|
128
|
-
*/
|
|
129
|
-
DtoCreatePlanEntitlementRequest.prototype['is_soft_limit'] = undefined;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @member {String} plan_id
|
|
133
|
-
*/
|
|
134
|
-
DtoCreatePlanEntitlementRequest.prototype['plan_id'] = undefined;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* @member {String} static_value
|
|
138
|
-
*/
|
|
139
|
-
DtoCreatePlanEntitlementRequest.prototype['static_value'] = undefined;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @member {Number} usage_limit
|
|
143
|
-
*/
|
|
144
|
-
DtoCreatePlanEntitlementRequest.prototype['usage_limit'] = undefined;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @member {module:model/TypesBillingPeriod} usage_reset_period
|
|
148
|
-
*/
|
|
149
|
-
DtoCreatePlanEntitlementRequest.prototype['usage_reset_period'] = undefined;
|
|
150
|
-
export default DtoCreatePlanEntitlementRequest;
|
|
@@ -1,279 +0,0 @@
|
|
|
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 DtoCreatePriceTier from './DtoCreatePriceTier';
|
|
16
|
-
import PriceTransformQuantity from './PriceTransformQuantity';
|
|
17
|
-
import TypesBillingCadence from './TypesBillingCadence';
|
|
18
|
-
import TypesBillingModel from './TypesBillingModel';
|
|
19
|
-
import TypesBillingPeriod from './TypesBillingPeriod';
|
|
20
|
-
import TypesBillingTier from './TypesBillingTier';
|
|
21
|
-
import TypesInvoiceCadence from './TypesInvoiceCadence';
|
|
22
|
-
import TypesPriceType from './TypesPriceType';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The DtoCreatePlanPriceRequest model module.
|
|
26
|
-
* @module model/DtoCreatePlanPriceRequest
|
|
27
|
-
* @version 1.0
|
|
28
|
-
*/
|
|
29
|
-
class DtoCreatePlanPriceRequest {
|
|
30
|
-
/**
|
|
31
|
-
* Constructs a new <code>DtoCreatePlanPriceRequest</code>.
|
|
32
|
-
* @alias module:model/DtoCreatePlanPriceRequest
|
|
33
|
-
* @param billingCadence {module:model/TypesBillingCadence}
|
|
34
|
-
* @param billingModel {module:model/TypesBillingModel}
|
|
35
|
-
* @param billingPeriod {module:model/TypesBillingPeriod}
|
|
36
|
-
* @param billingPeriodCount {Number}
|
|
37
|
-
* @param currency {String}
|
|
38
|
-
* @param invoiceCadence {module:model/TypesInvoiceCadence}
|
|
39
|
-
* @param type {module:model/TypesPriceType}
|
|
40
|
-
*/
|
|
41
|
-
constructor(billingCadence, billingModel, billingPeriod, billingPeriodCount, currency, invoiceCadence, type) {
|
|
42
|
-
DtoCreatePlanPriceRequest.initialize(this, billingCadence, billingModel, billingPeriod, billingPeriodCount, currency, invoiceCadence, type);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Initializes the fields of this object.
|
|
47
|
-
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
48
|
-
* Only for internal use.
|
|
49
|
-
*/
|
|
50
|
-
static initialize(obj, billingCadence, billingModel, billingPeriod, billingPeriodCount, currency, invoiceCadence, type) {
|
|
51
|
-
obj['billing_cadence'] = billingCadence;
|
|
52
|
-
obj['billing_model'] = billingModel;
|
|
53
|
-
obj['billing_period'] = billingPeriod;
|
|
54
|
-
obj['billing_period_count'] = billingPeriodCount;
|
|
55
|
-
obj['currency'] = currency;
|
|
56
|
-
obj['invoice_cadence'] = invoiceCadence;
|
|
57
|
-
obj['type'] = type;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Constructs a <code>DtoCreatePlanPriceRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
62
|
-
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
63
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
64
|
-
* @param {module:model/DtoCreatePlanPriceRequest} obj Optional instance to populate.
|
|
65
|
-
* @return {module:model/DtoCreatePlanPriceRequest} The populated <code>DtoCreatePlanPriceRequest</code> instance.
|
|
66
|
-
*/
|
|
67
|
-
static constructFromObject(data, obj) {
|
|
68
|
-
if (data) {
|
|
69
|
-
obj = obj || new DtoCreatePlanPriceRequest();
|
|
70
|
-
if (data.hasOwnProperty('amount')) {
|
|
71
|
-
obj['amount'] = ApiClient.convertToType(data['amount'], 'String');
|
|
72
|
-
}
|
|
73
|
-
if (data.hasOwnProperty('billing_cadence')) {
|
|
74
|
-
obj['billing_cadence'] = TypesBillingCadence.constructFromObject(data['billing_cadence']);
|
|
75
|
-
}
|
|
76
|
-
if (data.hasOwnProperty('billing_model')) {
|
|
77
|
-
obj['billing_model'] = TypesBillingModel.constructFromObject(data['billing_model']);
|
|
78
|
-
}
|
|
79
|
-
if (data.hasOwnProperty('billing_period')) {
|
|
80
|
-
obj['billing_period'] = TypesBillingPeriod.constructFromObject(data['billing_period']);
|
|
81
|
-
}
|
|
82
|
-
if (data.hasOwnProperty('billing_period_count')) {
|
|
83
|
-
obj['billing_period_count'] = ApiClient.convertToType(data['billing_period_count'], 'Number');
|
|
84
|
-
}
|
|
85
|
-
if (data.hasOwnProperty('currency')) {
|
|
86
|
-
obj['currency'] = ApiClient.convertToType(data['currency'], 'String');
|
|
87
|
-
}
|
|
88
|
-
if (data.hasOwnProperty('description')) {
|
|
89
|
-
obj['description'] = ApiClient.convertToType(data['description'], 'String');
|
|
90
|
-
}
|
|
91
|
-
if (data.hasOwnProperty('filter_values')) {
|
|
92
|
-
obj['filter_values'] = ApiClient.convertToType(data['filter_values'], {
|
|
93
|
-
'String': ['String']
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
if (data.hasOwnProperty('invoice_cadence')) {
|
|
97
|
-
obj['invoice_cadence'] = TypesInvoiceCadence.constructFromObject(data['invoice_cadence']);
|
|
98
|
-
}
|
|
99
|
-
if (data.hasOwnProperty('lookup_key')) {
|
|
100
|
-
obj['lookup_key'] = ApiClient.convertToType(data['lookup_key'], 'String');
|
|
101
|
-
}
|
|
102
|
-
if (data.hasOwnProperty('metadata')) {
|
|
103
|
-
obj['metadata'] = ApiClient.convertToType(data['metadata'], {
|
|
104
|
-
'String': 'String'
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (data.hasOwnProperty('meter_id')) {
|
|
108
|
-
obj['meter_id'] = ApiClient.convertToType(data['meter_id'], 'String');
|
|
109
|
-
}
|
|
110
|
-
if (data.hasOwnProperty('plan_id')) {
|
|
111
|
-
obj['plan_id'] = ApiClient.convertToType(data['plan_id'], 'String');
|
|
112
|
-
}
|
|
113
|
-
if (data.hasOwnProperty('tier_mode')) {
|
|
114
|
-
obj['tier_mode'] = TypesBillingTier.constructFromObject(data['tier_mode']);
|
|
115
|
-
}
|
|
116
|
-
if (data.hasOwnProperty('tiers')) {
|
|
117
|
-
obj['tiers'] = ApiClient.convertToType(data['tiers'], [DtoCreatePriceTier]);
|
|
118
|
-
}
|
|
119
|
-
if (data.hasOwnProperty('transform_quantity')) {
|
|
120
|
-
obj['transform_quantity'] = PriceTransformQuantity.constructFromObject(data['transform_quantity']);
|
|
121
|
-
}
|
|
122
|
-
if (data.hasOwnProperty('trial_period')) {
|
|
123
|
-
obj['trial_period'] = ApiClient.convertToType(data['trial_period'], 'Number');
|
|
124
|
-
}
|
|
125
|
-
if (data.hasOwnProperty('type')) {
|
|
126
|
-
obj['type'] = TypesPriceType.constructFromObject(data['type']);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return obj;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Validates the JSON data with respect to <code>DtoCreatePlanPriceRequest</code>.
|
|
134
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
135
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DtoCreatePlanPriceRequest</code>.
|
|
136
|
-
*/
|
|
137
|
-
static validateJSON(data) {
|
|
138
|
-
// check to make sure all required properties are present in the JSON string
|
|
139
|
-
for (const property of DtoCreatePlanPriceRequest.RequiredProperties) {
|
|
140
|
-
if (!data.hasOwnProperty(property)) {
|
|
141
|
-
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// ensure the json data is a string
|
|
145
|
-
if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
|
|
146
|
-
throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
|
|
147
|
-
}
|
|
148
|
-
// ensure the json data is a string
|
|
149
|
-
if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) {
|
|
150
|
-
throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']);
|
|
151
|
-
}
|
|
152
|
-
// ensure the json data is a string
|
|
153
|
-
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
154
|
-
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
155
|
-
}
|
|
156
|
-
// ensure the json data is a string
|
|
157
|
-
if (data['lookup_key'] && !(typeof data['lookup_key'] === 'string' || data['lookup_key'] instanceof String)) {
|
|
158
|
-
throw new Error("Expected the field `lookup_key` to be a primitive type in the JSON string but got " + data['lookup_key']);
|
|
159
|
-
}
|
|
160
|
-
// ensure the json data is a string
|
|
161
|
-
if (data['meter_id'] && !(typeof data['meter_id'] === 'string' || data['meter_id'] instanceof String)) {
|
|
162
|
-
throw new Error("Expected the field `meter_id` to be a primitive type in the JSON string but got " + data['meter_id']);
|
|
163
|
-
}
|
|
164
|
-
// ensure the json data is a string
|
|
165
|
-
if (data['plan_id'] && !(typeof data['plan_id'] === 'string' || data['plan_id'] instanceof String)) {
|
|
166
|
-
throw new Error("Expected the field `plan_id` to be a primitive type in the JSON string but got " + data['plan_id']);
|
|
167
|
-
}
|
|
168
|
-
if (data['tiers']) {
|
|
169
|
-
// data not null
|
|
170
|
-
// ensure the json data is an array
|
|
171
|
-
if (!Array.isArray(data['tiers'])) {
|
|
172
|
-
throw new Error("Expected the field `tiers` to be an array in the JSON data but got " + data['tiers']);
|
|
173
|
-
}
|
|
174
|
-
// validate the optional field `tiers` (array)
|
|
175
|
-
for (const item of data['tiers']) {
|
|
176
|
-
DtoCreatePriceTier.validateJSON(item);
|
|
177
|
-
}
|
|
178
|
-
;
|
|
179
|
-
}
|
|
180
|
-
// validate the optional field `transform_quantity`
|
|
181
|
-
if (data['transform_quantity']) {
|
|
182
|
-
// data not null
|
|
183
|
-
PriceTransformQuantity.validateJSON(data['transform_quantity']);
|
|
184
|
-
}
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
DtoCreatePlanPriceRequest.RequiredProperties = ["billing_cadence", "billing_model", "billing_period", "billing_period_count", "currency", "invoice_cadence", "type"];
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @member {String} amount
|
|
192
|
-
*/
|
|
193
|
-
DtoCreatePlanPriceRequest.prototype['amount'] = undefined;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* @member {module:model/TypesBillingCadence} billing_cadence
|
|
197
|
-
*/
|
|
198
|
-
DtoCreatePlanPriceRequest.prototype['billing_cadence'] = undefined;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* @member {module:model/TypesBillingModel} billing_model
|
|
202
|
-
*/
|
|
203
|
-
DtoCreatePlanPriceRequest.prototype['billing_model'] = undefined;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* @member {module:model/TypesBillingPeriod} billing_period
|
|
207
|
-
*/
|
|
208
|
-
DtoCreatePlanPriceRequest.prototype['billing_period'] = undefined;
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* @member {Number} billing_period_count
|
|
212
|
-
*/
|
|
213
|
-
DtoCreatePlanPriceRequest.prototype['billing_period_count'] = undefined;
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* @member {String} currency
|
|
217
|
-
*/
|
|
218
|
-
DtoCreatePlanPriceRequest.prototype['currency'] = undefined;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @member {String} description
|
|
222
|
-
*/
|
|
223
|
-
DtoCreatePlanPriceRequest.prototype['description'] = undefined;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @member {Object.<String, Array.<String>>} filter_values
|
|
227
|
-
*/
|
|
228
|
-
DtoCreatePlanPriceRequest.prototype['filter_values'] = undefined;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @member {module:model/TypesInvoiceCadence} invoice_cadence
|
|
232
|
-
*/
|
|
233
|
-
DtoCreatePlanPriceRequest.prototype['invoice_cadence'] = undefined;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* @member {String} lookup_key
|
|
237
|
-
*/
|
|
238
|
-
DtoCreatePlanPriceRequest.prototype['lookup_key'] = undefined;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* @member {Object.<String, String>} metadata
|
|
242
|
-
*/
|
|
243
|
-
DtoCreatePlanPriceRequest.prototype['metadata'] = undefined;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* @member {String} meter_id
|
|
247
|
-
*/
|
|
248
|
-
DtoCreatePlanPriceRequest.prototype['meter_id'] = undefined;
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* @member {String} plan_id
|
|
252
|
-
*/
|
|
253
|
-
DtoCreatePlanPriceRequest.prototype['plan_id'] = undefined;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* @member {module:model/TypesBillingTier} tier_mode
|
|
257
|
-
*/
|
|
258
|
-
DtoCreatePlanPriceRequest.prototype['tier_mode'] = undefined;
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* @member {Array.<module:model/DtoCreatePriceTier>} tiers
|
|
262
|
-
*/
|
|
263
|
-
DtoCreatePlanPriceRequest.prototype['tiers'] = undefined;
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* @member {module:model/PriceTransformQuantity} transform_quantity
|
|
267
|
-
*/
|
|
268
|
-
DtoCreatePlanPriceRequest.prototype['transform_quantity'] = undefined;
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* @member {Number} trial_period
|
|
272
|
-
*/
|
|
273
|
-
DtoCreatePlanPriceRequest.prototype['trial_period'] = undefined;
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @member {module:model/TypesPriceType} type
|
|
277
|
-
*/
|
|
278
|
-
DtoCreatePlanPriceRequest.prototype['type'] = undefined;
|
|
279
|
-
export default DtoCreatePlanPriceRequest;
|
|
@@ -1,148 +0,0 @@
|
|
|
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 DtoCreatePlanEntitlementRequest from './DtoCreatePlanEntitlementRequest';
|
|
16
|
-
import DtoCreatePlanPriceRequest from './DtoCreatePlanPriceRequest';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* The DtoCreatePlanRequest model module.
|
|
20
|
-
* @module model/DtoCreatePlanRequest
|
|
21
|
-
* @version 1.0
|
|
22
|
-
*/
|
|
23
|
-
class DtoCreatePlanRequest {
|
|
24
|
-
/**
|
|
25
|
-
* Constructs a new <code>DtoCreatePlanRequest</code>.
|
|
26
|
-
* @alias module:model/DtoCreatePlanRequest
|
|
27
|
-
* @param name {String}
|
|
28
|
-
*/
|
|
29
|
-
constructor(name) {
|
|
30
|
-
DtoCreatePlanRequest.initialize(this, name);
|
|
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, name) {
|
|
39
|
-
obj['name'] = name;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Constructs a <code>DtoCreatePlanRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
44
|
-
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
45
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
46
|
-
* @param {module:model/DtoCreatePlanRequest} obj Optional instance to populate.
|
|
47
|
-
* @return {module:model/DtoCreatePlanRequest} The populated <code>DtoCreatePlanRequest</code> instance.
|
|
48
|
-
*/
|
|
49
|
-
static constructFromObject(data, obj) {
|
|
50
|
-
if (data) {
|
|
51
|
-
obj = obj || new DtoCreatePlanRequest();
|
|
52
|
-
if (data.hasOwnProperty('description')) {
|
|
53
|
-
obj['description'] = ApiClient.convertToType(data['description'], 'String');
|
|
54
|
-
}
|
|
55
|
-
if (data.hasOwnProperty('entitlements')) {
|
|
56
|
-
obj['entitlements'] = ApiClient.convertToType(data['entitlements'], [DtoCreatePlanEntitlementRequest]);
|
|
57
|
-
}
|
|
58
|
-
if (data.hasOwnProperty('lookup_key')) {
|
|
59
|
-
obj['lookup_key'] = ApiClient.convertToType(data['lookup_key'], 'String');
|
|
60
|
-
}
|
|
61
|
-
if (data.hasOwnProperty('name')) {
|
|
62
|
-
obj['name'] = ApiClient.convertToType(data['name'], 'String');
|
|
63
|
-
}
|
|
64
|
-
if (data.hasOwnProperty('prices')) {
|
|
65
|
-
obj['prices'] = ApiClient.convertToType(data['prices'], [DtoCreatePlanPriceRequest]);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return obj;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Validates the JSON data with respect to <code>DtoCreatePlanRequest</code>.
|
|
73
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
74
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DtoCreatePlanRequest</code>.
|
|
75
|
-
*/
|
|
76
|
-
static validateJSON(data) {
|
|
77
|
-
// check to make sure all required properties are present in the JSON string
|
|
78
|
-
for (const property of DtoCreatePlanRequest.RequiredProperties) {
|
|
79
|
-
if (!data.hasOwnProperty(property)) {
|
|
80
|
-
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// ensure the json data is a string
|
|
84
|
-
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
85
|
-
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
86
|
-
}
|
|
87
|
-
if (data['entitlements']) {
|
|
88
|
-
// data not null
|
|
89
|
-
// ensure the json data is an array
|
|
90
|
-
if (!Array.isArray(data['entitlements'])) {
|
|
91
|
-
throw new Error("Expected the field `entitlements` to be an array in the JSON data but got " + data['entitlements']);
|
|
92
|
-
}
|
|
93
|
-
// validate the optional field `entitlements` (array)
|
|
94
|
-
for (const item of data['entitlements']) {
|
|
95
|
-
DtoCreatePlanEntitlementRequest.validateJSON(item);
|
|
96
|
-
}
|
|
97
|
-
;
|
|
98
|
-
}
|
|
99
|
-
// ensure the json data is a string
|
|
100
|
-
if (data['lookup_key'] && !(typeof data['lookup_key'] === 'string' || data['lookup_key'] instanceof String)) {
|
|
101
|
-
throw new Error("Expected the field `lookup_key` to be a primitive type in the JSON string but got " + data['lookup_key']);
|
|
102
|
-
}
|
|
103
|
-
// ensure the json data is a string
|
|
104
|
-
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
105
|
-
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
106
|
-
}
|
|
107
|
-
if (data['prices']) {
|
|
108
|
-
// data not null
|
|
109
|
-
// ensure the json data is an array
|
|
110
|
-
if (!Array.isArray(data['prices'])) {
|
|
111
|
-
throw new Error("Expected the field `prices` to be an array in the JSON data but got " + data['prices']);
|
|
112
|
-
}
|
|
113
|
-
// validate the optional field `prices` (array)
|
|
114
|
-
for (const item of data['prices']) {
|
|
115
|
-
DtoCreatePlanPriceRequest.validateJSON(item);
|
|
116
|
-
}
|
|
117
|
-
;
|
|
118
|
-
}
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
DtoCreatePlanRequest.RequiredProperties = ["name"];
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @member {String} description
|
|
126
|
-
*/
|
|
127
|
-
DtoCreatePlanRequest.prototype['description'] = undefined;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @member {Array.<module:model/DtoCreatePlanEntitlementRequest>} entitlements
|
|
131
|
-
*/
|
|
132
|
-
DtoCreatePlanRequest.prototype['entitlements'] = undefined;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* @member {String} lookup_key
|
|
136
|
-
*/
|
|
137
|
-
DtoCreatePlanRequest.prototype['lookup_key'] = undefined;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @member {String} name
|
|
141
|
-
*/
|
|
142
|
-
DtoCreatePlanRequest.prototype['name'] = undefined;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @member {Array.<module:model/DtoCreatePlanPriceRequest>} prices
|
|
146
|
-
*/
|
|
147
|
-
DtoCreatePlanRequest.prototype['prices'] = undefined;
|
|
148
|
-
export default DtoCreatePlanRequest;
|