UNPKG

@sap-cloud-sdk/odata-common

Version:

SAP Cloud SDK for JavaScript common functions of OData client generator and OpenAPI clint generator.

32 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ODataGetByKeyRequestConfig = void 0; const odata_request_config_1 = require("./odata-request-config"); /** * OData getByKey request configuration for an entity type. * @template EntityT - Type of the entity to setup a request for. */ class ODataGetByKeyRequestConfig extends odata_request_config_1.ODataRequestConfig { /** * Creates an instance of ODataGetByKeyRequestConfig. * @param entityApi - Entity API for building and executing the request. * @param oDataUri - URI conversion functions. */ constructor(entityApi, oDataUri) { super('get', entityApi.entityConstructor._defaultBasePath); this.entityApi = entityApi; this.oDataUri = oDataUri; this.selects = []; } resourcePath() { return this.oDataUri.getResourcePathForKeys(this.keys, this.entityApi); } queryParameters() { return this.prependDollarToQueryParameters({ ...this.oDataUri.getSelect(this.selects), ...this.oDataUri.getExpand(this.selects, this.expands, this.entityApi) }); } } exports.ODataGetByKeyRequestConfig = ODataGetByKeyRequestConfig; //# sourceMappingURL=odata-get-by-key-request-config.js.map