wallee
Version:
TypeScript/JavaScript client for wallee
56 lines (55 loc) • 2.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfRefundCreate = instanceOfRefundCreate;
exports.RefundCreateFromJSON = RefundCreateFromJSON;
exports.RefundCreateFromJSONTyped = RefundCreateFromJSONTyped;
exports.RefundCreateToJSON = RefundCreateToJSON;
exports.RefundCreateToJSONTyped = RefundCreateToJSONTyped;
const RefundType_1 = require("./RefundType");
const LineItemReductionCreate_1 = require("./LineItemReductionCreate");
/**
* Check if a given object implements the RefundCreate interface.
*/
function instanceOfRefundCreate(value) {
if (!('externalId' in value) || value['externalId'] === undefined)
return false;
if (!('type' in value) || value['type'] === undefined)
return false;
return true;
}
function RefundCreateFromJSON(json) {
return RefundCreateFromJSONTyped(json, false);
}
function RefundCreateFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'completion': json['completion'] == null ? undefined : json['completion'],
'metaData': json['metaData'] == null ? undefined : json['metaData'],
'amount': json['amount'] == null ? undefined : json['amount'],
'reductions': json['reductions'] == null ? undefined : (json['reductions'].map(LineItemReductionCreate_1.LineItemReductionCreateFromJSON)),
'externalId': json['externalId'],
'type': (0, RefundType_1.RefundTypeFromJSON)(json['type']),
'merchantReference': json['merchantReference'] == null ? undefined : json['merchantReference'],
'transaction': json['transaction'] == null ? undefined : json['transaction'],
};
}
function RefundCreateToJSON(json) {
return RefundCreateToJSONTyped(json, false);
}
function RefundCreateToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'completion': value['completion'],
'metaData': value['metaData'],
'amount': value['amount'],
'reductions': value['reductions'] == null ? undefined : (value['reductions'].map(LineItemReductionCreate_1.LineItemReductionCreateToJSON)),
'externalId': value['externalId'],
'type': (0, RefundType_1.RefundTypeToJSON)(value['type']),
'merchantReference': value['merchantReference'],
'transaction': value['transaction'],
};
}