import { ODataResponse } from "./ODataResponseModel"; /** * Retrieves the configuration type for the given ODataClient type. */ export type ODataClientConfig = ClientType extends ODataClient ? Config : never; export interface ODataClient { /** * Create a model or collection entry. * * @param url * @param data * @param requestConfig */ post(url: string, data: any, requestConfig?: RequestConfig): ODataResponse; get(url: string, requestConfig?: RequestConfig): ODataResponse; /** * Replace a model. * * @param url * @param data * @param requestConfig */ put(url: string, data: any, requestConfig?: RequestConfig): ODataResponse; /** * Partially update a model. * * @param url * @param data * @param requestConfig */ patch(url: string, data: any, requestConfig?: RequestConfig): ODataResponse; /** * OData V2 only feature. * Historically, PATCH method was not part of the official HTTP spec, when V1 & V2 were specified; * but use of PATCH was already envisioned {@link https://www.odata.org/documentation/odata-version-2-0/operations/}. * V3 and all following versions, specify use of PATCH method. * * If implemented, this method wil be used instead of patch to partially update models. * Use case: You want to reuse this client and one server can only handle MERGE, * but not PATCH http requests. * * @param url * @param data * @param requestConfig */ merge?(url: string, data: any, requestConfig?: RequestConfig): ODataResponse; /** * Delete a model or collection. * * @param url * @param requestConfig */ delete(url: string, requestConfig?: RequestConfig): ODataResponse; }