wallee
Version:
TypeScript/JavaScript client for wallee
64 lines (63 loc) • 4.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfSubscriptionProductVersion = instanceOfSubscriptionProductVersion;
exports.SubscriptionProductVersionFromJSON = SubscriptionProductVersionFromJSON;
exports.SubscriptionProductVersionFromJSONTyped = SubscriptionProductVersionFromJSONTyped;
exports.SubscriptionProductVersionToJSON = SubscriptionProductVersionToJSON;
exports.SubscriptionProductVersionToJSONTyped = SubscriptionProductVersionToJSONTyped;
const BillingCycleModel_1 = require("./BillingCycleModel");
const TaxCalculation_1 = require("./TaxCalculation");
const SubscriptionProduct_1 = require("./SubscriptionProduct");
const SubscriptionProductVersionState_1 = require("./SubscriptionProductVersionState");
/**
* Check if a given object implements the SubscriptionProductVersion interface.
*/
function instanceOfSubscriptionProductVersion(value) {
return true;
}
function SubscriptionProductVersionFromJSON(json) {
return SubscriptionProductVersionFromJSONTyped(json, false);
}
function SubscriptionProductVersionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'retiringFinishedOn': json['retiringFinishedOn'] == null ? undefined : (new Date(json['retiringFinishedOn'])),
'enabledCurrencies': json['enabledCurrencies'] == null ? undefined : new Set(json['enabledCurrencies']),
'product': json['product'] == null ? undefined : (0, SubscriptionProduct_1.SubscriptionProductFromJSON)(json['product']),
'retiringStartedOn': json['retiringStartedOn'] == null ? undefined : (new Date(json['retiringStartedOn'])),
'taxCalculation': json['taxCalculation'] == null ? undefined : (0, TaxCalculation_1.TaxCalculationFromJSON)(json['taxCalculation']),
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'reference': json['reference'] == null ? undefined : json['reference'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'activatedOn': json['activatedOn'] == null ? undefined : (new Date(json['activatedOn'])),
'billingCycle': json['billingCycle'] == null ? undefined : json['billingCycle'],
'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'],
'name': json['name'] == null ? undefined : json['name'],
'minimalNumberOfPeriods': json['minimalNumberOfPeriods'] == null ? undefined : json['minimalNumberOfPeriods'],
'obsoletedOn': json['obsoletedOn'] == null ? undefined : (new Date(json['obsoletedOn'])),
'billingCycleModel': json['billingCycleModel'] == null ? undefined : (0, BillingCycleModel_1.BillingCycleModelFromJSON)(json['billingCycleModel']),
'comment': json['comment'] == null ? undefined : json['comment'],
'id': json['id'] == null ? undefined : json['id'],
'incrementNumber': json['incrementNumber'] == null ? undefined : json['incrementNumber'],
'state': json['state'] == null ? undefined : (0, SubscriptionProductVersionState_1.SubscriptionProductVersionStateFromJSON)(json['state']),
'numberOfNoticePeriods': json['numberOfNoticePeriods'] == null ? undefined : json['numberOfNoticePeriods'],
};
}
function SubscriptionProductVersionToJSON(json) {
return SubscriptionProductVersionToJSONTyped(json, false);
}
function SubscriptionProductVersionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'product': (0, SubscriptionProduct_1.SubscriptionProductToJSON)(value['product']),
'taxCalculation': (0, TaxCalculation_1.TaxCalculationToJSON)(value['taxCalculation']),
'billingCycleModel': (0, BillingCycleModel_1.BillingCycleModelToJSON)(value['billingCycleModel']),
'state': (0, SubscriptionProductVersionState_1.SubscriptionProductVersionStateToJSON)(value['state']),
};
}