@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
40 lines • 2.32 kB
TypeScript
import { Destination, DestinationNameAndJwt, DestinationOptions } from '../../connectivity/scp-cf';
import { Constructable, Entity } from '../entity';
import { ODataGetByKeyRequestConfig } from '../request';
import { ODataUri } from '../uri-conversion';
import { FieldType, Selectable } from '../selectable';
import { EntityDeserializer } from '../entity-deserializer';
import { ResponseDataAccessor } from '../response-data-accessor';
import { GetRequestBuilder } from './get-request-builder-base';
/**
* Abstract class to create a get by key request containing the shared functionality for OData v2 and v4.
* @typeparam EntityT - Type of the entity to be requested
*/
export declare abstract class GetByKeyRequestBuilder<EntityT extends Entity> extends GetRequestBuilder<EntityT, ODataGetByKeyRequestConfig<EntityT>> {
readonly entityDeserializer: EntityDeserializer;
readonly dataAccessor: ResponseDataAccessor;
/**
* Creates an instance of GetByKeyRequestBuilder.
* @param entityConstructor - Constructor of the entity to create the request for
* @param keys - Key-value pairs where the key is the name of a key property of the given entity and the value is the respective value
* @param oDataUri - Uri conversion methods
* @param entityDeserializer - Entity deserializer
*/
constructor(entityConstructor: Constructable<EntityT>, keys: Record<string, FieldType>, oDataUri: ODataUri, entityDeserializer: EntityDeserializer, dataAccessor: ResponseDataAccessor);
/**
* Restrict the response to the given selection of properties in the request.
* @param selects - Fields to select in the request
* @returns The request builder itself, to facilitate method chaining
*/
select(...selects: Selectable<EntityT>[]): this;
select(selects: Selectable<EntityT>[]): this;
/**
* Execute request.
* @param destination - Destination to execute the request against
* @param options - Options to employ when fetching destinations
* @returns A promise resolving to the requested entity
*/
execute(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<EntityT>;
}
export { GetByKeyRequestBuilder as GetByKeyRequestBuilderBase };
//# sourceMappingURL=get-by-key-request-builder.d.ts.map