Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FunctionImportRequestBuilder<ParametersT, ReturnT>

Create OData request to execute a function import.

Type parameters

  • ParametersT

    Type of the function import parameters

  • ReturnT

    Type of the function import return value

Hierarchy

Index

Constructors

constructor

  • Creates an instance of FunctionImportRequestBuilder.

    Parameters

    • method: RequestMethodType

      HTTP method to be used for the request

    • defaultServicePath: string

      Default path for the service the function belongs to

    • functionImportName: string

      The name of the function import.

    • responseTransformer: function

      Transformation function for the response

        • (data: any): ReturnT
        • Parameters

          • data: any

          Returns ReturnT

    • parameters: FunctionImportParameters<ParametersT>

      Parameters to be set in the function

    Returns FunctionImportRequestBuilder

Properties

Protected requestConfig

requestConfig: ODataFunctionImportRequestConfig<ParametersT>

Request configuration to initialize with

responseTransformer

responseTransformer: function

Transformation function for the response

Type declaration

    • (data: any): ReturnT
    • Parameters

      • data: any

      Returns ReturnT

Methods

build

execute

  • Execute request

    Parameters

    Returns Promise<ReturnT>

    A promise resolving to the requested return type

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