UNPKG

1.93 kBTypeScriptView Raw
1import { Constructable, EntityIdentifiable, UpdateRequestBuilder as UpdateRequestBuilderBase } from '../../odata-common';
2import { Entity } from '../entity';
3import { Destination, DestinationNameAndJwt, DestinationOptions } from '../../connectivity/scp-cf';
4import { HttpResponse } from '../../http-client';
5/**
6 * Create OData query to update an entity.
7 * @typeparam EntityT - Type of the entity to be updated
8 */
9export declare class UpdateRequestBuilder<EntityT extends Entity> extends UpdateRequestBuilderBase<EntityT> implements EntityIdentifiable<EntityT> {
10 readonly _entityConstructor: Constructable<EntityT>;
11 readonly _entity: EntityT;
12 /**
13 * Creates an instance of UpdateRequestBuilder.
14 * @param _entityConstructor - Constructor type of the entity to be updated
15 * @param _entity - Entity to be updated
16 */
17 constructor(_entityConstructor: Constructable<EntityT>, _entity: EntityT);
18 /**
19 * Executes the query.
20 * @param destination - Destination to execute the request against
21 * @param options - Options to employ when fetching destinations
22 * @returns A promise resolving to the entity once it was updated
23 */
24 execute(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<EntityT>;
25 /**
26 * Execute request and return an [[HttpResponse]]. The request is only executed if some properties of the entity are modified.
27 * @param destination - Destination to execute the request against
28 * @param options - Options to employ when fetching destinations
29 * @returns A promise resolving to an [[HttpResponse]] when the request is executed or `undefined` otherwise.
30 */
31 executeRaw(destination: Destination | DestinationNameAndJwt, options?: DestinationOptions): Promise<HttpResponse | undefined>;
32}
33export { UpdateRequestBuilder as UpdateRequestBuilderV2 };
34//# sourceMappingURL=update-request-builder.d.ts.map
\No newline at end of file