wallee
Version:
TypeScript/JavaScript client for wallee
59 lines (58 loc) • 3.46 kB
JavaScript
import { AddressFromJSON, AddressToJSON, } from './Address';
import { EnvironmentFromJSON, EnvironmentToJSON, } from './Environment';
import { LineItemFromJSON, } from './LineItem';
import { TransactionInvoiceStateFromJSON, TransactionInvoiceStateToJSON, } from './TransactionInvoiceState';
import { TransactionCompletionFromJSON, TransactionCompletionToJSON, } from './TransactionCompletion';
/**
* Check if a given object implements the TransactionInvoice interface.
*/
export function instanceOfTransactionInvoice(value) {
return true;
}
export function TransactionInvoiceFromJSON(json) {
return TransactionInvoiceFromJSONTyped(json, false);
}
export function TransactionInvoiceFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'completion': json['completion'] == null ? undefined : TransactionCompletionFromJSON(json['completion']),
'derecognizedOn': json['derecognizedOn'] == null ? undefined : (new Date(json['derecognizedOn'])),
'amount': json['amount'] == null ? undefined : json['amount'],
'dueOn': json['dueOn'] == null ? undefined : (new Date(json['dueOn'])),
'outstandingAmount': json['outstandingAmount'] == null ? undefined : json['outstandingAmount'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'timeZone': json['timeZone'] == null ? undefined : json['timeZone'],
'language': json['language'] == null ? undefined : json['language'],
'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'],
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'paidOn': json['paidOn'] == null ? undefined : (new Date(json['paidOn'])),
'version': json['version'] == null ? undefined : json['version'],
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItemFromJSON)),
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'environment': json['environment'] == null ? undefined : EnvironmentFromJSON(json['environment']),
'derecognizedBy': json['derecognizedBy'] == null ? undefined : json['derecognizedBy'],
'billingAddress': json['billingAddress'] == null ? undefined : AddressFromJSON(json['billingAddress']),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : TransactionInvoiceStateFromJSON(json['state']),
'linkedTransaction': json['linkedTransaction'] == null ? undefined : json['linkedTransaction'],
'taxAmount': json['taxAmount'] == null ? undefined : json['taxAmount'],
'merchantReference': json['merchantReference'] == null ? undefined : json['merchantReference'],
};
}
export function TransactionInvoiceToJSON(json) {
return TransactionInvoiceToJSONTyped(json, false);
}
export function TransactionInvoiceToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'completion': TransactionCompletionToJSON(value['completion']),
'environment': EnvironmentToJSON(value['environment']),
'billingAddress': AddressToJSON(value['billingAddress']),
'state': TransactionInvoiceStateToJSON(value['state']),
};
}