wallee
Version:
TypeScript/JavaScript client for wallee
57 lines (56 loc) • 3.61 kB
JavaScript
import { BillingCycleModelFromJSON, BillingCycleModelToJSON, } from './BillingCycleModel';
import { TaxCalculationFromJSON, TaxCalculationToJSON, } from './TaxCalculation';
import { SubscriptionProductFromJSON, SubscriptionProductToJSON, } from './SubscriptionProduct';
import { SubscriptionProductVersionStateFromJSON, SubscriptionProductVersionStateToJSON, } from './SubscriptionProductVersionState';
/**
* Check if a given object implements the SubscriptionProductVersion interface.
*/
export function instanceOfSubscriptionProductVersion(value) {
return true;
}
export function SubscriptionProductVersionFromJSON(json) {
return SubscriptionProductVersionFromJSONTyped(json, false);
}
export 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 : SubscriptionProductFromJSON(json['product']),
'retiringStartedOn': json['retiringStartedOn'] == null ? undefined : (new Date(json['retiringStartedOn'])),
'taxCalculation': json['taxCalculation'] == null ? undefined : 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 : 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 : SubscriptionProductVersionStateFromJSON(json['state']),
'numberOfNoticePeriods': json['numberOfNoticePeriods'] == null ? undefined : json['numberOfNoticePeriods'],
};
}
export function SubscriptionProductVersionToJSON(json) {
return SubscriptionProductVersionToJSONTyped(json, false);
}
export function SubscriptionProductVersionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'product': SubscriptionProductToJSON(value['product']),
'taxCalculation': TaxCalculationToJSON(value['taxCalculation']),
'billingCycleModel': BillingCycleModelToJSON(value['billingCycleModel']),
'state': SubscriptionProductVersionStateToJSON(value['state']),
};
}