import Guid from "../Guid"; import ReferenceTypeName from "../serialization/ReferenceTypeName"; import Utility from "../Utility" export default class PinEntity { static optionalKeys = ['Direction'] constructor(options = {}) { const getOrFalse = (keys) => Utility.objectGet(keys, false, options) const getOrEmptyString = (keys) => Utility.objectGet(keys, "", options) this.PinId = new Guid(Utility.objectGet(["PinId"], true, options)) this.PinName = getOrEmptyString(["PinName"]) this.PinToolTip = getOrEmptyString(["PinToolTip"]) this.Direction = getOrEmptyString(["Direction"]) this.PinType = { PinCategory: getOrEmptyString(["PinType", "PinCategory"]), PinSubCategory: getOrEmptyString(["PinType", "PinSubCategory"]), PinSubCategoryObject: Utility.objectGet(["PinType", "PinSubCategoryObject"], ReferenceTypeName.None, options), PinSubCategoryMemberReference: Utility.objectGet(["PinType", "PinSubCategoryMemberReference"], null, options), PinValueType: getOrFalse(["PinType", "PinValueType"]), ContainerType: Utility.objectGet(["PinType", "ContainerType"], ReferenceTypeName.None, options), bIsReference: getOrFalse(["PinType", "bIsReference"]), bIsConst: getOrFalse(["PinType", "bIsConst"]), bIsWeakPointer: getOrFalse(["PinType", "bIsWeakPointer"]), bIsUObjectWrapper: getOrFalse(["PinType", "bIsUObjectWrapper"]) } this.LinkedTo = Utility.objectGet(["LinkedTo"], null, options) this.DefaultValue = getOrFalse(["DefaultValue"]) this.AutogeneratedDefaultValue = getOrFalse(["AutogeneratedDefaultValue"]) this.PersistentGuid = new Guid(getOrFalse(["PersistentGuid"])) this.bHidden = getOrFalse(["bHidden"]) this.bNotConnectable = getOrFalse(["bNotConnectable"]) this.bDefaultValueIsReadOnly = getOrFalse(["bDefaultValueIsReadOnly"]) this.bDefaultValueIsIgnored = getOrFalse(["bDefaultValueIsIgnored"]) this.bAdvancedView = getOrFalse(["bAdvancedView"]) this.bOrphanedPin = getOrFalse(["bOrphanedPin"]) } }