import { ODataHttpClient } from "@odata2ts/http-client-api"; import { ODataCollectionResponseV2 } from "@odata2ts/odata-core"; import { CollectionQueryBuilderV2, ModelQueryBuilderV2 } from "@odata2ts/odata-query-builder"; import { PrimitiveCollectionType, QueryObjectModel } from "@odata2ts/odata-query-objects"; import { ODataServiceOptions } from "../ODataServiceOptions"; import { UrlBuilderRequestCmdV2, UrlRequestCmd } from "../request"; import { CollectionModificationResponseV2 } from "./ResponseTypeChoicesV2"; import { ServiceStateHelperV2 } from "./ServiceStateHelperV2.js"; type PrimitiveExtractor = T extends PrimitiveCollectionType ? E : T; export declare class CollectionServiceV2> { protected readonly __base: ServiceStateHelperV2; constructor(client: ClientType, basePath: string, name: string, qModel: Q, options?: ODataServiceOptions); getPath(): string; /** * Add a new item to the collection (should only work with OData V3). * Spec: {@link https://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/#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: PrimitiveT, queryFn?: (builder: ModelQueryBuilderV2, qObject: Q) => void): UrlBuilderRequestCmdV2, Q, ModelQueryBuilderV2, PrimitiveT>; /** * Update the whole collection. * Spec: {@link https://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/#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: ModelQueryBuilderV2, qObject: Q) => void): UrlBuilderRequestCmdV2, Q, ModelQueryBuilderV2, PrimitiveT[]>; /** * Delete the whole collection. */ delete(): UrlRequestCmd; /** * Query collection. */ query(queryFn?: (builder: CollectionQueryBuilderV2, qObject: Q) => void): UrlBuilderRequestCmdV2, Q, CollectionQueryBuilderV2, undefined>; } export {};