Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DeleteRequestBuilder<EntityT>

Create OData query to delete an entity.

Type parameters

  • EntityT: Entity

    Type of the entity to be deleted

Hierarchy

Implements

  • EntityIdentifiable<EntityT>

Index

Constructors

constructor

  • Creates an instance of DeleteRequestBuilder. If the entity is passed, version identifier will also be added.

    Parameters

    • entityConstructor: Constructable<EntityT>

      Constructor type of the entity to be deleted

    • keysOrEntity: MapType<FieldType> | Entity

      Entity or Key-value pairs of key properties for the given entity

    Returns DeleteRequestBuilder

Properties

entityConstructor

entityConstructor: Constructable<EntityT>

Protected requestConfig

requestConfig: ODataDeleteRequestConfig<EntityT>

Request configuration to initialize with

Methods

build

execute

  • Execute query.

    Parameters

    Returns Promise<void>

    A promise resolving once the entity was deleted

setVersionIdentifier

  • setVersionIdentifier(etag: string): this
  • Add ETag version identifier in the delete request header.

    Parameters

    • etag: string

      The version identifier of the entity

    Returns this

    The 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