@sap-cloud-sdk/odata-common
Version:
SAP Cloud SDK for JavaScript common functions of OData client generator and OpenAPI clint generator.
34 lines (33 loc) • 1.98 kB
TypeScript
import { ODataCountRequestConfig } from '../request';
import { MethodRequestBuilder } from './request-builder-base';
import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
import type { HttpResponse } from '@sap-cloud-sdk/http-client';
import type { EntityBase } from '../entity-base';
import type { DeSerializers } from '../de-serializers';
import type { GetAllRequestBuilderBase } from './get-all-request-builder-base';
/**
* Create an OData request to count entities based on the configuration of the request.
* A `CountRequestBuilder` allows only for execution of the request.
* If you want to apply query parameters like filter, skip or top do it on the {@link GetAllRequestBuilderBase | GetAllRequestBuilder} the count is created from.
* @typeParam EntityT - Type of the entity to be requested
*/
export declare class CountRequestBuilder<EntityT extends EntityBase, DeSerializersT extends DeSerializers> extends MethodRequestBuilder<ODataCountRequestConfig<EntityT, DeSerializersT>> {
readonly getAllRequest: GetAllRequestBuilderBase<EntityT, DeSerializersT>;
/**
* Creates an instance of CountRequestBuilder.
* @param getAllRequest - Get all request builder to count result for.
*/
constructor(getAllRequest: GetAllRequestBuilderBase<EntityT, DeSerializersT>);
/**
* Execute request.
* @param destination - Destination or DestinationFetchOptions to execute the request against.
* @returns A promise resolving to the number of entities.
*/
execute(destination: HttpDestinationOrFetchOptions): Promise<number>;
/**
* Execute request and return an {@link @sap-cloud-sdk/http-client!HttpResponse}.
* @param destination - Destination or DestinationFetchOptions to execute the request against.
* @returns A promise resolving to an {@link @sap-cloud-sdk/http-client!HttpResponse}.
*/
executeRaw(destination: HttpDestinationOrFetchOptions): Promise<HttpResponse>;
}