wallee
Version:
TypeScript/JavaScript client for wallee
66 lines (65 loc) • 4.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfSubscriptionCharge = instanceOfSubscriptionCharge;
exports.SubscriptionChargeFromJSON = SubscriptionChargeFromJSON;
exports.SubscriptionChargeFromJSONTyped = SubscriptionChargeFromJSONTyped;
exports.SubscriptionChargeToJSON = SubscriptionChargeToJSON;
exports.SubscriptionChargeToJSONTyped = SubscriptionChargeToJSONTyped;
const Transaction_1 = require("./Transaction");
const SubscriptionLedgerEntry_1 = require("./SubscriptionLedgerEntry");
const Subscription_1 = require("./Subscription");
const SubscriptionChargeState_1 = require("./SubscriptionChargeState");
const SubscriptionChargeProcessingType_1 = require("./SubscriptionChargeProcessingType");
const SubscriptionChargeType_1 = require("./SubscriptionChargeType");
/**
* Check if a given object implements the SubscriptionCharge interface.
*/
function instanceOfSubscriptionCharge(value) {
return true;
}
function SubscriptionChargeFromJSON(json) {
return SubscriptionChargeFromJSONTyped(json, false);
}
function SubscriptionChargeFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'discardedOn': json['discardedOn'] == null ? undefined : (new Date(json['discardedOn'])),
'plannedExecutionDate': json['plannedExecutionDate'] == null ? undefined : (new Date(json['plannedExecutionDate'])),
'processingType': json['processingType'] == null ? undefined : (0, SubscriptionChargeProcessingType_1.SubscriptionChargeProcessingTypeFromJSON)(json['processingType']),
'ledgerEntries': json['ledgerEntries'] == null ? undefined : (new Set(json['ledgerEntries'].map(SubscriptionLedgerEntry_1.SubscriptionLedgerEntryFromJSON))),
'discardedBy': json['discardedBy'] == null ? undefined : json['discardedBy'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'successUrl': json['successUrl'] == null ? undefined : json['successUrl'],
'language': json['language'] == null ? undefined : json['language'],
'subscription': json['subscription'] == null ? undefined : (0, Subscription_1.SubscriptionFromJSON)(json['subscription']),
'type': json['type'] == null ? undefined : (0, SubscriptionChargeType_1.SubscriptionChargeTypeFromJSON)(json['type']),
'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'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, SubscriptionChargeState_1.SubscriptionChargeStateFromJSON)(json['state']),
'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])),
'transaction': json['transaction'] == null ? undefined : (0, Transaction_1.TransactionFromJSON)(json['transaction']),
'failedUrl': json['failedUrl'] == null ? undefined : json['failedUrl'],
'succeedOn': json['succeedOn'] == null ? undefined : (new Date(json['succeedOn'])),
};
}
function SubscriptionChargeToJSON(json) {
return SubscriptionChargeToJSONTyped(json, false);
}
function SubscriptionChargeToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'processingType': (0, SubscriptionChargeProcessingType_1.SubscriptionChargeProcessingTypeToJSON)(value['processingType']),
'subscription': (0, Subscription_1.SubscriptionToJSON)(value['subscription']),
'type': (0, SubscriptionChargeType_1.SubscriptionChargeTypeToJSON)(value['type']),
'state': (0, SubscriptionChargeState_1.SubscriptionChargeStateToJSON)(value['state']),
'transaction': (0, Transaction_1.TransactionToJSON)(value['transaction']),
};
}