import { ODataHttpClient } from "@odata2ts/http-client-api"; import { ODataModelPayloadFor, ODataModelResponseFor, ODataVersionV4 } from "@odata2ts/odata-core"; import { ModelQueryBuilderV4 } from "@odata2ts/odata-query-builder"; import { QueryObjectModel } from "@odata2ts/odata-query-objects"; import { ODataServiceOptionsInternal } from "../ODataServiceOptions"; import { UrlBuilderRequestCmdV4, UrlBuilderWriteRequestCmdV4, UrlWriteRequestCmd } from "../request"; import { EntityModificationResponseV4 } from "./ResponseTypeChoicesV4"; import { ServiceStateHelperV4, SubtypeOptions } from "./ServiceStateHelperV4.js"; /** * Service for a single, already addressed entity: it updates, patches, deletes and reads it, but never * creates one - that is the entity set's business. So the only write shape it needs is `UpdatableT`, * the model without the properties that cannot change after creation. Creating an entity goes through * {@link EntitySetServiceV4}, which takes the editable model instead. */ export declare class EntityTypeServiceV4 { protected readonly __base: ServiceStateHelperV4; constructor(client: ODataHttpClient, basePath: string, name: string, qModel: Q, options?: ODataServiceOptionsInternal); getPath(): string; /** * Patch (partially update) the current entity. * Spec: {@link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_UpdateanEntity} * * 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. `patch(...)`. * * @param model * @param patchOptions * @param queryFn */ patch(model: ODataModelPayloadFor>, patchOptions?: SubtypeOptions, queryFn?: (builder: ModelQueryBuilderV4, qObject: Q) => void): UrlBuilderWriteRequestCmdV4, Q, ModelQueryBuilderV4, ODataModelPayloadFor>>; /** * Update the current entity. * Spec: {@link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_UpdateanEntity} * * 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 model * @param updateOptions * @param queryFn */ update(model: ODataModelPayloadFor, updateOptions?: SubtypeOptions, queryFn?: (builder: ModelQueryBuilderV4, qObject: Q) => void): UrlBuilderWriteRequestCmdV4, Q, ModelQueryBuilderV4, ODataModelPayloadFor>; /** * Delete the current entity. * * Response status 204 and no content is expected. * * Spec: {@link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_DeleteanEntity} */ delete(): UrlWriteRequestCmd; /** * Query the entity. * Get back the complete entity or shape the response structure via `select` and `expand`. * Spec: {@link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_RequestingIndividualEntities} * * @param queryFn provide the query logic with the help of the builder and the query-object */ query = T>(queryFn?: (builder: ModelQueryBuilderV4, qObject: Q) => void): UrlBuilderRequestCmdV4, Q, ModelQueryBuilderV4, undefined>; }