UNPKG

wallee

Version:
42 lines (41 loc) 1.94 kB
import { CreationEntityStateFromJSON, CreationEntityStateToJSON, } from './CreationEntityState'; import { DocumentTemplateTypeFromJSON, DocumentTemplateTypeToJSON, } from './DocumentTemplateType'; /** * Check if a given object implements the DocumentTemplate interface. */ export function instanceOfDocumentTemplate(value) { return true; } export function DocumentTemplateFromJSON(json) { return DocumentTemplateFromJSONTyped(json, false); } export function DocumentTemplateFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'deliveryEnabled': json['deliveryEnabled'] == null ? undefined : json['deliveryEnabled'], 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'spaceId': json['spaceId'] == null ? undefined : json['spaceId'], 'defaultTemplate': json['defaultTemplate'] == null ? undefined : json['defaultTemplate'], 'name': json['name'] == null ? undefined : json['name'], 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'templateResource': json['templateResource'] == null ? undefined : json['templateResource'], 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : CreationEntityStateFromJSON(json['state']), 'type': json['type'] == null ? undefined : DocumentTemplateTypeFromJSON(json['type']), 'version': json['version'] == null ? undefined : json['version'], }; } export function DocumentTemplateToJSON(json) { return DocumentTemplateToJSONTyped(json, false); } export function DocumentTemplateToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'state': CreationEntityStateToJSON(value['state']), 'type': DocumentTemplateTypeToJSON(value['type']), }; }