wallee
Version:
TypeScript/JavaScript client for wallee
41 lines (40 loc) • 1.84 kB
JavaScript
import { CustomerFromJSON, CustomerToJSON, } from './Customer';
import { CustomerAddressTypeFromJSON, CustomerAddressTypeToJSON, } from './CustomerAddressType';
import { CustomerPostalAddressFromJSON, CustomerPostalAddressToJSON, } from './CustomerPostalAddress';
/**
* Check if a given object implements the CustomerAddress interface.
*/
export function instanceOfCustomerAddress(value) {
return true;
}
export function CustomerAddressFromJSON(json) {
return CustomerAddressFromJSONTyped(json, false);
}
export function CustomerAddressFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'address': json['address'] == null ? undefined : CustomerPostalAddressFromJSON(json['address']),
'addressType': json['addressType'] == null ? undefined : CustomerAddressTypeFromJSON(json['addressType']),
'id': json['id'] == null ? undefined : json['id'],
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'customer': json['customer'] == null ? undefined : CustomerFromJSON(json['customer']),
'defaultAddress': json['defaultAddress'] == null ? undefined : json['defaultAddress'],
};
}
export function CustomerAddressToJSON(json) {
return CustomerAddressToJSONTyped(json, false);
}
export function CustomerAddressToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'address': CustomerPostalAddressToJSON(value['address']),
'addressType': CustomerAddressTypeToJSON(value['addressType']),
'customer': CustomerToJSON(value['customer']),
};
}