UNPKG

@sap-cloud-sdk/core

Version:
44 lines 2.58 kB
import { DestinationOptions, Destination, DestinationNameAndJwt } from '../../connectivity/scp-cf'; import { Constructable, Entity, EntityIdentifiable } from '../entity'; import { ODataDeleteRequestConfig } from '../request'; import { HttpResponse } from '../../http-client'; import type { ODataUri } from '../uri-conversion'; import type { FieldType } from '../selectable'; import { MethodRequestBuilder } from './request-builder-base'; /** * Abstract class to delete an entity holding the shared parts between OData v2 and v4 * @typeparam EntityT - Type of the entity to be deleted */ export declare abstract class DeleteRequestBuilder<EntityT extends Entity> extends MethodRequestBuilder<ODataDeleteRequestConfig<EntityT>> implements EntityIdentifiable<EntityT> { readonly _entityConstructor: Constructable<EntityT>; readonly _entity: EntityT; /** * Creates an instance of DeleteRequestBuilder. If the entity is passed, version identifier will also be added. * @param entityConstructor - Constructor type of the entity to be deleted * @param oDataUri - ODataUri conversion interface at runtime either v2 or v4 * @param keysOrEntity - Entity or Key-value pairs of key properties for the given entity */ constructor(entityConstructor: Constructable<EntityT>, oDataUri: ODataUri, keysOrEntity: Record<string, FieldType> | Entity); /** * Instructs the request to force an overwrite of the entity by sending an 'If-Match: *' header instead of sending the ETag version identifier. * @returns this The request itself to ease chaining while executing the request */ ignoreVersionIdentifier(): this; /** * Execute query. * @param destination - Destination to execute the request against * @param options - Options to employ when fetching destinations * @returns A promise resolving once the entity was deleted */ execute(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<void>; /** * Execute request and return an [[HttpResponse]]. * @param destination - Destination to execute the request against * @param options - Options to employ when fetching destinations * @returns A promise resolving to an [[HttpResponse]]. */ executeRaw(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<HttpResponse>; abstract setVersionIdentifier(eTag: string): this; } export { DeleteRequestBuilder as DeleteRequestBuilderBase }; //# sourceMappingURL=delete-request-builder-base.d.ts.map