Class: RestSerializer
rest.RestSerializer
Hierarchy
ObjectSerializer<Dictionary>↳
RestSerializer
Constructors
constructor
• new RestSerializer(config?)
Parameters
| Name | Type |
|---|---|
config? | Object |
config.dataWrapper? | null | DataWrapper |
Overrides
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
| Name | Type | Default value |
|---|---|---|
config? | Object | undefined |
config.dataWrapper? | null | DataWrapper | undefined |
override | boolean | true |
Returns
void
Overrides
Defined in
src/rest/restSerializer.ts:15
hydrateAttributeInResource
▸ Protected hydrateAttributeInResource(resource, serializedKey, serializedValue): Promise<void>
Parameters
| Name | Type |
|---|---|
resource | Dictionary |
serializedKey | string |
serializedValue | unknown |
Returns
Promise<void>
Inherited from
ObjectSerializer.hydrateAttributeInResource
Defined in
src/object/objectSerializer.ts:82
hydratePropInResource
▸ Protected hydratePropInResource(resource, serializedKey, serializedValue): Promise<void>
Parameters
| Name | Type |
|---|---|
resource | RestNewResource |
serializedKey | string |
serializedValue | unknown |
Returns
Promise<void>
Inherit Doc
Overrides
ObjectSerializer.hydratePropInResource
Defined in
src/rest/restSerializer.ts:35
hydrateRelationInResource
▸ Protected hydrateRelationInResource(resource, serializedKey, serializedValue): Promise<void>
Parameters
| Name | Type |
|---|---|
resource | Dictionary |
serializedKey | string |
serializedValue | unknown |
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
| Name | Type |
|---|---|
instance | ModelInstance |
Returns
Promise<{ id: any = instance.id; lid: any = instance.lid }>
Inherit Doc
Overrides
Defined in
src/rest/restSerializer.ts:28
serialize
▸ serialize(instance, context): Promise<Dictionary>
Parameters
| Name | Type |
|---|---|
instance | ModelInstance |
context | Object |
Returns
Promise<Dictionary>
Overrides
Defined in
src/rest/restSerializer.ts:19
serializeAttributeKey
▸ Protected serializeAttributeKey(instance, def, _context): Promise<string>
Parameters
| Name | Type |
|---|---|
instance | ModelInstance |
def | ModelAttribute |
_context | Object |
Returns
Promise<string>
Inherited from
ObjectSerializer.serializeAttributeKey
Defined in
src/object/objectSerializer.ts:98
serializeAttributeValue
▸ Protected serializeAttributeValue(_instance, def, rawValue, _context): Promise<unknown>
Parameters
| Name | Type |
|---|---|
_instance | ModelInstance |
def | ModelAttribute |
rawValue | unknown |
_context | Object |
Returns
Promise<unknown>
Inherited from
ObjectSerializer.serializeAttributeValue
Defined in
src/object/objectSerializer.ts:143
serializeRelatedInstance
▸ Protected serializeRelatedInstance(_instance, _def, related): Promise<any>
Parameters
| Name | Type |
|---|---|
_instance | ModelInstance |
_def | ModelRelation |
related | ModelInstance |
Returns
Promise<any>
Inherit Doc
Overrides
ObjectSerializer.serializeRelatedInstance
Defined in
src/rest/restSerializer.ts:48
serializeRelationKey
▸ Protected serializeRelationKey(instance, def, _context): Promise<string>
Parameters
| Name | Type |
|---|---|
instance | ModelInstance |
def | ModelRelation |
_context | Object |
Returns
Promise<string>
Inherited from
ObjectSerializer.serializeRelationKey
Defined in
src/object/objectSerializer.ts:106
serializeRelationValue
▸ Protected serializeRelationValue(instance, def, rawValue, context): Promise<unknown>
Parameters
| Name | Type |
|---|---|
instance | ModelInstance |
def | ModelRelation |
rawValue | unknown |
context | Object |
Returns
Promise<unknown>
Inherited from
ObjectSerializer.serializeRelationValue
Defined in
src/object/objectSerializer.ts:154
shouldSerializeAttribute
▸ Protected shouldSerializeAttribute(instance, def, rawValue, context): Promise<boolean>
Parameters
| Name | Type |
|---|---|
instance | ModelInstance |
def | ModelAttribute |
rawValue | unknown |
context | Object |
Returns
Promise<boolean>
Inherited from
ObjectSerializer.shouldSerializeAttribute
Defined in
src/object/objectSerializer.ts:114
shouldSerializeProp
▸ Protected shouldSerializeProp(instance, def, rawValue, _context): Promise<boolean>
Parameters
| Name | Type |
|---|---|
instance | ModelInstance |
def | ModelRelation | ModelAttribute |
rawValue | unknown |
_context | Object |
Returns
Promise<boolean>
Inherited from
ObjectSerializer.shouldSerializeProp
Defined in
src/object/objectSerializer.ts:132
shouldSerializeRelation
▸ Protected shouldSerializeRelation(instance, def, rawValue, context): Promise<boolean>
Parameters
| Name | Type |
|---|---|
instance | ModelInstance |
def | ModelRelation |
rawValue | unknown |
context | Object |
Returns
Promise<boolean>
Inherited from
ObjectSerializer.shouldSerializeRelation
Defined in
src/object/objectSerializer.ts:123