wallee
Version:
TypeScript/JavaScript client for wallee
62 lines (61 loc) • 4.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfSubscriptionVersion = instanceOfSubscriptionVersion;
exports.SubscriptionVersionFromJSON = SubscriptionVersionFromJSON;
exports.SubscriptionVersionFromJSONTyped = SubscriptionVersionFromJSONTyped;
exports.SubscriptionVersionToJSON = SubscriptionVersionToJSON;
exports.SubscriptionVersionToJSONTyped = SubscriptionVersionToJSONTyped;
const SubscriptionVersionState_1 = require("./SubscriptionVersionState");
const BillingCycleModel_1 = require("./BillingCycleModel");
const SubscriptionComponentConfiguration_1 = require("./SubscriptionComponentConfiguration");
const Subscription_1 = require("./Subscription");
const SubscriptionProductVersion_1 = require("./SubscriptionProductVersion");
/**
* Check if a given object implements the SubscriptionVersion interface.
*/
function instanceOfSubscriptionVersion(value) {
return true;
}
function SubscriptionVersionFromJSON(json) {
return SubscriptionVersionFromJSONTyped(json, false);
}
function SubscriptionVersionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'language': json['language'] == null ? undefined : json['language'],
'subscription': json['subscription'] == null ? undefined : (0, Subscription_1.SubscriptionFromJSON)(json['subscription']),
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'terminatedOn': json['terminatedOn'] == null ? undefined : (new Date(json['terminatedOn'])),
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'terminationIssuedOn': json['terminationIssuedOn'] == null ? undefined : (new Date(json['terminationIssuedOn'])),
'componentConfigurations': json['componentConfigurations'] == null ? undefined : (new Set(json['componentConfigurations'].map(SubscriptionComponentConfiguration_1.SubscriptionComponentConfigurationFromJSON))),
'productVersion': json['productVersion'] == null ? undefined : (0, SubscriptionProductVersion_1.SubscriptionProductVersionFromJSON)(json['productVersion']),
'activatedOn': json['activatedOn'] == null ? undefined : (new Date(json['activatedOn'])),
'terminatingOn': json['terminatingOn'] == null ? undefined : (new Date(json['terminatingOn'])),
'billingCurrency': json['billingCurrency'] == null ? undefined : json['billingCurrency'],
'expectedLastPeriodEnd': json['expectedLastPeriodEnd'] == null ? undefined : (new Date(json['expectedLastPeriodEnd'])),
'billingCycleModel': json['billingCycleModel'] == null ? undefined : (0, BillingCycleModel_1.BillingCycleModelFromJSON)(json['billingCycleModel']),
'plannedTerminationDate': json['plannedTerminationDate'] == null ? undefined : (new Date(json['plannedTerminationDate'])),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, SubscriptionVersionState_1.SubscriptionVersionStateFromJSON)(json['state']),
'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])),
};
}
function SubscriptionVersionToJSON(json) {
return SubscriptionVersionToJSONTyped(json, false);
}
function SubscriptionVersionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'subscription': (0, Subscription_1.SubscriptionToJSON)(value['subscription']),
'productVersion': (0, SubscriptionProductVersion_1.SubscriptionProductVersionToJSON)(value['productVersion']),
'billingCycleModel': (0, BillingCycleModel_1.BillingCycleModelToJSON)(value['billingCycleModel']),
'state': (0, SubscriptionVersionState_1.SubscriptionVersionStateToJSON)(value['state']),
};
}