UNPKG

wallee

Version:
45 lines (44 loc) 2 kB
import { AddressCreateFromJSON, AddressCreateToJSON, } from './AddressCreate'; import { LineItemCreateFromJSON, LineItemCreateToJSON, } from './LineItemCreate'; /** * Check if a given object implements the TransactionInvoiceReplacement interface. */ export function instanceOfTransactionInvoiceReplacement(value) { if (!('lineItems' in value) || value['lineItems'] === undefined) return false; if (!('externalId' in value) || value['externalId'] === undefined) return false; return true; } export function TransactionInvoiceReplacementFromJSON(json) { return TransactionInvoiceReplacementFromJSONTyped(json, false); } export function TransactionInvoiceReplacementFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'lineItems': (json['lineItems'].map(LineItemCreateFromJSON)), 'dueOn': json['dueOn'] == null ? undefined : (new Date(json['dueOn'])), 'externalId': json['externalId'], 'billingAddress': json['billingAddress'] == null ? undefined : AddressCreateFromJSON(json['billingAddress']), 'sentToCustomer': json['sentToCustomer'] == null ? undefined : json['sentToCustomer'], 'merchantReference': json['merchantReference'] == null ? undefined : json['merchantReference'], }; } export function TransactionInvoiceReplacementToJSON(json) { return TransactionInvoiceReplacementToJSONTyped(json, false); } export function TransactionInvoiceReplacementToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'lineItems': (value['lineItems'].map(LineItemCreateToJSON)), 'dueOn': value['dueOn'] == null ? undefined : ((value['dueOn']).toISOString()), 'externalId': value['externalId'], 'billingAddress': AddressCreateToJSON(value['billingAddress']), 'sentToCustomer': value['sentToCustomer'], 'merchantReference': value['merchantReference'], }; }