@sap-cloud-sdk/odata-common
Version:
SAP Cloud SDK for JavaScript common functions of OData client generator and OpenAPI clint generator.
32 lines • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ODataUpdateRequestConfig = void 0;
const odata_request_config_1 = require("./odata-request-config");
/**
* OData update request configuration for an entity type.
* @typeParam EntityT - Type of the entity to setup a request for
*/
class ODataUpdateRequestConfig extends odata_request_config_1.ODataRequestConfig {
/**
* Creates an instance of ODataUpdateRequestConfig.
* @param entityApi - Entity API for building and executing the request.
* @param oDataUri - URI conversion functions.
*/
constructor(entityApi, oDataUri) {
super('patch', entityApi.entityConstructor._defaultBasePath);
this.entityApi = entityApi;
this.oDataUri = oDataUri;
this.versionIdentifierIgnored = false;
}
resourcePath() {
return this.oDataUri.getResourcePathForKeys(this.keys, this.entityApi);
}
queryParameters() {
return this.prependDollarToQueryParameters({});
}
updateWithPut() {
this.method = 'put';
}
}
exports.ODataUpdateRequestConfig = ODataUpdateRequestConfig;
//# sourceMappingURL=odata-update-request-config.js.map