The entity type defining data shape and available links
Represents the collection state of the resource
Contains an array of State objects for each element in the collection when the entity is a collection type Returns an empty array when the entity is not a collection type Supports navigation and state management for paginated collections
Represents the body of the HTTP response.
In the case of a JSON response, this will be deserialized
Timestamp of when the State was first generated
The URI associated with this state
Returns content-related HTTP headers for this state.
These headers (e.g., Content-Type, Content-Length) describe the resource content and are used when sending the state back to the server.
Headers object containing content-related headers
Follows a relationship to create a Resource for navigation.
This is the primary method for HATEOAS-driven navigation. The returned Resource can be used to fetch the linked resource's state.
The link relation name (e.g., 'self', 'posts', 'author')
The relation type to follow
Optionalvariables: LinkVariablesOptional template variables for URI expansion
A Resource instance for the linked resource
Checks if a link with the given relation exists.
The link relation name
The relation type to check for
true if the link exists, false otherwise
Serializes the state for use in HTTP request bodies.
For JSON resources, this typically returns JSON.stringify(data).
The serialization format depends on the content type.
The serialized body as Buffer, Blob, or string
Represents the state of a REST resource at a specific point in time.
State is the result of fetching a resource and contains:
State objects are immutable snapshots. Use Resource methods to modify the server state and obtain new State objects.
Example
See