UNPKG

1.98 kBTypeScriptView Raw
1import { Entity } from '../entity';
2import { MethodRequestBuilder } from '../request-builder/request-builder-base';
3import { DestinationOptions, Destination, DestinationNameAndJwt } from '../../connectivity/scp-cf';
4import { ODataCountRequestConfig } from '../request/odata-count-request-config';
5import { HttpResponse } from '../../http-client';
6import type { GetAllRequestBuilder } from './get-all-request-builder-base';
7/**
8 * Create an OData request to count entities based on the configuration of the request.
9 * A `CountRequestBuilder` allows only for execution of the request.
10 * If you want to apply query parameters like filter, skip or top do it on the [[GetAllRequestBuilder]] the count is created from.
11 * @typeparam EntityT - Type of the entity to be requested
12 */
13export declare class CountRequestBuilder<EntityT extends Entity> extends MethodRequestBuilder<ODataCountRequestConfig<EntityT>> {
14 readonly getAllRequest: GetAllRequestBuilder<EntityT>;
15 /**
16 * Creates an instance of CountRequestBuilder.
17 * @param _entityConstructor - Constructor of the entity to create the request for
18 */
19 constructor(getAllRequest: GetAllRequestBuilder<EntityT>);
20 /**
21 * Execute request.
22 * @param destination - Destination to execute the request against
23 * @param options - Options to employ when fetching destinations
24 * @returns A promise resolving to the number of entities
25 */
26 execute(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<number>;
27 /**
28 * Execute request and return an [[HttpResponse]].
29 * @param destination - Destination to execute the request against
30 * @param options - Options to employ when fetching destinations
31 * @returns A promise resolving to an [[HttpResponse]].
32 */
33 executeRaw(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<HttpResponse>;
34}
35//# sourceMappingURL=count-request-builder.d.ts.map
\No newline at end of file