Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GetAllRequestBuilder<EntityT>

Create OData request to get multiple entities based on the configuration of the request. A GetAllRequestBuilder allows to restrict the response in multiple dimensions. The properties available in the response can be restricted by creating a selection, where no selection is equal to selecting all fields. The entities can be filtered and ordered based on the values of their properties. The number of entities in the result can be limited and results can be skipped for paging purposes. If none of the above mentioned are configured all entities of the given type will be requested.

Type parameters

  • EntityT: Entity

    Type of the entity to be requested

Hierarchy

Implements

  • EntityIdentifiable<EntityT>

Index

Constructors

constructor

  • Creates an instance of GetAllRequestBuilder.

    Parameters

    • entityConstructor: Constructable<EntityT>

      Constructor of the entity to create the request for

    Returns GetAllRequestBuilder

Properties

entityConstructor

entityConstructor: Constructable<EntityT>

Constructor of the entity to create the request for

Protected requestConfig

requestConfig: ODataGetAllRequestConfig<EntityT>

Request configuration to initialize with

Methods

build

execute

  • Execute request.

    Parameters

    Returns Promise<EntityT[]>

    A promise resolving to the requested entities

filter

  • filter(...expressions: Array<Filterable<EntityT>>): this
  • Add filter statements to the request.

    Parameters

    • Rest ...expressions: Array<Filterable<EntityT>>

      Filter expressions to restrict the response

    Returns this

    The request builder itself, to facilitate method chaining

orderBy

  • orderBy(...orderBy: Array<Orderable<EntityT>>): this
  • Add order-by statements to the request.

    Parameters

    • Rest ...orderBy: Array<Orderable<EntityT>>

      OrderBy statements to order the response by

    Returns this

    The request builder itself, to facilitate method chaining

select

  • select(...selects: Array<Selectable<EntityT>>): this
  • Restrict the response to the given selection of properties in the request.

    Parameters

    • Rest ...selects: Array<Selectable<EntityT>>

      Fields to select in the request

    Returns this

    The request builder itself, to facilitate method chaining

skip

  • skip(skip: number): this
  • Skip number of entities.

    Parameters

    • skip: number

      Number of matching entities to skip. Useful for paging

    Returns this

    The request builder itself, to facilitate method chaining

top

  • top(top: number): this
  • Limit number of returned entities.

    Parameters

    • top: number

      Maximum number of entities to return in the response. Can be less, if less entities match the request

    Returns this

    The request builder itself, to facilitate method chaining

url

  • Create the url based on configuration of the given builder.

    Parameters

    Returns Promise<string>

    Promise resolving to the url for the request

withCustomHeaders

  • withCustomHeaders(headers: MapType<string>): this
  • Add custom headers to the request.

    Parameters

    • headers: MapType<string>

      Key-value pairs denoting additional custom headers

    Returns this

    The request builder itself, to facilitate method chaining

withCustomServicePath

  • withCustomServicePath(servicePath: string): this
  • Replace the default service path with the given custom path. In case of the S/4HANA apis the servicePath defaults to '/sap/opu/odata/sap/' and can be overwritten here.

    Parameters

    • servicePath: string

      Path to override the default with

    Returns this

    The request builder itself, to facilitate method chaining