UNPKG

@sap-cloud-sdk/core

Version:
50 lines 2.36 kB
"use strict"; 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.DeleteRequestBuilderV4 = exports.DeleteRequestBuilder = void 0; var odata_common_1 = require("../../odata-common"); var uri_conversion_1 = require("../uri-conversion"); /** * Create OData query to delete an entity. * @typeparam EntityT - Type of the entity to be deleted */ var DeleteRequestBuilder = /** @class */ (function (_super) { __extends(DeleteRequestBuilder, _super); /** * Creates an instance of DeleteRequestBuilder. If the entity is passed, version identifier will also be added. * @param entityConstructor - Constructor type of the entity to be deleted * @param keysOrEntity - Entity or Key-value pairs of key properties for the given entity */ function DeleteRequestBuilder(entityConstructor, keysOrEntity) { return _super.call(this, entityConstructor, uri_conversion_1.oDataUri, keysOrEntity) || this; } /** * Add ETag version identifier in the delete request header. * @param etag - The version identifier of the entity. * @returns The builder itself, to facilitate method chaining. */ DeleteRequestBuilder.prototype.setVersionIdentifier = function (etag) { if (etag) { this.requestConfig.addCustomHeaders({ 'if-match': etag }); } return this; }; return DeleteRequestBuilder; }(odata_common_1.DeleteRequestBuilder)); exports.DeleteRequestBuilder = DeleteRequestBuilder; exports.DeleteRequestBuilderV4 = DeleteRequestBuilder; //# sourceMappingURL=delete-request-builder.js.map