import { ODataHttpClient } from "@odata2ts/http-client-api"; import { ODataCollectionResponseV2, ODataEntityModelResponseV2 } from "@odata2ts/odata-core"; import { CollectionQueryBuilderV2, ModelQueryBuilderV2 } from "@odata2ts/odata-query-builder"; import { QId, QueryObjectModel } from "@odata2ts/odata-query-objects"; import { ODataServiceOptions } from "../ODataServiceOptions"; import { UrlBuilderRequestCmdV2 } from "../request"; import { ServiceStateHelperV2 } from "./ServiceStateHelperV2.js"; export declare abstract class EntitySetServiceV2 { protected readonly __base: ServiceStateHelperV2; protected readonly __idFunction: QId; protected constructor(client: ClientType, basePath: string, name: string, qModel: Q, idFunction: QId, options?: ODataServiceOptions); 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({id: 1234, name: "Test"}) => myEntity(id=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://www.odata.org/documentation/odata-version-2-0/operations/} - 2.4 Creating new Entries * * The service should respond with 201 (Created) and the newly created model. * * @param model * @return */ create(model: EditableT, queryFn?: (builder: ModelQueryBuilderV2, qObject: Q) => void): UrlBuilderRequestCmdV2, Q, ModelQueryBuilderV2, EditableT>; /** * Query the entity set. * * @param queryFn provide the query logic with the help of the builder and the query-object */ query = T>(queryFn?: (builder: CollectionQueryBuilderV2, qObject: Q) => void): UrlBuilderRequestCmdV2, Q, CollectionQueryBuilderV2, undefined>; }