wallee
Version:
TypeScript/JavaScript client for wallee
47 lines (46 loc) • 2.47 kB
JavaScript
import { AddressFromJSON, AddressToJSON, } from './Address';
import { CreationEntityStateFromJSON, CreationEntityStateToJSON, } from './CreationEntityState';
/**
* Check if a given object implements the Subscriber interface.
*/
export function instanceOfSubscriber(value) {
return true;
}
export function SubscriberFromJSON(json) {
return SubscriberFromJSONTyped(json, false);
}
export function SubscriberFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'description': json['description'] == null ? undefined : json['description'],
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'language': json['language'] == null ? undefined : json['language'],
'version': json['version'] == null ? undefined : json['version'],
'reference': json['reference'] == null ? undefined : json['reference'],
'additionalAllowedPaymentMethodConfigurations': json['additionalAllowedPaymentMethodConfigurations'] == null ? undefined : json['additionalAllowedPaymentMethodConfigurations'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'metaData': json['metaData'] == null ? undefined : json['metaData'],
'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'],
'disallowedPaymentMethodConfigurations': json['disallowedPaymentMethodConfigurations'] == null ? undefined : json['disallowedPaymentMethodConfigurations'],
'shippingAddress': json['shippingAddress'] == null ? undefined : AddressFromJSON(json['shippingAddress']),
'billingAddress': json['billingAddress'] == null ? undefined : AddressFromJSON(json['billingAddress']),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : CreationEntityStateFromJSON(json['state']),
};
}
export function SubscriberToJSON(json) {
return SubscriberToJSONTyped(json, false);
}
export function SubscriberToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'shippingAddress': AddressToJSON(value['shippingAddress']),
'billingAddress': AddressToJSON(value['billingAddress']),
'state': CreationEntityStateToJSON(value['state']),
};
}