@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
45 lines • 2.56 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetByKeyRequestBuilderV2 = exports.GetByKeyRequestBuilder = void 0;
var odata_common_1 = require("../../odata-common");
var entity_deserializer_1 = require("../entity-deserializer");
var uri_conversion_1 = require("../uri-conversion");
var response_data_accessor_1 = require("./response-data-accessor");
/**
* Create an OData request to get a single entity based on its key properties.
* The properties available in the response can be restricted by creating a [[GetAllRequestBuilder.select selection]], where no selection is equal to selecting all fields.
* Note that navigational properties are automatically expanded if they included in a select.
* @typeparam EntityT - Type of the entity to be requested
*/
var GetByKeyRequestBuilder = /** @class */ (function (_super) {
__extends(GetByKeyRequestBuilder, _super);
/**
* Creates an instance of GetByKeyRequestBuilder.
* @param _entityConstructor - Constructor of the entity to create the request for
* @param keys - Key-value pairs where the key is the name of a key property of the given entity and the value is the respective value
*/
function GetByKeyRequestBuilder(_entityConstructor, keys) {
var _this = _super.call(this, _entityConstructor, keys, uri_conversion_1.oDataUri, entity_deserializer_1.entityDeserializer, response_data_accessor_1.responseDataAccessor) || this;
_this._entityConstructor = _entityConstructor;
return _this;
}
return GetByKeyRequestBuilder;
}(odata_common_1.GetByKeyRequestBuilder));
exports.GetByKeyRequestBuilder = GetByKeyRequestBuilder;
exports.GetByKeyRequestBuilderV2 = GetByKeyRequestBuilder;
//# sourceMappingURL=get-by-key-request-builder.js.map
;