wallee
Version:
TypeScript/JavaScript client for wallee
50 lines (49 loc) • 2.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfSubscriptionPending = instanceOfSubscriptionPending;
exports.SubscriptionPendingFromJSON = SubscriptionPendingFromJSON;
exports.SubscriptionPendingFromJSONTyped = SubscriptionPendingFromJSONTyped;
exports.SubscriptionPendingToJSON = SubscriptionPendingToJSON;
exports.SubscriptionPendingToJSONTyped = SubscriptionPendingToJSONTyped;
/**
* Check if a given object implements the SubscriptionPending interface.
*/
function instanceOfSubscriptionPending(value) {
if (!('version' in value) || value['version'] === undefined)
return false;
return true;
}
function SubscriptionPendingFromJSON(json) {
return SubscriptionPendingFromJSONTyped(json, false);
}
function SubscriptionPendingFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'description': json['description'] == null ? undefined : json['description'],
'plannedTerminationDate': json['plannedTerminationDate'] == null ? undefined : (new Date(json['plannedTerminationDate'])),
'affiliate': json['affiliate'] == null ? undefined : json['affiliate'],
'version': json['version'],
'reference': json['reference'] == null ? undefined : json['reference'],
'subscriber': json['subscriber'] == null ? undefined : json['subscriber'],
'token': json['token'] == null ? undefined : json['token'],
};
}
function SubscriptionPendingToJSON(json) {
return SubscriptionPendingToJSONTyped(json, false);
}
function SubscriptionPendingToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'description': value['description'],
'plannedTerminationDate': value['plannedTerminationDate'] == null ? undefined : ((value['plannedTerminationDate']).toISOString()),
'affiliate': value['affiliate'],
'version': value['version'],
'reference': value['reference'],
'subscriber': value['subscriber'],
'token': value['token'],
};
}