UNPKG

2.3 kBJavaScriptView Raw
1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 };
9 return function (d, b) {
10 if (typeof b !== "function" && b !== null)
11 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12 extendStatics(d, b);
13 function __() { this.constructor = d; }
14 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 };
16})();
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.DeleteRequestBuilderV2 = exports.DeleteRequestBuilder = void 0;
19var odata_common_1 = require("../../odata-common");
20var uri_conversion_1 = require("../uri-conversion");
21/**
22 * Create OData query to delete an entity.
23 * @typeparam EntityT - Type of the entity to be deleted
24 */
25var DeleteRequestBuilder = /** @class */ (function (_super) {
26 __extends(DeleteRequestBuilder, _super);
27 /**
28 * Creates an instance of DeleteRequestBuilder. If the entity is passed, version identifier will also be added.
29 * @param entityConstructor - Constructor type of the entity to be deleted
30 * @param keysOrEntity - Entity or Key-value pairs of key properties for the given entity
31 */
32 function DeleteRequestBuilder(entityConstructor, keysOrEntity) {
33 return _super.call(this, entityConstructor, uri_conversion_1.oDataUri, keysOrEntity) || this;
34 }
35 /**
36 * Add an eTag version identifier in the delete request header.
37 * @param eTag - The version identifier of the entity
38 * @returns The builder itself, to facilitate method chaining
39 */
40 DeleteRequestBuilder.prototype.setVersionIdentifier = function (eTag) {
41 this.requestConfig.eTag = eTag;
42 return this;
43 };
44 return DeleteRequestBuilder;
45}(odata_common_1.DeleteRequestBuilder));
46exports.DeleteRequestBuilder = DeleteRequestBuilder;
47exports.DeleteRequestBuilderV2 = DeleteRequestBuilder;
48//# sourceMappingURL=delete-request-builder.js.map
\No newline at end of file