Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CreateRequestBuilder<EntityT>

Create OData request to create an entity.

Type parameters

  • EntityT: Entity

    Type of the entity to be created

Hierarchy

Implements

  • EntityIdentifiable<EntityT>

Index

Constructors

constructor

  • new CreateRequestBuilder(entityConstructor: Constructable<EntityT>, entity: EntityT): CreateRequestBuilder
  • Creates an instance of CreateRequestBuilder.

    Parameters

    • entityConstructor: Constructable<EntityT>

      Constructor type of the entity to be created

    • entity: EntityT

      Entity to be created

    Returns CreateRequestBuilder

Properties

entityConstructor

entityConstructor: Constructable<EntityT>

Constructor type of the entity to be created

Protected requestConfig

requestConfig: ODataCreateRequestConfig<EntityT>

Request configuration to initialize with

Methods

build

execute

  • Execute query.

    Parameters

    Returns Promise<EntityT>

    A promise resolving to the created entity

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