wallee
Version:
TypeScript/JavaScript client for wallee
56 lines (55 loc) • 2.69 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfCharge = instanceOfCharge;
exports.ChargeFromJSON = ChargeFromJSON;
exports.ChargeFromJSONTyped = ChargeFromJSONTyped;
exports.ChargeToJSON = ChargeToJSON;
exports.ChargeToJSONTyped = ChargeToJSONTyped;
const Transaction_1 = require("./Transaction");
const ChargeType_1 = require("./ChargeType");
const FailureReason_1 = require("./FailureReason");
const ChargeState_1 = require("./ChargeState");
/**
* Check if a given object implements the Charge interface.
*/
function instanceOfCharge(value) {
return true;
}
function ChargeFromJSON(json) {
return ChargeFromJSONTyped(json, false);
}
function ChargeFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'timeZone': json['timeZone'] == null ? undefined : json['timeZone'],
'language': json['language'] == null ? undefined : json['language'],
'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'],
'type': json['type'] == null ? undefined : (0, ChargeType_1.ChargeTypeFromJSON)(json['type']),
'userFailureMessage': json['userFailureMessage'] == null ? undefined : json['userFailureMessage'],
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'timeoutOn': json['timeoutOn'] == null ? undefined : (new Date(json['timeoutOn'])),
'failureReason': json['failureReason'] == null ? undefined : (0, FailureReason_1.FailureReasonFromJSON)(json['failureReason']),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, ChargeState_1.ChargeStateFromJSON)(json['state']),
'transaction': json['transaction'] == null ? undefined : (0, Transaction_1.TransactionFromJSON)(json['transaction']),
};
}
function ChargeToJSON(json) {
return ChargeToJSONTyped(json, false);
}
function ChargeToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'type': (0, ChargeType_1.ChargeTypeToJSON)(value['type']),
'failureReason': (0, FailureReason_1.FailureReasonToJSON)(value['failureReason']),
'state': (0, ChargeState_1.ChargeStateToJSON)(value['state']),
'transaction': (0, Transaction_1.TransactionToJSON)(value['transaction']),
};
}