UNPKG

@sap-cloud-sdk/core

Version:
64 lines 3.02 kB
"use strict"; /* eslint-disable max-classes-per-file */ 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.ComplexTypeEnumPropertyField = void 0; var complex_type_field_1 = require("../complex-type-field"); var edm_type_field_1 = require("../edm-type-field"); /** * @deprecated Since v1.48.0. Use [[EnumField]] instead. * Represents a property with a enum value. * @typeparam EntityT - Type of the entity the field belongs to */ var EnumFieldBase = /** @class */ (function (_super) { __extends(EnumFieldBase, _super); function EnumFieldBase() { return _super !== null && _super.apply(this, arguments) || this; } return EnumFieldBase; }(edm_type_field_1.EdmTypeField)); /** * @deprecated Since v1.48.0. Use [[EnumField]] instead. * Represents a complex type property with a enum value. * @typeparam EntityT - Type of the entity the field belongs to */ var ComplexTypeEnumPropertyField = /** @class */ (function (_super) { __extends(ComplexTypeEnumPropertyField, _super); /** * Creates an instance of ComplexTypeEnumPropertyField. * @param fieldName - Actual name of the field used in the OData request * @param fieldOf - The constructor of the entity or the complex type this field belongs to * @param edmType - Type of the field according to the metadata description */ function ComplexTypeEnumPropertyField(fieldName, fieldOf) { var _this = _super.call(this, fieldName, (0, complex_type_field_1.getEntityConstructor)(fieldOf), 'Edm.Enum') || this; _this.fieldOf = fieldOf; return _this; } /** * Path to the field to be used in filter and order by queries. Combines the parent complex type name with the field name. * @returns Path to the field to be used in filter and order by queries. */ ComplexTypeEnumPropertyField.prototype.fieldPath = function () { return this.fieldOf instanceof complex_type_field_1.ComplexTypeField ? "".concat(this.fieldOf.fieldPath(), "/").concat(this._fieldName) : this._fieldName; }; return ComplexTypeEnumPropertyField; }(EnumFieldBase)); exports.ComplexTypeEnumPropertyField = ComplexTypeEnumPropertyField; //# sourceMappingURL=enum-field.js.map