Skip to main content

Class: RestSerializer

rest.RestSerializer

Hierarchy​

Constructors​

constructor​

• new RestSerializer(config?)

Parameters​

NameType
config?Object
config.dataWrapper?null | DataWrapper

Overrides​

ObjectSerializer.constructor

Defined in​

src/rest/restSerializer.ts:9

Properties​

dataWrapper​

• Private dataWrapper: null | DataWrapper = null

Defined in​

src/rest/restSerializer.ts:7

Methods​

configure​

▸ configure(config?, override?): void

Parameters​

NameTypeDefault value
config?Objectundefined
config.dataWrapper?null | DataWrapperundefined
overridebooleantrue

Returns​

void

Overrides​

ObjectSerializer.configure

Defined in​

src/rest/restSerializer.ts:15


hydrateAttributeInResource​

▸ Protected hydrateAttributeInResource(resource, serializedKey, serializedValue): Promise<void>

Parameters​

NameType
resourceDictionary
serializedKeystring
serializedValueunknown

Returns​

Promise<void>

Inherited from​

ObjectSerializer.hydrateAttributeInResource

Defined in​

src/object/objectSerializer.ts:82


hydratePropInResource​

▸ Protected hydratePropInResource(resource, serializedKey, serializedValue): Promise<void>

Parameters​

NameType
resourceRestNewResource
serializedKeystring
serializedValueunknown

Returns​

Promise<void>

Inherit Doc

Overrides​

ObjectSerializer.hydratePropInResource

Defined in​

src/rest/restSerializer.ts:35


hydrateRelationInResource​

▸ Protected hydrateRelationInResource(resource, serializedKey, serializedValue): Promise<void>

Parameters​

NameType
resourceDictionary
serializedKeystring
serializedValueunknown

Returns​

Promise<void>

Inherited from​

ObjectSerializer.hydrateRelationInResource

Defined in​

src/object/objectSerializer.ts:90


makeResource​

▸ Protected makeResource(instance): Promise<{ id: any = instance.id; lid: any = instance.lid }>

Parameters​

NameType
instanceModelInstance

Returns​

Promise<{ id: any = instance.id; lid: any = instance.lid }>

Inherit Doc

Overrides​

ObjectSerializer.makeResource

Defined in​

src/rest/restSerializer.ts:28


serialize​

▸ serialize(instance, context): Promise<Dictionary>

Parameters​

NameType
instanceModelInstance
contextObject

Returns​

Promise<Dictionary>

Overrides​

ObjectSerializer.serialize

Defined in​

src/rest/restSerializer.ts:19


serializeAttributeKey​

▸ Protected serializeAttributeKey(instance, def, _context): Promise<string>

Parameters​

NameType
instanceModelInstance
defModelAttribute
_contextObject

Returns​

Promise<string>

Inherited from​

ObjectSerializer.serializeAttributeKey

Defined in​

src/object/objectSerializer.ts:98


serializeAttributeValue​

▸ Protected serializeAttributeValue(_instance, def, rawValue, _context): Promise<unknown>

Parameters​

NameType
_instanceModelInstance
defModelAttribute
rawValueunknown
_contextObject

Returns​

Promise<unknown>

Inherited from​

ObjectSerializer.serializeAttributeValue

Defined in​

src/object/objectSerializer.ts:143


serializeRelatedInstance​

▸ Protected serializeRelatedInstance(_instance, _def, related): Promise<any>

Parameters​

NameType
_instanceModelInstance
_defModelRelation
relatedModelInstance

Returns​

Promise<any>

Inherit Doc

Overrides​

ObjectSerializer.serializeRelatedInstance

Defined in​

src/rest/restSerializer.ts:48


serializeRelationKey​

▸ Protected serializeRelationKey(instance, def, _context): Promise<string>

Parameters​

NameType
instanceModelInstance
defModelRelation
_contextObject

Returns​

Promise<string>

Inherited from​

ObjectSerializer.serializeRelationKey

Defined in​

src/object/objectSerializer.ts:106


serializeRelationValue​

▸ Protected serializeRelationValue(instance, def, rawValue, context): Promise<unknown>

Parameters​

NameType
instanceModelInstance
defModelRelation
rawValueunknown
contextObject

Returns​

Promise<unknown>

Inherited from​

ObjectSerializer.serializeRelationValue

Defined in​

src/object/objectSerializer.ts:154


shouldSerializeAttribute​

▸ Protected shouldSerializeAttribute(instance, def, rawValue, context): Promise<boolean>

Parameters​

NameType
instanceModelInstance
defModelAttribute
rawValueunknown
contextObject

Returns​

Promise<boolean>

Inherited from​

ObjectSerializer.shouldSerializeAttribute

Defined in​

src/object/objectSerializer.ts:114


shouldSerializeProp​

▸ Protected shouldSerializeProp(instance, def, rawValue, _context): Promise<boolean>

Parameters​

NameType
instanceModelInstance
defModelRelation | ModelAttribute
rawValueunknown
_contextObject

Returns​

Promise<boolean>

Inherited from​

ObjectSerializer.shouldSerializeProp

Defined in​

src/object/objectSerializer.ts:132


shouldSerializeRelation​

▸ Protected shouldSerializeRelation(instance, def, rawValue, context): Promise<boolean>

Parameters​

NameType
instanceModelInstance
defModelRelation
rawValueunknown
contextObject

Returns​

Promise<boolean>

Inherited from​

ObjectSerializer.shouldSerializeRelation

Defined in​

src/object/objectSerializer.ts:123