logs-py 2.9.6__py3-none-any.whl → 3.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of logs-py might be problematic. Click here for more details.
- LOGS/Auxiliary/DateTimeConverter.py +11 -1
- LOGS/Auxiliary/Exceptions.py +40 -4
- LOGS/Auxiliary/LOGSErrorResponse.py +4 -1
- LOGS/Auxiliary/MinimalModelGenerator.py +88 -28
- LOGS/Auxiliary/Tools.py +11 -0
- LOGS/Converter/Conversion.py +248 -0
- LOGS/Converter/Converter.py +96 -0
- LOGS/Converter/ConverterParameter.py +88 -0
- LOGS/Converter/ExportParamters.py +89 -0
- LOGS/Converter/__init__.py +13 -0
- LOGS/Entities/Bridge.py +6 -3
- LOGS/Entities/CustomField.py +96 -91
- LOGS/Entities/CustomFieldModels.py +57 -0
- LOGS/Entities/CustomFieldRelations.py +10 -0
- LOGS/Entities/CustomFieldRequestParameter.py +43 -15
- LOGS/Entities/CustomFieldValue.py +88 -0
- LOGS/Entities/CustomFieldValueConverter.py +66 -0
- LOGS/Entities/CustomType.py +187 -0
- LOGS/Entities/CustomTypeEntityType.py +11 -0
- LOGS/Entities/CustomTypeMinimal.py +8 -0
- LOGS/Entities/CustomTypeRelations.py +59 -0
- LOGS/Entities/CustomTypeRequestParameter.py +61 -0
- LOGS/Entities/CustomTypeSection.py +39 -0
- LOGS/Entities/CustomTypes.py +12 -0
- LOGS/Entities/DataSource.py +28 -14
- LOGS/Entities/Dataset.py +274 -136
- LOGS/Entities/DatasetCreator.py +23 -72
- LOGS/Entities/DatasetInfo.py +23 -2
- LOGS/Entities/DatasetModels.py +31 -0
- LOGS/Entities/DatasetRequestParameter.py +45 -32
- LOGS/Entities/Datatrack.py +74 -30
- LOGS/Entities/DatatrackFormattedTable.py +25 -0
- LOGS/Entities/DatatrackGeneric.py +34 -0
- LOGS/Entities/DatatrackImage.py +25 -0
- LOGS/Entities/DatatrackNumericArray.py +9 -39
- LOGS/Entities/DatatrackNumericMatrix.py +86 -0
- LOGS/Entities/DocumentRequestParameter.py +2 -2
- LOGS/Entities/EntitiesRequestParameter.py +2 -2
- LOGS/Entities/Experiment.py +3 -3
- LOGS/Entities/FileExcludePattern.py +8 -0
- LOGS/Entities/FormatFormat.py +22 -1
- LOGS/Entities/FormatFormatRequestParameter.py +2 -1
- LOGS/Entities/FormatFormats.py +1 -1
- LOGS/Entities/FormattedTable/DatatypeFormattedTable.py +135 -0
- LOGS/Entities/FormattedTable/DatatypeFormattedTableCell.py +108 -0
- LOGS/Entities/FormattedTable/DatatypeFormattedTableSettings.py +11 -0
- LOGS/Entities/FormattedTable/__init__.py +9 -0
- LOGS/Entities/ILiterarTypedEntity.py +19 -0
- LOGS/Entities/Instrument.py +3 -3
- LOGS/Entities/Inventories.py +12 -0
- LOGS/Entities/Inventory.py +95 -0
- LOGS/Entities/InventoryMinimal.py +20 -0
- LOGS/Entities/InventoryRelations.py +23 -0
- LOGS/Entities/InventoryRequestParameter.py +53 -0
- LOGS/Entities/LabNotebook.py +37 -0
- LOGS/Entities/LabNotebookEntry.py +47 -24
- LOGS/Entities/LabNotebookEntryContent/BasicAttribute.py +15 -0
- LOGS/Entities/LabNotebookEntryContent/EntityAttribute.py +85 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentBlockquote.py +13 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentBulletList.py +17 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentCallout.py +40 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentContentPlaceholderNode.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentConverter.py +207 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentDocument.py +8 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentEntity.py +13 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentEntityMention.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentHeading.py +33 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentHorizontalRule.py +12 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentItem.py +37 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentListItem.py +49 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentOrderedList.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentParagraph.py +13 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTable.py +17 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTableCell.py +40 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTableRow.py +8 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTaskList.py +17 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTaskListItem.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentText.py +33 -0
- LOGS/Entities/LabNotebookEntryContent/IEntryContentWithAttribute.py +23 -0
- LOGS/Entities/LabNotebookEntryContent/IEntryContentWithContent.py +38 -0
- LOGS/Entities/LabNotebookEntryContent/IEntryContentWithTextAttribute.py +16 -0
- LOGS/Entities/LabNotebookEntryContent/TextAttribute.py +46 -0
- LOGS/Entities/LabNotebookEntryContent/TextMarkAtributes.py +64 -0
- LOGS/Entities/LabNotebookEntryContent/TextMarkConverter.py +45 -0
- LOGS/Entities/LabNotebookEntryContent/TextMarks.py +71 -0
- LOGS/Entities/LabNotebookEntryContent/__init__.py +34 -0
- LOGS/Entities/LabNotebookEntryRequestParameter.py +2 -0
- LOGS/Entities/LabNotebookExperiment.py +52 -0
- LOGS/Entities/LabNotebookExperimentMinimal.py +8 -0
- LOGS/Entities/LabNotebookExperimentRequestParameter.py +49 -0
- LOGS/Entities/LabNotebookExperiments.py +16 -0
- LOGS/Entities/LabNotebookMinimal.py +19 -0
- LOGS/Entities/LabNotebookModels.py +14 -0
- LOGS/Entities/LabNotebookRequestParameter.py +43 -0
- LOGS/Entities/LabNotebooks.py +12 -0
- LOGS/Entities/Method.py +3 -3
- LOGS/Entities/ParserLog.py +4 -0
- LOGS/Entities/Person.py +2 -2
- LOGS/Entities/PersonRequestParameter.py +1 -0
- LOGS/Entities/Project.py +7 -7
- LOGS/Entities/{ProjectUserPermission.py → ProjectPersonPermission.py} +14 -4
- LOGS/Entities/Role.py +3 -3
- LOGS/Entities/RunState.py +1 -0
- LOGS/Entities/Sample.py +36 -57
- LOGS/Entities/SampleRequestParameter.py +30 -15
- LOGS/Entities/Track.py +8 -4
- LOGS/Entities/TrackData.py +11 -0
- LOGS/Entities/TrackImage.py +21 -0
- LOGS/Entities/TrackImageData.py +20 -0
- LOGS/Entities/TrackMatrix.py +28 -0
- LOGS/Entities/TrackMatrixData.py +22 -0
- LOGS/Entities/TrackTable.py +21 -0
- LOGS/Entities/TrackTableData.py +22 -0
- LOGS/Entities/TrackXY.py +5 -1
- LOGS/Entities/TrackXYComplex.py +1 -1
- LOGS/Entities/__init__.py +26 -7
- LOGS/Entity/ConnectedEntity.py +39 -1
- LOGS/Entity/Entity.py +9 -14
- LOGS/Entity/SerializeableContent.py +62 -5
- LOGS/Interfaces/IHierarchyType.py +63 -0
- LOGS/Interfaces/IPermissionedEntity.py +29 -5
- LOGS/Interfaces/IProjectBased.py +1 -1
- LOGS/Interfaces/ITypedEntity.py +69 -12
- LOGS/Interfaces/IVersionedEntity.py +39 -0
- LOGS/LOGS.py +137 -46
- LOGS/LOGSConnection.py +52 -24
- LOGS/LOGSOptions.py +8 -0
- LOGS/Parameters/Color.py +92 -0
- LOGS/Parameters/ParameterBase.py +55 -0
- LOGS/Parameters/ParameterConverter.py +24 -0
- LOGS/Parameters/ParameterElement.py +99 -0
- LOGS/Parameters/ParameterList.py +52 -0
- LOGS/Parameters/ParameterTable.py +64 -0
- LOGS/Parameters/__init__.py +13 -0
- LOGS/__init__.py +1 -0
- {logs_py-2.9.6.dist-info → logs_py-3.0.1.dist-info}/METADATA +2 -1
- logs_py-3.0.1.dist-info/RECORD +263 -0
- LOGS/Entities/CustomFieldEnums.py +0 -25
- LOGS/Entities/DatasetType.py +0 -7
- LOGS/Entities/DatasetTypeMinimal.py +0 -8
- LOGS/Entities/SampleType.py +0 -34
- LOGS/Entities/SampleTypeMinimal.py +0 -8
- LOGS/Entities/SampleTypeRequestParameter.py +0 -8
- LOGS/Entities/SampleTypes.py +0 -12
- logs_py-2.9.6.dist-info/RECORD +0 -183
- {logs_py-2.9.6.dist-info → logs_py-3.0.1.dist-info}/WHEEL +0 -0
- {logs_py-2.9.6.dist-info → logs_py-3.0.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Optional, Sequence, Union, cast
|
|
2
|
+
|
|
3
|
+
from LOGS.Auxiliary.Tools import Tools
|
|
4
|
+
from LOGS.Entities.CustomFieldModels import CustomFieldValueType
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from LOGS.Entities.CustomFieldValue import CustomFieldValue, CustomSectionValue
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CustomFieldValueConverter:
|
|
11
|
+
@classmethod
|
|
12
|
+
def convert(
|
|
13
|
+
cls,
|
|
14
|
+
value: Any,
|
|
15
|
+
fieldName: Optional[str] = None,
|
|
16
|
+
) -> Optional[Sequence[Union["CustomFieldValue", "CustomSectionValue"]]]:
|
|
17
|
+
from LOGS.Entities.CustomFieldValue import CustomFieldValue, CustomSectionValue
|
|
18
|
+
|
|
19
|
+
if value is None:
|
|
20
|
+
return None
|
|
21
|
+
|
|
22
|
+
if isinstance(value, list):
|
|
23
|
+
g = [cls.convert(v, f"{fieldName}[{i}]") for i, v in enumerate(value)]
|
|
24
|
+
return cast(Any, g)
|
|
25
|
+
|
|
26
|
+
if isinstance(value, CustomFieldValue):
|
|
27
|
+
return cast(Any, value)
|
|
28
|
+
|
|
29
|
+
if isinstance(value, dict):
|
|
30
|
+
if "type" not in value:
|
|
31
|
+
raise Exception(
|
|
32
|
+
"Field %a cannot be converted because field 'type' is missing."
|
|
33
|
+
% (fieldName)
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
t = Tools.checkAndConvert(
|
|
37
|
+
value["type"],
|
|
38
|
+
CustomFieldValueType,
|
|
39
|
+
fieldName,
|
|
40
|
+
)
|
|
41
|
+
if t == CustomFieldValueType.CustomField:
|
|
42
|
+
return cast(
|
|
43
|
+
Any, Tools.checkAndConvert(value, CustomFieldValue, fieldName)
|
|
44
|
+
)
|
|
45
|
+
elif t == CustomFieldValueType.CustomTypeSection:
|
|
46
|
+
return cast(
|
|
47
|
+
Any, Tools.checkAndConvert(value, CustomSectionValue, fieldName)
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
if isinstance(value, CustomFieldValue):
|
|
51
|
+
return cast(Any, value)
|
|
52
|
+
|
|
53
|
+
if isinstance(value, CustomSectionValue):
|
|
54
|
+
if value.content:
|
|
55
|
+
value.content = [
|
|
56
|
+
cls.convert(v, f"{fieldName}.content[{i}]")
|
|
57
|
+
for i, v in enumerate(value.content)
|
|
58
|
+
]
|
|
59
|
+
return cast(Any, value)
|
|
60
|
+
|
|
61
|
+
raise Exception(
|
|
62
|
+
"Field %a cannot contain element of type %a."
|
|
63
|
+
% (fieldName, type(value).__name__)
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
return None
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Auxiliary.Decorators import Endpoint
|
|
4
|
+
from LOGS.Auxiliary.MinimalModelGenerator import MinimalFromList, MinimalFromSingle
|
|
5
|
+
from LOGS.Entities.CustomField import CustomField
|
|
6
|
+
from LOGS.Entities.CustomTypeEntityType import CustomTypeEntityType
|
|
7
|
+
from LOGS.Entities.CustomTypeRelations import CustomTypeRelations
|
|
8
|
+
from LOGS.Entities.CustomTypeSection import CustomTypeSection
|
|
9
|
+
from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
10
|
+
from LOGS.Interfaces.ICreationRecord import ICreationRecord
|
|
11
|
+
from LOGS.Interfaces.IHierarchyType import IHierarchyType
|
|
12
|
+
from LOGS.Interfaces.IModificationRecord import IModificationRecord
|
|
13
|
+
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
14
|
+
from LOGS.Interfaces.IPermissionedEntity import GenericPermissionEntity
|
|
15
|
+
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
16
|
+
from LOGS.Interfaces.ISoftDeletable import ISoftDeletable
|
|
17
|
+
from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from LOGS.Entities.CustomTypeMinimal import CustomTypeMinimal
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@Endpoint("types")
|
|
24
|
+
class CustomType(
|
|
25
|
+
IEntityWithIntId,
|
|
26
|
+
GenericPermissionEntity,
|
|
27
|
+
INamedEntity,
|
|
28
|
+
IUniqueEntity,
|
|
29
|
+
ICreationRecord,
|
|
30
|
+
IModificationRecord,
|
|
31
|
+
ISoftDeletable,
|
|
32
|
+
IRelatedEntity[CustomTypeRelations],
|
|
33
|
+
IHierarchyType,
|
|
34
|
+
):
|
|
35
|
+
_relationType = CustomTypeRelations
|
|
36
|
+
_noSerialize = ["customFields"]
|
|
37
|
+
|
|
38
|
+
_description: Optional[str] = None
|
|
39
|
+
_entityType: Optional[CustomTypeEntityType] = None
|
|
40
|
+
_hasRestrictedAddPermission: Optional[bool] = None
|
|
41
|
+
_hasRestrictedEditPermission: Optional[bool] = None
|
|
42
|
+
_hasRestrictedReadPermission: Optional[bool] = None
|
|
43
|
+
_sections: Optional[List[CustomTypeSection]] = None
|
|
44
|
+
_isEnabled: Optional[bool] = None
|
|
45
|
+
_relations: Optional[CustomTypeRelations] = None
|
|
46
|
+
_inventoryName: Optional[str] = None
|
|
47
|
+
_inventoryDescription: Optional[str] = None
|
|
48
|
+
_isHierarchyRoot: Optional[bool] = None
|
|
49
|
+
_rootHierarchy: Optional["CustomTypeMinimal"] = None
|
|
50
|
+
_parentTypes: Optional[List["CustomTypeMinimal"]] = None
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def description(self) -> Optional[str]:
|
|
54
|
+
return self._description
|
|
55
|
+
|
|
56
|
+
@description.setter
|
|
57
|
+
def description(self, value):
|
|
58
|
+
self._description = self.checkAndConvertNullable(value, str, "description")
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def entityType(self) -> Optional[CustomTypeEntityType]:
|
|
62
|
+
return self._entityType
|
|
63
|
+
|
|
64
|
+
@entityType.setter
|
|
65
|
+
def entityType(self, value):
|
|
66
|
+
self._entityType = self.checkAndConvertNullable(
|
|
67
|
+
value, CustomTypeEntityType, "entityType"
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def hasRestrictedAddPermission(self) -> Optional[bool]:
|
|
72
|
+
return self._hasRestrictedAddPermission
|
|
73
|
+
|
|
74
|
+
@hasRestrictedAddPermission.setter
|
|
75
|
+
def hasRestrictedAddPermission(self, value):
|
|
76
|
+
self._hasRestrictedAddPermission = self.checkAndConvertNullable(
|
|
77
|
+
value, bool, "hasRestrictedAddPermission"
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def hasRestrictedEditPermission(self) -> Optional[bool]:
|
|
82
|
+
return self._hasRestrictedEditPermission
|
|
83
|
+
|
|
84
|
+
@hasRestrictedEditPermission.setter
|
|
85
|
+
def hasRestrictedEditPermission(self, value):
|
|
86
|
+
self._hasRestrictedEditPermission = self.checkAndConvertNullable(
|
|
87
|
+
value, bool, "hasRestrictedEditPermission"
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def hasRestrictedReadPermission(self) -> Optional[bool]:
|
|
92
|
+
return self._hasRestrictedReadPermission
|
|
93
|
+
|
|
94
|
+
@hasRestrictedReadPermission.setter
|
|
95
|
+
def hasRestrictedReadPermission(self, value):
|
|
96
|
+
self._hasRestrictedReadPermission = self.checkAndConvertNullable(
|
|
97
|
+
value, bool, "hasRestrictedReadPermission"
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
@property
|
|
101
|
+
def sections(self) -> Optional[List[CustomTypeSection]]:
|
|
102
|
+
return self._sections
|
|
103
|
+
|
|
104
|
+
@sections.setter
|
|
105
|
+
def sections(self, value):
|
|
106
|
+
self._sections = self.checkListAndConvertNullable(
|
|
107
|
+
value, CustomTypeSection, "sections"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def isEnabled(self) -> Optional[bool]:
|
|
112
|
+
return self._isEnabled
|
|
113
|
+
|
|
114
|
+
@isEnabled.setter
|
|
115
|
+
def isEnabled(self, value):
|
|
116
|
+
self._isEnabled = self.checkAndConvertNullable(value, bool, "isEnabled")
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def relations(self) -> Optional[CustomTypeRelations]:
|
|
120
|
+
return self._relations
|
|
121
|
+
|
|
122
|
+
@relations.setter
|
|
123
|
+
def relations(self, value):
|
|
124
|
+
self._relations = self.checkAndConvertNullable(
|
|
125
|
+
value, CustomTypeRelations, "relations"
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def inventoryName(self) -> Optional[str]:
|
|
130
|
+
return self._inventoryName
|
|
131
|
+
|
|
132
|
+
@inventoryName.setter
|
|
133
|
+
def inventoryName(self, value):
|
|
134
|
+
self._inventoryName = self.checkAndConvertNullable(value, str, "inventoryName")
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def inventoryDescription(self) -> Optional[str]:
|
|
138
|
+
return self._inventoryDescription
|
|
139
|
+
|
|
140
|
+
@inventoryDescription.setter
|
|
141
|
+
def inventoryDescription(self, value):
|
|
142
|
+
self._inventoryDescription = self.checkAndConvertNullable(
|
|
143
|
+
value, str, "inventoryDescription"
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def isHierarchyRoot(self) -> Optional[bool]:
|
|
148
|
+
return self._isHierarchyRoot
|
|
149
|
+
|
|
150
|
+
@isHierarchyRoot.setter
|
|
151
|
+
def isHierarchyRoot(self, value):
|
|
152
|
+
self._isHierarchyRoot = self.checkAndConvertNullable(
|
|
153
|
+
value, bool, "isHierarchyRoot"
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def rootHierarchy(self) -> Optional["CustomTypeMinimal"]:
|
|
158
|
+
return self._rootHierarchy
|
|
159
|
+
|
|
160
|
+
@rootHierarchy.setter
|
|
161
|
+
def rootHierarchy(self, value):
|
|
162
|
+
self._rootHierarchy = MinimalFromSingle(
|
|
163
|
+
value, "CustomTypeMinimal", "rootHierarchy", self.connection
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def parentTypes(self) -> Optional[List["CustomTypeMinimal"]]:
|
|
168
|
+
return self._parentTypes
|
|
169
|
+
|
|
170
|
+
@parentTypes.setter
|
|
171
|
+
def parentTypes(self, value):
|
|
172
|
+
self._parentTypes = MinimalFromList(
|
|
173
|
+
value, "CustomTypeMinimal", "parentTypes", self.connection
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
@property
|
|
177
|
+
def customFields(self) -> List[CustomField]:
|
|
178
|
+
if self.sections is None:
|
|
179
|
+
return []
|
|
180
|
+
|
|
181
|
+
return [
|
|
182
|
+
field
|
|
183
|
+
for section in self.sections
|
|
184
|
+
if section.customFields is not None
|
|
185
|
+
for field in section.customFields
|
|
186
|
+
if field is not None
|
|
187
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from LOGS.Auxiliary.Decorators import FullModel
|
|
2
|
+
from LOGS.Entities.CustomType import CustomType
|
|
3
|
+
from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@FullModel(CustomType)
|
|
7
|
+
class CustomTypeMinimal(EntityMinimalWithIntId[CustomType]):
|
|
8
|
+
pass
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.EntityRelation import EntityRelation
|
|
4
|
+
from LOGS.Entity.EntityRelations import EntityRelations
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from LOGS.Entities.Dataset import Dataset
|
|
8
|
+
from LOGS.Entities.Person import Person
|
|
9
|
+
from LOGS.Entities.Project import Project
|
|
10
|
+
from LOGS.Entities.Sample import Sample
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CustomTypeRelations(EntityRelations):
|
|
14
|
+
"""Relations of a CustomType with other entities"""
|
|
15
|
+
|
|
16
|
+
_persons: Optional[EntityRelation["Person"]] = None
|
|
17
|
+
_datasets: Optional[EntityRelation["Dataset"]] = None
|
|
18
|
+
_samples: Optional[EntityRelation["Sample"]] = None
|
|
19
|
+
_projects: Optional[EntityRelation["Project"]] = None
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def persons(self) -> Optional[EntityRelation["Person"]]:
|
|
23
|
+
return self._persons
|
|
24
|
+
|
|
25
|
+
@persons.setter
|
|
26
|
+
def persons(self, value):
|
|
27
|
+
from LOGS.Entities.Persons import Persons
|
|
28
|
+
|
|
29
|
+
self._persons = self._entityConverter(value, Persons)
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def datasets(self) -> Optional[EntityRelation["Dataset"]]:
|
|
33
|
+
return self._datasets
|
|
34
|
+
|
|
35
|
+
@datasets.setter
|
|
36
|
+
def datasets(self, value):
|
|
37
|
+
from LOGS.Entities.Datasets import Datasets
|
|
38
|
+
|
|
39
|
+
self._datasets = self._entityConverter(value, Datasets)
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def samples(self) -> Optional[EntityRelation["Sample"]]:
|
|
43
|
+
return self._samples
|
|
44
|
+
|
|
45
|
+
@samples.setter
|
|
46
|
+
def samples(self, value):
|
|
47
|
+
from LOGS.Entities.Samples import Samples
|
|
48
|
+
|
|
49
|
+
self._samples = self._entityConverter(value, Samples)
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def projects(self) -> Optional[EntityRelation["Project"]]:
|
|
53
|
+
return self._projects
|
|
54
|
+
|
|
55
|
+
@projects.setter
|
|
56
|
+
def projects(self, value):
|
|
57
|
+
from LOGS.Entities.Projects import Projects
|
|
58
|
+
|
|
59
|
+
self._projects = self._entityConverter(value, Projects)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from LOGS.Entities.CustomTypeEntityType import CustomTypeEntityType
|
|
6
|
+
from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
|
|
7
|
+
from LOGS.Interfaces.ICreationRecord import ICreationRecordRequest
|
|
8
|
+
from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
|
|
9
|
+
from LOGS.Interfaces.INamedEntity import INamedEntityRequest
|
|
10
|
+
from LOGS.Interfaces.IPaginationRequest import IPaginationRequest
|
|
11
|
+
from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
|
|
12
|
+
from LOGS.Interfaces.IRelationRequest import IRelationRequest
|
|
13
|
+
from LOGS.Interfaces.ISoftDeletable import ISoftDeletableRequest
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class CustomTypeOrder(Enum):
|
|
17
|
+
ID_ASC = "ID_ASC"
|
|
18
|
+
ID_DESC = "ID_DESC"
|
|
19
|
+
NAME_ASC = "NAME_ASC"
|
|
20
|
+
NAME_DESC = "NAME_DESC"
|
|
21
|
+
CREATED_ON_ASC = "CREATED_ON_ASC"
|
|
22
|
+
CREATED_ON_DESC = "CREATED_ON_DESC"
|
|
23
|
+
CREATED_BY_ASC = "CREATED_BY_ASC"
|
|
24
|
+
CREATED_BY_DESC = "CREATED_BY_DESC"
|
|
25
|
+
MODIFIED_ON_ASC = "MODIFIED_ON_ASC"
|
|
26
|
+
MODIFIED_ON_DESC = "MODIFIED_ON_DESC"
|
|
27
|
+
MODIFIED_BY_ASC = "MODIFIED_BY_ASC"
|
|
28
|
+
MODIFIED_BY_DESC = "MODIFIED_BY_DESC"
|
|
29
|
+
NUMBER_OF_ITEMS_ASC = "NUMBER_OF_ITEMS_ASC"
|
|
30
|
+
NUMBER_OF_ITEMS_DESC = "NUMBER_OF_ITEMS_DESC"
|
|
31
|
+
INVENTORY_NAME_ASC = "INVENTORY_NAME_ASC"
|
|
32
|
+
INVENTORY_NAME_DESC = "INVENTORY_NAME_DESC"
|
|
33
|
+
LAYOUT_ASC = "LAYOUT_ASC"
|
|
34
|
+
LAYOUT_DESC = "LAYOUT_DESC"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass
|
|
38
|
+
class CustomTypeRequestParameter(
|
|
39
|
+
EntityRequestParameter[CustomTypeOrder],
|
|
40
|
+
IRelationRequest,
|
|
41
|
+
IPaginationRequest,
|
|
42
|
+
IPermissionedEntityRequest,
|
|
43
|
+
ICreationRecordRequest,
|
|
44
|
+
IModificationRecordRequest,
|
|
45
|
+
ISoftDeletableRequest,
|
|
46
|
+
INamedEntityRequest,
|
|
47
|
+
):
|
|
48
|
+
excludeDisabled: Optional[bool] = None
|
|
49
|
+
isEnabled: Optional[bool] = None
|
|
50
|
+
customFieldIds: Optional[List[int]] = None
|
|
51
|
+
entityTypes: Optional[List[CustomTypeEntityType]] = None
|
|
52
|
+
extendSearchToInventoryItems: Optional[bool] = None
|
|
53
|
+
parentTypeIds: Optional[List[int]] = None
|
|
54
|
+
hasRestrictedAddPermission: Optional[bool] = None
|
|
55
|
+
hasRestrictedEditPermission: Optional[bool] = None
|
|
56
|
+
hasRestrictedReadPermission: Optional[bool] = None
|
|
57
|
+
rootHierarchyIds: Optional[List[int]] = None
|
|
58
|
+
isInventory: Optional[bool] = None
|
|
59
|
+
isHierarchyRoot: Optional[bool] = None
|
|
60
|
+
inventoryNames: Optional[List[str]] = None
|
|
61
|
+
excludeNonInventories: Optional[bool] = None
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entities.CustomField import CustomField
|
|
4
|
+
from LOGS.Entities.ILiterarTypedEntity import ILiterarTypedEntity
|
|
5
|
+
from LOGS.Entity.SerializeableContent import SerializeableContent
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CustomTypeSection(SerializeableContent, ILiterarTypedEntity):
|
|
9
|
+
_name: Optional[str] = None
|
|
10
|
+
_isFolded: Optional[bool] = None
|
|
11
|
+
_customFields: Optional[List[CustomField]] = None
|
|
12
|
+
|
|
13
|
+
_type = "CustomTypeSection"
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def name(self) -> Optional[str]:
|
|
17
|
+
return self._name
|
|
18
|
+
|
|
19
|
+
@name.setter
|
|
20
|
+
def name(self, value):
|
|
21
|
+
self._name = self.checkAndConvertNullable(value, str, "name")
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def isFolded(self) -> Optional[bool]:
|
|
25
|
+
return self._isFolded
|
|
26
|
+
|
|
27
|
+
@isFolded.setter
|
|
28
|
+
def isFolded(self, value):
|
|
29
|
+
self._isFolded = self.checkAndConvertNullable(value, bool, "isFolded")
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def customFields(self) -> Optional[List[CustomField]]:
|
|
33
|
+
return self._customFields
|
|
34
|
+
|
|
35
|
+
@customFields.setter
|
|
36
|
+
def customFields(self, value):
|
|
37
|
+
self._customFields = self.checkListAndConvertNullable(
|
|
38
|
+
value, CustomField, "customFields"
|
|
39
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from LOGS.Auxiliary.Decorators import Endpoint
|
|
2
|
+
from LOGS.Entities.CustomType import CustomType
|
|
3
|
+
from LOGS.Entities.CustomTypeRequestParameter import CustomTypeRequestParameter
|
|
4
|
+
from LOGS.Entity.EntityIterator import EntityIterator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@Endpoint("types")
|
|
8
|
+
class CustomTypes(EntityIterator[CustomType, CustomTypeRequestParameter]):
|
|
9
|
+
"""LOGS connected CustomTypes iterator"""
|
|
10
|
+
|
|
11
|
+
_generatorType = CustomType
|
|
12
|
+
_parameterType = CustomTypeRequestParameter
|
LOGS/Entities/DataSource.py
CHANGED
|
@@ -6,6 +6,7 @@ from LOGS.Auxiliary.Decorators import Endpoint
|
|
|
6
6
|
from LOGS.Auxiliary.Exceptions import EntityAPIException
|
|
7
7
|
from LOGS.Auxiliary.MinimalModelGenerator import (
|
|
8
8
|
BridgeMinimalFromDict,
|
|
9
|
+
FormatMinimalFromDict,
|
|
9
10
|
InstrumentMinimalFromDict,
|
|
10
11
|
MethodMinimalFromDict,
|
|
11
12
|
MinimalFromList,
|
|
@@ -13,6 +14,7 @@ from LOGS.Auxiliary.MinimalModelGenerator import (
|
|
|
13
14
|
from LOGS.Entities.BridgeMinimal import BridgeMinimal
|
|
14
15
|
from LOGS.Entities.DataSourceRelations import DataSourceRelations
|
|
15
16
|
from LOGS.Entities.DataSourceStatus import DataSourceStatus
|
|
17
|
+
from LOGS.Entities.FileExcludePattern import FileExcludePattern
|
|
16
18
|
from LOGS.Entities.Format import Format
|
|
17
19
|
from LOGS.Entities.FormatMinimal import FormatMinimal
|
|
18
20
|
from LOGS.Entities.InstrumentMinimal import InstrumentMinimal
|
|
@@ -22,13 +24,13 @@ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
|
22
24
|
from LOGS.Interfaces.ICreationRecord import ICreationRecord
|
|
23
25
|
from LOGS.Interfaces.IModificationRecord import IModificationRecord
|
|
24
26
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
25
|
-
from LOGS.Interfaces.IPermissionedEntity import
|
|
27
|
+
from LOGS.Interfaces.IPermissionedEntity import GenericPermissionEntity
|
|
26
28
|
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
27
29
|
from LOGS.LOGSConnection import LOGSConnection
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
class DataSourceType(Enum):
|
|
31
|
-
|
|
33
|
+
Crawler = "Crawler"
|
|
32
34
|
IconNMR = "IconNMR"
|
|
33
35
|
|
|
34
36
|
|
|
@@ -39,13 +41,15 @@ class DataSource(
|
|
|
39
41
|
ICreationRecord,
|
|
40
42
|
IModificationRecord,
|
|
41
43
|
IRelatedEntity[DataSourceRelations],
|
|
42
|
-
|
|
44
|
+
GenericPermissionEntity,
|
|
43
45
|
):
|
|
44
|
-
_relationType =
|
|
46
|
+
_relationType = DataSourceRelations
|
|
47
|
+
|
|
48
|
+
_relations: DataSourceRelations
|
|
45
49
|
|
|
46
50
|
_type: Optional[DataSourceType]
|
|
47
51
|
_bridge: Optional[BridgeMinimal]
|
|
48
|
-
|
|
52
|
+
_format: Optional[FormatMinimal]
|
|
49
53
|
_customImport: Optional[EntityMinimalWithStrId]
|
|
50
54
|
_enabled: Optional[bool]
|
|
51
55
|
_bridgeId: Optional[int]
|
|
@@ -55,8 +59,8 @@ class DataSource(
|
|
|
55
59
|
_method: Optional[MethodMinimal]
|
|
56
60
|
_instrument: Optional[InstrumentMinimal]
|
|
57
61
|
_cutoffDate: Optional[datetime]
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
_fileExcludePatterns: Optional[List[FileExcludePattern]]
|
|
63
|
+
_formatDefinitions: Optional[Dict[str, Format]]
|
|
60
64
|
_status: Optional[DataSourceStatus]
|
|
61
65
|
|
|
62
66
|
def __init__(
|
|
@@ -69,7 +73,7 @@ class DataSource(
|
|
|
69
73
|
|
|
70
74
|
self._type = None
|
|
71
75
|
self._bridge = None
|
|
72
|
-
self.
|
|
76
|
+
self._format = None
|
|
73
77
|
self._customImport = None
|
|
74
78
|
self._enabled = None
|
|
75
79
|
self._bridgeId = None
|
|
@@ -80,7 +84,6 @@ class DataSource(
|
|
|
80
84
|
self._instrument = None
|
|
81
85
|
self._cutoffDate = None
|
|
82
86
|
self._customImportId = None
|
|
83
|
-
self._parserDefinitions = None
|
|
84
87
|
self._status = None
|
|
85
88
|
|
|
86
89
|
super().__init__(ref=ref, id=id, connection=connection)
|
|
@@ -154,12 +157,23 @@ class DataSource(
|
|
|
154
157
|
def cutoffDate(self, value):
|
|
155
158
|
self._cutoffDate = self.checkAndConvertNullable(value, datetime, "cutoffDate")
|
|
156
159
|
|
|
160
|
+
@property
|
|
161
|
+
def fileExcludePatterns(self) -> Optional[List[FileExcludePattern]]:
|
|
162
|
+
return self._fileExcludePatterns
|
|
163
|
+
|
|
164
|
+
@fileExcludePatterns.setter
|
|
165
|
+
def fileExcludePatterns(self, value):
|
|
166
|
+
self._fileExcludePatterns = self.checkListAndConvertNullable(
|
|
167
|
+
value, FileExcludePattern, "fileExcludePatterns"
|
|
168
|
+
)
|
|
169
|
+
|
|
157
170
|
@property
|
|
158
171
|
def customImportId(self) -> Optional[str]:
|
|
159
172
|
return self._customImportId
|
|
160
173
|
|
|
161
174
|
@customImportId.setter
|
|
162
175
|
def customImportId(self, value):
|
|
176
|
+
print("customImportId", value)
|
|
163
177
|
self._customImportId = self.checkAndConvertNullable(
|
|
164
178
|
value, str, "customImportId"
|
|
165
179
|
)
|
|
@@ -189,12 +203,12 @@ class DataSource(
|
|
|
189
203
|
self._bridge = BridgeMinimalFromDict(value, "bridge", self.connection)
|
|
190
204
|
|
|
191
205
|
@property
|
|
192
|
-
def
|
|
193
|
-
return self.
|
|
206
|
+
def format(self) -> Optional[FormatMinimal]:
|
|
207
|
+
return self._format
|
|
194
208
|
|
|
195
|
-
@
|
|
196
|
-
def
|
|
197
|
-
self.
|
|
209
|
+
@format.setter
|
|
210
|
+
def format(self, value):
|
|
211
|
+
self._format = FormatMinimalFromDict(value, "format", self.connection)
|
|
198
212
|
|
|
199
213
|
@property
|
|
200
214
|
def customImport(self) -> Optional[EntityMinimalWithStrId]:
|