import { ODataHttpClient } from "@odata2ts/http-client-api"; import { ODataCollectionResponseV4, ODataModelPayloadV4 } from "@odata2ts/odata-core"; import { CollectionQueryBuilderV4, ModelQueryBuilderV4 } from "@odata2ts/odata-query-builder"; import { QId, QueryObjectModel } from "@odata2ts/odata-query-objects"; import { ODataServiceOptionsInternal } from "../ODataServiceOptions"; import { UrlBuilderRequestCmdV4 } from "../request"; import { EntityModificationResponseV4 } from "./ResponseTypeChoicesV4"; import { ServiceStateHelperV4, SubtypeOptions } from "./ServiceStateHelperV4.js"; export declare abstract class EntitySetServiceV4 { protected readonly __base: ServiceStateHelperV4; protected readonly __idFunction: QId; /** * Overriding the constructor to support creation of EntityTypeService from within this service. * Also support key spec. * * @param client the odata client responsible for data requests * @param basePath the base URL path * @param name name of the service * @param qModel query object * @param idFunction the id function * @param options * @protected */ protected constructor(client: ClientType, basePath: string, name: string, qModel: Q, idFunction: QId, options?: ODataServiceOptionsInternal); getPath(): string; /** * The key specification for the given entity type. * Supports composite keys. */ getKeySpec(): import("@odata2ts/odata-query-objects").QParamModel[]; /** * Create an OData path for an entity with a given id. * Might be useful for routing. * * @example `createKey("1234")` => `"myEntity('1234')"` * @example `createKey({number: 1234, name: "Test"})` => `"myEntity(number=1234,name='Test')"` * @param id either a primitive value (single key entities only) or an object * @param notEncoded if set to {@code true}, special chars are not escaped */ createKey(id: EIdType, notEncoded?: boolean): string; /** * Parse an OData path representing the id of an entity. * Might be useful for routing in combination with createKey. * * @example `parseKey("myEntity(1234)")` => `"1234"` * @example `parseKey("myEntity(id=1234,name='Test')")` => `{ id: 1234, name: "Test" }` * @param keyPath e.g. myEntity(id=1234,name='Test') * @param notDecoded if set to {@code true}, encoded special chars are not decoded */ parseKey(keyPath: string, notDecoded?: boolean): EIdType; /** * Create a new model. * Spec: {@link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_CreateanEntity}). * * The response of this operation is status 201 with the proper and complete model including the usually required id. * With a header field of "Prefer" and value "return=minimal" the OData server should respond with * status 204 and comes with no response data at all. * Both implementations have to supply the URL to the resource in the header field "Location", so you can always * extract the ID as part of this URL (the appropriate QId object can help parsing here). * * If you know in which way your server responds, you can easily supply this information via a boolean switch * to get the correct typing. `true` (default) means that the complete entity is returned, while `false` determines * that no data is returned, e.g. `create(...)`. * * @param model * @param createOptions * @return command object for request execution */ create(model: ODataModelPayloadV4, createOptions?: SubtypeOptions, queryFn?: (builder: ModelQueryBuilderV4, qObject: Q) => void): UrlBuilderRequestCmdV4, Q, ModelQueryBuilderV4, ODataModelPayloadV4>; /** * Query the entity set. * Spec: {@link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_QueryingCollections} * * @param queryFn provide the query logic with the help of the builder and the query-object */ query = T>(queryFn?: (builder: CollectionQueryBuilderV4, qObject: Q) => void): UrlBuilderRequestCmdV4, Q, CollectionQueryBuilderV4, undefined>; }