Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ODataBatchRequestBuilder

The OData batch request builder to build a batch, which consists of an ordered retrieve requests or change sets.

Hierarchy

Index

Constructors

constructor

Properties

defaultServicePath

defaultServicePath: string

Service path

entityToConstructorMap

entityToConstructorMap: MapType<Constructable<Entity>>

A map that holds the entity type to constructor mapping

requestConfig

requestConfig: ODataBatchConfig

Request configuration to initialize with

requests

An array of retrieve requests or change sets

Methods

build

execute

  • Execute the given request and return the according promise. Please notice: The sub-requests may fail even the main request is successful.

    Parameters

    Returns Promise<BatchResponse[]>

    Promise resolving to the requested data.

relativeUrl

  • relativeUrl(): string
  • Create the relative url based on configuration of the given builder.

    Returns string

    The relative url for the request

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