UNPKG

wallee

Version:
42 lines (41 loc) 1.91 kB
import { CreationEntityStateFromJSON, CreationEntityStateToJSON, } from './CreationEntityState'; /** * Check if a given object implements the Token interface. */ export function instanceOfToken(value) { return true; } export function TokenFromJSON(json) { return TokenFromJSONTyped(json, false); } export function TokenFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'enabledForOneClickPayment': json['enabledForOneClickPayment'] == null ? undefined : json['enabledForOneClickPayment'], 'customerEmailAddress': json['customerEmailAddress'] == null ? undefined : json['customerEmailAddress'], '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'], 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'version': json['version'] == null ? undefined : json['version'], 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'tokenReference': json['tokenReference'] == null ? undefined : json['tokenReference'], 'customerId': json['customerId'] == null ? undefined : json['customerId'], 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : CreationEntityStateFromJSON(json['state']), }; } export function TokenToJSON(json) { return TokenToJSONTyped(json, false); } export function TokenToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'state': CreationEntityStateToJSON(value['state']), }; }