wallee
Version:
TypeScript/JavaScript client for wallee
49 lines (48 loc) • 2.05 kB
JavaScript
import { RefundTypeFromJSON, RefundTypeToJSON, } from './RefundType';
import { LineItemReductionCreateFromJSON, LineItemReductionCreateToJSON, } from './LineItemReductionCreate';
/**
* Check if a given object implements the RefundCreate interface.
*/
export function instanceOfRefundCreate(value) {
if (!('externalId' in value) || value['externalId'] === undefined)
return false;
if (!('type' in value) || value['type'] === undefined)
return false;
return true;
}
export function RefundCreateFromJSON(json) {
return RefundCreateFromJSONTyped(json, false);
}
export 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(LineItemReductionCreateFromJSON)),
'externalId': json['externalId'],
'type': RefundTypeFromJSON(json['type']),
'merchantReference': json['merchantReference'] == null ? undefined : json['merchantReference'],
'transaction': json['transaction'] == null ? undefined : json['transaction'],
};
}
export function RefundCreateToJSON(json) {
return RefundCreateToJSONTyped(json, false);
}
export 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(LineItemReductionCreateToJSON)),
'externalId': value['externalId'],
'type': RefundTypeToJSON(value['type']),
'merchantReference': value['merchantReference'],
'transaction': value['transaction'],
};
}