UNPKG

2.58 kBTypeScriptView Raw
1import { DestinationOptions, Destination, DestinationNameAndJwt } from '../../connectivity/scp-cf';
2import { Constructable, Entity, EntityIdentifiable } from '../entity';
3import { ODataDeleteRequestConfig } from '../request';
4import { HttpResponse } from '../../http-client';
5import type { ODataUri } from '../uri-conversion';
6import type { FieldType } from '../selectable';
7import { MethodRequestBuilder } from './request-builder-base';
8/**
9 * Abstract class to delete an entity holding the shared parts between OData v2 and v4
10 * @typeparam EntityT - Type of the entity to be deleted
11 */
12export declare abstract class DeleteRequestBuilder<EntityT extends Entity> extends MethodRequestBuilder<ODataDeleteRequestConfig<EntityT>> implements EntityIdentifiable<EntityT> {
13 readonly _entityConstructor: Constructable<EntityT>;
14 readonly _entity: EntityT;
15 /**
16 * Creates an instance of DeleteRequestBuilder. If the entity is passed, version identifier will also be added.
17 * @param entityConstructor - Constructor type of the entity to be deleted
18 * @param oDataUri - ODataUri conversion interface at runtime either v2 or v4
19 * @param keysOrEntity - Entity or Key-value pairs of key properties for the given entity
20 */
21 constructor(entityConstructor: Constructable<EntityT>, oDataUri: ODataUri, keysOrEntity: Record<string, FieldType> | Entity);
22 /**
23 * Instructs the request to force an overwrite of the entity by sending an 'If-Match: *' header instead of sending the ETag version identifier.
24 * @returns this The request itself to ease chaining while executing the request
25 */
26 ignoreVersionIdentifier(): this;
27 /**
28 * Execute query.
29 * @param destination - Destination to execute the request against
30 * @param options - Options to employ when fetching destinations
31 * @returns A promise resolving once the entity was deleted
32 */
33 execute(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<void>;
34 /**
35 * Execute request and return an [[HttpResponse]].
36 * @param destination - Destination to execute the request against
37 * @param options - Options to employ when fetching destinations
38 * @returns A promise resolving to an [[HttpResponse]].
39 */
40 executeRaw(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<HttpResponse>;
41 abstract setVersionIdentifier(eTag: string): this;
42}
43export { DeleteRequestBuilder as DeleteRequestBuilderBase };
44//# sourceMappingURL=delete-request-builder-base.d.ts.map
\No newline at end of file