import { ODataHttpClient } from "@odata2ts/http-client-api"; import { ODataCollectionResponseV4, ODataModelPayloadV4 } from "@odata2ts/odata-core"; import { CollectionQueryBuilderV4, ModelQueryBuilderV4 } from "@odata2ts/odata-query-builder"; import { PrimitiveCollectionType, QueryObjectModel } from "@odata2ts/odata-query-objects"; import { ODataServiceOptionsInternal } from "../ODataServiceOptions"; import { UrlBuilderRequestCmdV4, UrlRequestCmd } from "../request"; import { CollectionModificationResponseV4 } from "./ResponseTypeChoicesV4"; import { ServiceStateHelperV4 } from "./ServiceStateHelperV4.js"; export type PrimitiveExtractor = T extends PrimitiveCollectionType ? E : T; export declare class CollectionServiceV4> { protected readonly __base: ServiceStateHelperV4; constructor(client: ClientType, basePath: string, name: string, qModel: Q, options?: ODataServiceOptionsInternal); getPath(): string; /** * Add a new item to the collection. * Spec: https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_UpdateaCollectionProperty * * The response of this operation is dependent on the `Prefer` header. * By default, you get 204 and no response data, while adding the prefer header with `Prefer: return=representation` * should yield status 200 with the proper and complete model. * * 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` means that the complete entity is returned, while `false` (default) determines * that no data is returned, e.g. `add(...)`. * * @param model primitive value */ add(model: ODataModelPayloadV4, queryFn?: (builder: ModelQueryBuilderV4, qObject: Q) => void): UrlBuilderRequestCmdV4, Q, ModelQueryBuilderV4, PrimitiveT>; /** * Update the whole collection. * Spec: https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_UpdateaCollectionProperty * * The response of this operation is dependent on the `Prefer` header. * By default, you get 204 and no response data, while adding the prefer header with `Prefer: return=representation` * should yield status 200 with the proper and complete model. * * 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` means that the complete entity is returned, while `false` (default) determines * that no data is returned, e.g. `update(...). * * @param models set of primitive values */ update(models: Array>, queryFn?: (builder: ModelQueryBuilderV4, qObject: Q) => void): UrlBuilderRequestCmdV4, Q, ModelQueryBuilderV4, PrimitiveT[]>; /** * Delete the whole collection. * Spec: https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_UpdateaCollectionProperty */ delete(): UrlRequestCmd; /** * Query collection of primitive values. * 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(queryFn?: (builder: CollectionQueryBuilderV4, qObject: Q) => void): UrlBuilderRequestCmdV4, Q, CollectionQueryBuilderV4, undefined>; }