logs-py 4.0.7__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.
Files changed (251) hide show
  1. LOGS/Auxiliary/CheckClassName.py +1075 -0
  2. LOGS/Auxiliary/Constants.py +99 -0
  3. LOGS/Auxiliary/CustomEntityClassGenerator.py +254 -0
  4. LOGS/Auxiliary/CustomFieldClassGenerator.py +115 -0
  5. LOGS/Auxiliary/CustomFieldValueTypeChecker.py +168 -0
  6. LOGS/Auxiliary/CustomSectionClassGenerator.py +113 -0
  7. LOGS/Auxiliary/CustomTypeClassGenerator.py +147 -0
  8. LOGS/Auxiliary/DateTimeConverter.py +66 -0
  9. LOGS/Auxiliary/Decorators.py +109 -0
  10. LOGS/Auxiliary/Exceptions.py +341 -0
  11. LOGS/Auxiliary/LOGSErrorResponse.py +89 -0
  12. LOGS/Auxiliary/MinimalModelGenerator.py +236 -0
  13. LOGS/Auxiliary/ParameterHelper.py +56 -0
  14. LOGS/Auxiliary/ReplaceMessage.py +13 -0
  15. LOGS/Auxiliary/Tools.py +432 -0
  16. LOGS/Auxiliary/__init__.py +15 -0
  17. LOGS/Converter/Conversion.py +248 -0
  18. LOGS/Converter/Converter.py +96 -0
  19. LOGS/Converter/ConverterParameter.py +88 -0
  20. LOGS/Converter/DateTimeRange.py +58 -0
  21. LOGS/Converter/ExportParameters.py +89 -0
  22. LOGS/Converter/__init__.py +13 -0
  23. LOGS/Entities/Attachment.py +84 -0
  24. LOGS/Entities/AttachmentMinimal.py +8 -0
  25. LOGS/Entities/AttachmentRequestParameter.py +42 -0
  26. LOGS/Entities/Attachments.py +53 -0
  27. LOGS/Entities/AutoloadFileInfo.py +12 -0
  28. LOGS/Entities/AutoloadStatusError.py +7 -0
  29. LOGS/Entities/AxisNaming.py +33 -0
  30. LOGS/Entities/AxisZoom.py +33 -0
  31. LOGS/Entities/Bridge.py +165 -0
  32. LOGS/Entities/BridgeClientInfo.py +93 -0
  33. LOGS/Entities/BridgeMinimal.py +8 -0
  34. LOGS/Entities/BridgeRequestParameter.py +49 -0
  35. LOGS/Entities/BridgeType.py +7 -0
  36. LOGS/Entities/Bridges.py +12 -0
  37. LOGS/Entities/CustomField.py +243 -0
  38. LOGS/Entities/CustomFieldMinimal.py +8 -0
  39. LOGS/Entities/CustomFieldModels.py +111 -0
  40. LOGS/Entities/CustomFieldRequestParameter.py +69 -0
  41. LOGS/Entities/CustomFieldSearchQuery.py +40 -0
  42. LOGS/Entities/CustomFields.py +12 -0
  43. LOGS/Entities/CustomType.py +212 -0
  44. LOGS/Entities/CustomTypeMinimal.py +8 -0
  45. LOGS/Entities/CustomTypeRequestParameter.py +60 -0
  46. LOGS/Entities/CustomTypeSection.py +63 -0
  47. LOGS/Entities/CustomTypes.py +12 -0
  48. LOGS/Entities/DataFormat.py +97 -0
  49. LOGS/Entities/DataFormatInstrument.py +18 -0
  50. LOGS/Entities/DataFormatInstrumentMinimal.py +8 -0
  51. LOGS/Entities/DataFormatInstrumentRequestParameter.py +17 -0
  52. LOGS/Entities/DataFormatInstruments.py +16 -0
  53. LOGS/Entities/DataFormatMinimal.py +18 -0
  54. LOGS/Entities/DataFormatRequestParameter.py +21 -0
  55. LOGS/Entities/DataFormats.py +12 -0
  56. LOGS/Entities/DataSource.py +218 -0
  57. LOGS/Entities/DataSourceConnectionStatus.py +12 -0
  58. LOGS/Entities/DataSourceMinimal.py +8 -0
  59. LOGS/Entities/DataSourceRequestParameter.py +57 -0
  60. LOGS/Entities/DataSourceStatus.py +108 -0
  61. LOGS/Entities/DataSourceStatusIterator.py +16 -0
  62. LOGS/Entities/DataSourceStatusRequestParameter.py +31 -0
  63. LOGS/Entities/DataSources.py +12 -0
  64. LOGS/Entities/Dataset.py +439 -0
  65. LOGS/Entities/DatasetBase.py +196 -0
  66. LOGS/Entities/DatasetCreator.py +148 -0
  67. LOGS/Entities/DatasetInfo.py +147 -0
  68. LOGS/Entities/DatasetMatchTypes.py +157 -0
  69. LOGS/Entities/DatasetMatching.py +196 -0
  70. LOGS/Entities/DatasetMinimal.py +8 -0
  71. LOGS/Entities/DatasetModels.py +33 -0
  72. LOGS/Entities/DatasetRequestParameter.py +92 -0
  73. LOGS/Entities/DatasetTemplate.py +23 -0
  74. LOGS/Entities/DatasetUploadParameter.py +14 -0
  75. LOGS/Entities/Datasets.py +142 -0
  76. LOGS/Entities/Datatrack.py +179 -0
  77. LOGS/Entities/DatatrackFormattedTable.py +25 -0
  78. LOGS/Entities/DatatrackGeneric.py +34 -0
  79. LOGS/Entities/DatatrackImage.py +25 -0
  80. LOGS/Entities/DatatrackNumericArray.py +30 -0
  81. LOGS/Entities/DatatrackNumericMatrix.py +98 -0
  82. LOGS/Entities/Entities.py +71 -0
  83. LOGS/Entities/EntitiesRequestParameter.py +18 -0
  84. LOGS/Entities/EntityOriginWriteModelWithId.py +15 -0
  85. LOGS/Entities/FileEntry.py +138 -0
  86. LOGS/Entities/FileExcludePattern.py +8 -0
  87. LOGS/Entities/FormatMetaData.py +56 -0
  88. LOGS/Entities/FormattedTable/DatatypeFormattedTable.py +135 -0
  89. LOGS/Entities/FormattedTable/DatatypeFormattedTableCell.py +108 -0
  90. LOGS/Entities/FormattedTable/DatatypeFormattedTableSettings.py +11 -0
  91. LOGS/Entities/FormattedTable/__init__.py +9 -0
  92. LOGS/Entities/HierarchyLeaf.py +15 -0
  93. LOGS/Entities/HierarchyNode.py +40 -0
  94. LOGS/Entities/ILiteraryTypedEntity.py +19 -0
  95. LOGS/Entities/InventoryItem.py +102 -0
  96. LOGS/Entities/InventoryItemMinimal.py +25 -0
  97. LOGS/Entities/InventoryItemRequestParameter.py +58 -0
  98. LOGS/Entities/InventoryItems.py +12 -0
  99. LOGS/Entities/LabNotebook.py +33 -0
  100. LOGS/Entities/LabNotebookEntries.py +16 -0
  101. LOGS/Entities/LabNotebookEntry.py +106 -0
  102. LOGS/Entities/LabNotebookEntryContent/BasicAttribute.py +15 -0
  103. LOGS/Entities/LabNotebookEntryContent/EntityAttribute.py +85 -0
  104. LOGS/Entities/LabNotebookEntryContent/EntryContentBlockquote.py +13 -0
  105. LOGS/Entities/LabNotebookEntryContent/EntryContentBulletList.py +17 -0
  106. LOGS/Entities/LabNotebookEntryContent/EntryContentCallout.py +40 -0
  107. LOGS/Entities/LabNotebookEntryContent/EntryContentContentPlaceholderNode.py +31 -0
  108. LOGS/Entities/LabNotebookEntryContent/EntryContentConverter.py +207 -0
  109. LOGS/Entities/LabNotebookEntryContent/EntryContentDocument.py +8 -0
  110. LOGS/Entities/LabNotebookEntryContent/EntryContentEntity.py +13 -0
  111. LOGS/Entities/LabNotebookEntryContent/EntryContentEntityMention.py +31 -0
  112. LOGS/Entities/LabNotebookEntryContent/EntryContentHeading.py +33 -0
  113. LOGS/Entities/LabNotebookEntryContent/EntryContentHorizontalRule.py +12 -0
  114. LOGS/Entities/LabNotebookEntryContent/EntryContentItem.py +37 -0
  115. LOGS/Entities/LabNotebookEntryContent/EntryContentListItem.py +49 -0
  116. LOGS/Entities/LabNotebookEntryContent/EntryContentOrderedList.py +31 -0
  117. LOGS/Entities/LabNotebookEntryContent/EntryContentParagraph.py +13 -0
  118. LOGS/Entities/LabNotebookEntryContent/EntryContentTable.py +17 -0
  119. LOGS/Entities/LabNotebookEntryContent/EntryContentTableCell.py +40 -0
  120. LOGS/Entities/LabNotebookEntryContent/EntryContentTableRow.py +8 -0
  121. LOGS/Entities/LabNotebookEntryContent/EntryContentTaskList.py +17 -0
  122. LOGS/Entities/LabNotebookEntryContent/EntryContentTaskListItem.py +31 -0
  123. LOGS/Entities/LabNotebookEntryContent/EntryContentText.py +33 -0
  124. LOGS/Entities/LabNotebookEntryContent/IEntryContentWithAttribute.py +23 -0
  125. LOGS/Entities/LabNotebookEntryContent/IEntryContentWithContent.py +38 -0
  126. LOGS/Entities/LabNotebookEntryContent/IEntryContentWithTextAttribute.py +16 -0
  127. LOGS/Entities/LabNotebookEntryContent/TextAttribute.py +46 -0
  128. LOGS/Entities/LabNotebookEntryContent/TextMarkAtributes.py +64 -0
  129. LOGS/Entities/LabNotebookEntryContent/TextMarkConverter.py +45 -0
  130. LOGS/Entities/LabNotebookEntryContent/TextMarks.py +71 -0
  131. LOGS/Entities/LabNotebookEntryContent/__init__.py +34 -0
  132. LOGS/Entities/LabNotebookEntryMinimal.py +8 -0
  133. LOGS/Entities/LabNotebookEntryRequestParameter.py +59 -0
  134. LOGS/Entities/LabNotebookExperiment.py +58 -0
  135. LOGS/Entities/LabNotebookExperimentMinimal.py +8 -0
  136. LOGS/Entities/LabNotebookExperimentRequestParameter.py +52 -0
  137. LOGS/Entities/LabNotebookExperiments.py +16 -0
  138. LOGS/Entities/LabNotebookMinimal.py +8 -0
  139. LOGS/Entities/LabNotebookModels.py +14 -0
  140. LOGS/Entities/LabNotebookRequestParameter.py +42 -0
  141. LOGS/Entities/LabNotebookTemplate.py +42 -0
  142. LOGS/Entities/LabNotebookTemplateMinimal.py +8 -0
  143. LOGS/Entities/LabNotebookTemplateRequestParameter.py +38 -0
  144. LOGS/Entities/LabNotebookTemplates.py +16 -0
  145. LOGS/Entities/LabNotebooks.py +12 -0
  146. LOGS/Entities/Method.py +66 -0
  147. LOGS/Entities/MethodMinimal.py +8 -0
  148. LOGS/Entities/MethodRequestParameter.py +16 -0
  149. LOGS/Entities/Methods.py +12 -0
  150. LOGS/Entities/Origin.py +53 -0
  151. LOGS/Entities/OriginMinimal.py +8 -0
  152. LOGS/Entities/OriginRequestParameter.py +28 -0
  153. LOGS/Entities/Origins.py +12 -0
  154. LOGS/Entities/ParserLog.py +49 -0
  155. LOGS/Entities/Permission.py +9 -0
  156. LOGS/Entities/Person.py +145 -0
  157. LOGS/Entities/PersonCategory.py +12 -0
  158. LOGS/Entities/PersonMinimal.py +8 -0
  159. LOGS/Entities/PersonRequestParameter.py +58 -0
  160. LOGS/Entities/Persons.py +12 -0
  161. LOGS/Entities/Project.py +52 -0
  162. LOGS/Entities/ProjectMinimal.py +8 -0
  163. LOGS/Entities/ProjectPersonPermission.py +102 -0
  164. LOGS/Entities/ProjectRequestParameter.py +58 -0
  165. LOGS/Entities/Projects.py +12 -0
  166. LOGS/Entities/Role.py +94 -0
  167. LOGS/Entities/RoleMinimal.py +8 -0
  168. LOGS/Entities/RoleRequestParameter.py +40 -0
  169. LOGS/Entities/Roles.py +12 -0
  170. LOGS/Entities/RunState.py +9 -0
  171. LOGS/Entities/Sample.py +53 -0
  172. LOGS/Entities/SampleMinimal.py +8 -0
  173. LOGS/Entities/SampleRequestParameter.py +54 -0
  174. LOGS/Entities/Samples.py +12 -0
  175. LOGS/Entities/SharedContent.py +87 -0
  176. LOGS/Entities/SharedContentMinimal.py +8 -0
  177. LOGS/Entities/SharedContentRequestParameter.py +38 -0
  178. LOGS/Entities/SharedContents.py +12 -0
  179. LOGS/Entities/Signature.py +60 -0
  180. LOGS/Entities/Track.py +93 -0
  181. LOGS/Entities/TrackData.py +20 -0
  182. LOGS/Entities/TrackImage.py +21 -0
  183. LOGS/Entities/TrackImageData.py +20 -0
  184. LOGS/Entities/TrackMatrix.py +28 -0
  185. LOGS/Entities/TrackMatrixData.py +22 -0
  186. LOGS/Entities/TrackSettings.py +55 -0
  187. LOGS/Entities/TrackTable.py +21 -0
  188. LOGS/Entities/TrackTableData.py +22 -0
  189. LOGS/Entities/TrackXY.py +40 -0
  190. LOGS/Entities/TrackXYComplex.py +51 -0
  191. LOGS/Entities/TrackXYComplexData.py +50 -0
  192. LOGS/Entities/TrackXYData.py +31 -0
  193. LOGS/Entities/Vendor.py +40 -0
  194. LOGS/Entities/VendorMinimal.py +8 -0
  195. LOGS/Entities/VendorRequestParameter.py +17 -0
  196. LOGS/Entities/Vendors.py +12 -0
  197. LOGS/Entities/__init__.py +118 -0
  198. LOGS/Entity/ConnectedEntity.py +170 -0
  199. LOGS/Entity/Entity.py +203 -0
  200. LOGS/Entity/EntityConnector.py +70 -0
  201. LOGS/Entity/EntityIterator.py +263 -0
  202. LOGS/Entity/EntityMinimal.py +141 -0
  203. LOGS/Entity/EntityMinimalWithIntId.py +36 -0
  204. LOGS/Entity/EntityMinimalWithStrId.py +36 -0
  205. LOGS/Entity/EntityMinimalWithType.py +47 -0
  206. LOGS/Entity/EntityRequestParameter.py +104 -0
  207. LOGS/Entity/EntitySortBy.py +69 -0
  208. LOGS/Entity/EntityWithIntId.py +26 -0
  209. LOGS/Entity/EntityWithStrId.py +26 -0
  210. LOGS/Entity/IGenericEntityOrderBy.py +55 -0
  211. LOGS/Entity/IdIterator.py +207 -0
  212. LOGS/Entity/SerializableContent.py +834 -0
  213. LOGS/Entity/__init__.py +23 -0
  214. LOGS/Interfaces/ICustomFieldValue.py +92 -0
  215. LOGS/Interfaces/ICustomSectionValue.py +161 -0
  216. LOGS/Interfaces/ICustomTypeValue.py +152 -0
  217. LOGS/Interfaces/ICustomValue.py +28 -0
  218. LOGS/Interfaces/IEntityInterface.py +7 -0
  219. LOGS/Interfaces/IEntryRecord.py +57 -0
  220. LOGS/Interfaces/IHierarchicalEntity.py +41 -0
  221. LOGS/Interfaces/IHierarchyType.py +63 -0
  222. LOGS/Interfaces/ILockableEntity.py +52 -0
  223. LOGS/Interfaces/IModificationRecord.py +56 -0
  224. LOGS/Interfaces/INamedEntity.py +25 -0
  225. LOGS/Interfaces/IOwnedEntity.py +27 -0
  226. LOGS/Interfaces/IPaginationRequest.py +11 -0
  227. LOGS/Interfaces/IPermissionedEntity.py +72 -0
  228. LOGS/Interfaces/IProjectBased.py +27 -0
  229. LOGS/Interfaces/ISessionedEntity.py +59 -0
  230. LOGS/Interfaces/ISignableEntity.py +49 -0
  231. LOGS/Interfaces/ISoftDeletable.py +28 -0
  232. LOGS/Interfaces/ITypedEntity.py +129 -0
  233. LOGS/Interfaces/IUniqueEntity.py +61 -0
  234. LOGS/Interfaces/IVersionedEntity.py +39 -0
  235. LOGS/Interfaces/__init__.py +7 -0
  236. LOGS/LOGS.py +1436 -0
  237. LOGS/LOGSConnection.py +647 -0
  238. LOGS/LOGSOptions.py +11 -0
  239. LOGS/Parameters/Color.py +92 -0
  240. LOGS/Parameters/ParameterBase.py +55 -0
  241. LOGS/Parameters/ParameterConverter.py +24 -0
  242. LOGS/Parameters/ParameterElement.py +99 -0
  243. LOGS/Parameters/ParameterList.py +52 -0
  244. LOGS/Parameters/ParameterTable.py +64 -0
  245. LOGS/Parameters/__init__.py +13 -0
  246. LOGS/ServerMetaData.py +120 -0
  247. LOGS/__init__.py +12 -0
  248. logs_py-4.0.7.dist-info/METADATA +51 -0
  249. logs_py-4.0.7.dist-info/RECORD +251 -0
  250. logs_py-4.0.7.dist-info/WHEEL +5 -0
  251. logs_py-4.0.7.dist-info/top_level.txt +1 -0
@@ -0,0 +1,243 @@
1
+ from typing import TYPE_CHECKING, Any, List, Optional, cast
2
+
3
+ from LOGS.Auxiliary.CustomFieldValueTypeChecker import CustomFieldValueTypeChecker
4
+ from LOGS.Auxiliary.Decorators import Endpoint
5
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
6
+ from LOGS.Entities.CustomFieldModels import CustomFieldDataType
7
+ from LOGS.Entities.ILiteraryTypedEntity import ILiteraryTypedEntity
8
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
9
+ from LOGS.Interfaces.IEntryRecord import IEntryRecord
10
+ from LOGS.Interfaces.IModificationRecord import IModificationRecord
11
+ from LOGS.Interfaces.INamedEntity import INamedEntity
12
+ from LOGS.Interfaces.IOwnedEntity import IOwnedEntity
13
+ from LOGS.Interfaces.IPermissionedEntity import IGenericPermissionEntity
14
+ from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
15
+ from LOGS.LOGSConnection import LOGSConnection
16
+
17
+ if TYPE_CHECKING:
18
+ from LOGS.Entities.CustomTypeMinimal import CustomTypeMinimal
19
+
20
+
21
+ @Endpoint("custom_fields")
22
+ class CustomField(
23
+ IEntityWithIntId,
24
+ IOwnedEntity,
25
+ INamedEntity,
26
+ IUniqueEntity,
27
+ IEntryRecord,
28
+ IModificationRecord,
29
+ ILiteraryTypedEntity,
30
+ IGenericPermissionEntity,
31
+ ):
32
+ _type = "CustomField"
33
+ _valueTypeChecker: CustomFieldValueTypeChecker = cast(
34
+ CustomFieldValueTypeChecker, None
35
+ )
36
+ _description: Optional[str] = None
37
+ _placeholder: Optional[str] = None
38
+ _dataType: Optional[CustomFieldDataType] = None
39
+ _required: Optional[bool] = None
40
+ _readOnly: Optional[bool] = None
41
+ _validationRegexp: Optional[str] = None
42
+ _validationMessage: Optional[str] = None
43
+ _showAsTextArea: Optional[bool] = None
44
+ _predefinedOptions: Optional[List[Any]] = None
45
+ _predefinedOptionsFromValues: bool = False
46
+ _defaultValues: Optional[Any] = None
47
+ _customTypeConstraint: Optional[List["CustomTypeMinimal"]] = None
48
+ _templateVersion: Optional[str] = None
49
+ _integrationId: Optional[str] = None
50
+
51
+ def __init__(
52
+ self,
53
+ ref=None,
54
+ id: Optional[int] = None,
55
+ connection: Optional[LOGSConnection] = None,
56
+ ):
57
+ if ref != None and isinstance(ref, (str, int, float)):
58
+ ref = {"text": str(ref)}
59
+
60
+ super().__init__(id=id, ref=ref, connection=connection)
61
+
62
+ def fromDict(self, ref) -> None:
63
+ if (
64
+ isinstance(ref, dict)
65
+ and "dataType" in ref
66
+ and isinstance(ref["dataType"], str)
67
+ ):
68
+ self.dataType = CustomFieldDataType(ref["dataType"])
69
+
70
+ super().fromDict(ref=ref)
71
+
72
+ def __str__(self) -> str:
73
+ i = " id:'%s'" % self.id if self.id is not None else ""
74
+ t = " type:'%s'" % self._dataType.name if self._dataType else ""
75
+ n = " name:'%s'" % self.name if self.name is not None else ""
76
+ return "<%s%s%s%s>" % (type(self).__name__, i, t, n)
77
+
78
+ @staticmethod
79
+ def isValidClassName(name: str) -> bool:
80
+ if not isinstance(name, str) or not name:
81
+ return False
82
+ if not name.isidentifier():
83
+ return False
84
+ if not name[0].isupper():
85
+ return False
86
+ return True
87
+
88
+ @property
89
+ def className(self) -> Optional[str]:
90
+ return self._name
91
+
92
+ @property
93
+ def description(self) -> Optional[str]:
94
+ return self._description
95
+
96
+ @description.setter
97
+ def description(self, value):
98
+ self._description = self.checkAndConvertNullable(value, str, "description")
99
+
100
+ @property
101
+ def defaultValues(self) -> Optional[Any]:
102
+ return self._defaultValues
103
+
104
+ @defaultValues.setter
105
+ def defaultValues(self, value):
106
+ if not self._dataType:
107
+ raise Exception("Data type is not set")
108
+
109
+ self._defaultValues = self._valueTypeChecker.checkAndConvert(
110
+ value, "defaultValues"
111
+ )
112
+
113
+ @property
114
+ def readOnly(self) -> Optional[bool]:
115
+ return self._readOnly
116
+
117
+ @readOnly.setter
118
+ def readOnly(self, value):
119
+ self._readOnly = self.checkAndConvertNullable(value, bool, "readOnly")
120
+
121
+ @property
122
+ def required(self) -> Optional[bool]:
123
+ return self._required
124
+
125
+ @required.setter
126
+ def required(self, value):
127
+ self._required = self.checkAndConvertNullable(value, bool, "required")
128
+
129
+ @property
130
+ def validationRegexp(self) -> Optional[str]:
131
+ return self._validationRegexp
132
+
133
+ @validationRegexp.setter
134
+ def validationRegexp(self, value):
135
+ self._validationRegexp = self.checkAndConvertNullable(
136
+ value, str, "validationRegexp"
137
+ )
138
+
139
+ @property
140
+ def validationMessage(self) -> Optional[str]:
141
+ return self._validationMessage
142
+
143
+ @validationMessage.setter
144
+ def validationMessage(self, value):
145
+ self._validationMessage = self.checkAndConvertNullable(
146
+ value, str, "validationMessage"
147
+ )
148
+
149
+ @property
150
+ def predefinedOptions(self) -> Optional[List[Any]]:
151
+ return self._predefinedOptions
152
+
153
+ @predefinedOptions.setter
154
+ def predefinedOptions(self, value):
155
+ if not self._dataType:
156
+ raise Exception("Data type is not set")
157
+
158
+ if not value:
159
+ self._predefinedOptions = None
160
+ return
161
+
162
+ self._predefinedOptions = (
163
+ self._valueTypeChecker.checkAndConvertIgnoreEnumOptions(
164
+ value, "predefinedOptions"
165
+ )
166
+ )
167
+ if not self._predefinedOptionsFromValues and self._predefinedOptions:
168
+ self._valueTypeChecker.enumOptions = self._predefinedOptions
169
+
170
+ @property
171
+ def customTypeConstraint(self) -> Optional[List["CustomTypeMinimal"]]:
172
+ return self._customTypeConstraint
173
+
174
+ @customTypeConstraint.setter
175
+ def customTypeConstraint(self, value):
176
+ self._customTypeConstraint = MinimalModelGenerator.MinimalFromList(
177
+ value, "CustomTypeMinimal", "customTypeConstraint", self._getConnection()
178
+ )
179
+
180
+ @property
181
+ def dataType(self) -> Optional[CustomFieldDataType]:
182
+ return self._dataType
183
+
184
+ @dataType.setter
185
+ def dataType(self, value):
186
+ self._dataType = self.checkAndConvertNullable(
187
+ value, CustomFieldDataType, "dataType"
188
+ )
189
+ if (
190
+ not self._valueTypeChecker
191
+ or self._valueTypeChecker.dataType != self._dataType
192
+ ):
193
+ self._valueTypeChecker = CustomFieldValueTypeChecker(
194
+ self._dataType,
195
+ self._getConnection(),
196
+ self._valueTypeChecker.enumOptions if self._valueTypeChecker else None,
197
+ )
198
+
199
+ @property
200
+ def predefinedOptionsFromValues(self) -> bool:
201
+ return self._predefinedOptionsFromValues
202
+
203
+ @predefinedOptionsFromValues.setter
204
+ def predefinedOptionsFromValues(self, value):
205
+ self._predefinedOptionsFromValues = self.checkAndConvert(
206
+ value, bool, "predefinedOptionsFromValues"
207
+ )
208
+
209
+ @property
210
+ def placeholder(self) -> Optional[str]:
211
+ return self._placeholder
212
+
213
+ @placeholder.setter
214
+ def placeholder(self, value):
215
+ self._placeholder = self.checkAndConvertNullable(value, str, "placeholder")
216
+
217
+ @property
218
+ def showAsTextArea(self) -> Optional[bool]:
219
+ return self._showAsTextArea
220
+
221
+ @showAsTextArea.setter
222
+ def showAsTextArea(self, value):
223
+ self._showAsTextArea = self.checkAndConvertNullable(
224
+ value, bool, "showAsTextArea"
225
+ )
226
+
227
+ @property
228
+ def templateVersion(self) -> Optional[str]:
229
+ return self._templateVersion
230
+
231
+ @templateVersion.setter
232
+ def templateVersion(self, value):
233
+ self._templateVersion = self.checkAndConvertNullable(
234
+ value, str, "templateVersion"
235
+ )
236
+
237
+ @property
238
+ def integrationId(self) -> Optional[str]:
239
+ return self._integrationId
240
+
241
+ @integrationId.setter
242
+ def integrationId(self, value):
243
+ self._integrationId = self.checkAndConvertNullable(value, str, "integrationId")
@@ -0,0 +1,8 @@
1
+ from LOGS.Auxiliary.Decorators import FullModel
2
+ from LOGS.Entities.CustomField import CustomField
3
+ from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
4
+
5
+
6
+ @FullModel(CustomField)
7
+ class CustomFieldMinimal(EntityMinimalWithIntId[CustomField]):
8
+ pass
@@ -0,0 +1,111 @@
1
+ from enum import Enum
2
+ from typing import TYPE_CHECKING, Type
3
+
4
+ if TYPE_CHECKING:
5
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
6
+
7
+
8
+ class CustomTypeEntityType(Enum):
9
+ Sample = "Sample"
10
+ Dataset = "Dataset"
11
+ InventoryItem = "InventoryItem"
12
+ Project = "Project"
13
+ Person = "Person"
14
+
15
+
16
+ class CustomTypeEntityTypeMapper:
17
+ @classmethod
18
+ def getClass(cls, entityType: CustomTypeEntityType) -> Type["IEntityWithIntId"]:
19
+ mapping = {
20
+ CustomTypeEntityType.Sample: cls.Sample(),
21
+ CustomTypeEntityType.Dataset: cls.Dataset(),
22
+ CustomTypeEntityType.InventoryItem: cls.InventoryItem(),
23
+ CustomTypeEntityType.Project: cls.Project(),
24
+ CustomTypeEntityType.Person: cls.Person(),
25
+ }
26
+ result = mapping.get(entityType, None)
27
+ if result is None:
28
+ raise Exception(f"Unknown entity type '{entityType.name}'.")
29
+ return result
30
+
31
+ @classmethod
32
+ def Sample(cls):
33
+ from LOGS.Entities.Sample import Sample
34
+
35
+ return Sample
36
+
37
+ @classmethod
38
+ def Dataset(cls):
39
+ from LOGS.Entities.Dataset import Dataset
40
+
41
+ return Dataset
42
+
43
+ @classmethod
44
+ def InventoryItem(cls):
45
+ from LOGS.Entities.InventoryItem import InventoryItem
46
+
47
+ return InventoryItem
48
+
49
+ @classmethod
50
+ def Project(cls):
51
+ from LOGS.Entities.Project import Project
52
+
53
+ return Project
54
+
55
+ @classmethod
56
+ def Person(cls):
57
+ from LOGS.Entities.Person import Person
58
+
59
+ return Person
60
+
61
+
62
+ class CustomFieldDataType(Enum):
63
+ String = "String"
64
+ StringArray = "StringArray"
65
+ Integer = "Integer"
66
+ IntegerArray = "IntegerArray"
67
+ Float = "Float"
68
+ FloatArray = "FloatArray"
69
+ Boolean = "Boolean"
70
+ Date = "Date"
71
+ DateArray = "DateArray"
72
+ DateTime = "DateTime"
73
+ DateTimeArray = "DateTimeArray"
74
+ Time = "Time"
75
+ TimeArray = "TimeArray"
76
+ DateTimeRange = "DateTimeRange"
77
+ TimeRange = "TimeRange"
78
+ Dataset = "Dataset"
79
+ DatasetArray = "DatasetArray"
80
+ Sample = "Sample"
81
+ SampleArray = "SampleArray"
82
+ Project = "Project"
83
+ ProjectArray = "ProjectArray"
84
+ Person = "Person"
85
+ PersonArray = "PersonArray"
86
+ Method = "Method"
87
+ MethodArray = "MethodArray"
88
+ SharedContent = "SharedContent"
89
+ SharedContentArray = "SharedContentArray"
90
+ LabNotebook = "LabNotebook"
91
+ LabNotebookArray = "LabNotebookArray"
92
+ LabNotebookExperiment = "LabNotebookExperiment"
93
+ LabNotebookExperimentArray = "LabNotebookExperimentArray"
94
+ LabNotebookEntry = "LabNotebookEntry"
95
+ LabNotebookEntryArray = "LabNotebookEntryArray"
96
+ Attachment = "Attachment"
97
+ InventoryItem = "InventoryItem"
98
+ InventoryItemArray = "InventoryItemArray"
99
+ Barcode = "Barcode"
100
+ Url = "Url"
101
+ UrlArray = "UrlArray"
102
+
103
+
104
+ class CustomFieldValuesSearchPredicate(Enum):
105
+ AND = "AND"
106
+ OR = "OR"
107
+
108
+
109
+ class CustomFieldValueType(Enum):
110
+ CustomField = "CustomField"
111
+ CustomTypeSection = "CustomTypeSection"
@@ -0,0 +1,69 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import Any, List, Optional, Type, cast
3
+
4
+ from typing_extensions import Self
5
+
6
+ from LOGS.Entities.CustomFieldModels import (
7
+ CustomFieldDataType,
8
+ CustomFieldValuesSearchPredicate,
9
+ )
10
+ from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
11
+ from LOGS.Entity.IGenericEntityOrderBy import (
12
+ IEntryRecordSortingOptions,
13
+ IGenericEntitySortingOptions,
14
+ IModificationRecordSortingOptions,
15
+ INamedEntitySortingOptions,
16
+ )
17
+ from LOGS.Interfaces.IEntryRecord import IEntryRecordRequest
18
+ from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
19
+ from LOGS.Interfaces.INamedEntity import INamedEntityRequest
20
+ from LOGS.Interfaces.IOwnedEntity import IOwnedEntityRequest
21
+ from LOGS.Interfaces.IPaginationRequest import IPaginationRequest
22
+ from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
23
+
24
+
25
+ class CustomFieldSortingOptions(
26
+ IGenericEntitySortingOptions,
27
+ INamedEntitySortingOptions,
28
+ IEntryRecordSortingOptions,
29
+ IModificationRecordSortingOptions,
30
+ ):
31
+ DATATYPE: Self = cast(Self, "DATATYPE")
32
+
33
+
34
+ @dataclass
35
+ class CustomFieldValuesSearchParameters:
36
+ values: Optional[List[Any]] = None
37
+ dataType: Optional[CustomFieldDataType] = None
38
+ customFieldIds: Optional[List[int]] = None
39
+ sampleIds: Optional[List[int]] = None
40
+ datasetIds: Optional[List[int]] = None
41
+ projectIds: Optional[List[int]] = None
42
+ personIds: Optional[List[int]] = None
43
+ inventoryIds: Optional[List[int]] = None
44
+ facilityIds: Optional[List[int]] = None
45
+ predicate: Optional[CustomFieldValuesSearchPredicate] = None
46
+
47
+
48
+ @dataclass
49
+ class ICustomFieldValuesSearchRequest:
50
+ customFieldValues: Optional[List[CustomFieldValuesSearchParameters]] = None
51
+
52
+
53
+ @dataclass
54
+ class CustomFieldRequestParameter(
55
+ EntityRequestParameter[CustomFieldSortingOptions],
56
+ IPaginationRequest,
57
+ IPermissionedEntityRequest,
58
+ IEntryRecordRequest,
59
+ IModificationRecordRequest,
60
+ ICustomFieldValuesSearchRequest,
61
+ IOwnedEntityRequest,
62
+ INamedEntityRequest,
63
+ ):
64
+ _orderByType: Type[CustomFieldSortingOptions] = field(
65
+ default=CustomFieldSortingOptions, init=False
66
+ )
67
+
68
+ dataTypes: Optional[List[CustomFieldDataType]] = None
69
+ customFieldValues: Optional[List[CustomFieldValuesSearchParameters]] = None
@@ -0,0 +1,40 @@
1
+ from dataclasses import dataclass
2
+ from enum import Enum
3
+ from typing import TYPE_CHECKING, Any, Optional
4
+
5
+ from LOGS.Entity.SerializableContent import SerializableClass
6
+
7
+ if TYPE_CHECKING:
8
+ pass
9
+
10
+
11
+ class CustomFieldValuesSearchPredicate(Enum):
12
+ AND = "AND"
13
+ OR = "OR"
14
+
15
+
16
+ class CustomFieldSearchOperator(Enum):
17
+ EQUALS = "EQUALS"
18
+ NOT_EQUALS = "NOT_EQUALS"
19
+ GREATER_THAN = "GREATER_THAN"
20
+ GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL"
21
+ LESS_THAN = "LESS_THAN"
22
+ LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL"
23
+ STRING_CONTAINS = "STRING_CONTAINS"
24
+ STRING_NOT_CONTAINS = "STRING_NOT_CONTAINS"
25
+ IN_ = "IN_"
26
+ NOT_IN = "NOT_IN"
27
+ STARTS_WITH = "STARTS_WITH"
28
+ ENDS_WITH = "ENDS_WITH"
29
+ IS_NULL = "IS_NULL"
30
+ IS_NOT_NULL = "IS_NOT_NULL"
31
+
32
+
33
+ @dataclass
34
+ class CustomFieldSearchQuery(SerializableClass):
35
+ predicate: Optional[CustomFieldValuesSearchPredicate] = None
36
+ left: Optional["CustomFieldSearchQuery"] = None
37
+ right: Optional["CustomFieldSearchQuery"] = None
38
+ customFieldId: Optional[int] = None
39
+ operator: Optional[CustomFieldSearchOperator] = None
40
+ value: Optional[Any] = None
@@ -0,0 +1,12 @@
1
+ from LOGS.Auxiliary.Decorators import Endpoint
2
+ from LOGS.Entities.CustomField import CustomField
3
+ from LOGS.Entities.CustomFieldRequestParameter import CustomFieldRequestParameter
4
+ from LOGS.Entity.EntityIterator import EntityIterator
5
+
6
+
7
+ @Endpoint("custom_fields")
8
+ class CustomFields(EntityIterator[CustomField, CustomFieldRequestParameter]):
9
+ """LOGS connected CustomFields iterator"""
10
+
11
+ _generatorType = CustomField
12
+ _parameterType = CustomFieldRequestParameter
@@ -0,0 +1,212 @@
1
+ from typing import TYPE_CHECKING, List, Optional
2
+
3
+ from LOGS.Auxiliary.Decorators import Endpoint
4
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
5
+ from LOGS.Entities.CustomField import CustomField
6
+ from LOGS.Entities.CustomFieldModels import CustomTypeEntityType
7
+ from LOGS.Entities.CustomTypeSection import CustomTypeSection
8
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
9
+ from LOGS.Interfaces.IEntryRecord import IEntryRecord
10
+ from LOGS.Interfaces.IHierarchyType import IHierarchyType
11
+ from LOGS.Interfaces.IModificationRecord import IModificationRecord
12
+ from LOGS.Interfaces.INamedEntity import INamedEntity
13
+ from LOGS.Interfaces.IPermissionedEntity import IGenericPermissionEntity
14
+ from LOGS.Interfaces.ISoftDeletable import ISoftDeletable
15
+ from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
16
+
17
+ if TYPE_CHECKING:
18
+ from LOGS.Entities.CustomTypeMinimal import CustomTypeMinimal
19
+
20
+
21
+ @Endpoint("types")
22
+ class CustomType(
23
+ IEntityWithIntId,
24
+ IGenericPermissionEntity,
25
+ INamedEntity,
26
+ IUniqueEntity,
27
+ IEntryRecord,
28
+ IModificationRecord,
29
+ ISoftDeletable,
30
+ IHierarchyType,
31
+ ):
32
+ _noSerialize = ["connection", "cachePath", "cacheId", "cacheDir", "customFields"]
33
+
34
+ _description: Optional[str] = None
35
+ _entityType: Optional[CustomTypeEntityType] = None
36
+ _hasRestrictedAddPermission: Optional[bool] = None
37
+ _hasRestrictedEditPermission: Optional[bool] = None
38
+ _hasRestrictedReadPermission: Optional[bool] = None
39
+ _isEnabled: Optional[bool] = None
40
+ _inventoryName: Optional[str] = None
41
+ _inventoryDescription: Optional[str] = None
42
+ _isHierarchyRoot: Optional[bool] = None
43
+ _rootHierarchy: Optional["CustomTypeMinimal"] = None
44
+ _parentTypes: Optional[List["CustomTypeMinimal"]] = None
45
+ _templateVersion: Optional[str] = None
46
+ _integrationId: Optional[str] = None
47
+ _sections: Optional[List[CustomTypeSection]] = None
48
+
49
+ def contentToString(self, indentation: int = 1, hideNone: bool = False) -> str:
50
+ bak = self._noSerialize
51
+ self._noSerialize = [*bak, "sections"]
52
+ tab = self._indentationString * indentation
53
+ tabContent = self._indentationString * (indentation + 1)
54
+ s = super().contentToString(indentation, hideNone)
55
+ # s = ""
56
+ s += f"{tab}sections=\n"
57
+ self._noSerialize = bak
58
+ for section in self.sections or []:
59
+ if not section and hideNone:
60
+ continue
61
+ content = ""
62
+ if section is not None:
63
+ content = section.contentToString(indentation + 2, hideNone=hideNone)
64
+ if not content and hideNone:
65
+ continue
66
+ s += f"{tabContent}{content}"
67
+ return s
68
+
69
+ @property
70
+ def description(self) -> Optional[str]:
71
+ return self._description
72
+
73
+ @description.setter
74
+ def description(self, value):
75
+ self._description = self.checkAndConvertNullable(value, str, "description")
76
+
77
+ @property
78
+ def entityType(self) -> Optional[CustomTypeEntityType]:
79
+ return self._entityType
80
+
81
+ @entityType.setter
82
+ def entityType(self, value):
83
+ self._entityType = self.checkAndConvertNullable(
84
+ value, CustomTypeEntityType, "entityType"
85
+ )
86
+
87
+ @property
88
+ def hasRestrictedAddPermission(self) -> Optional[bool]:
89
+ return self._hasRestrictedAddPermission
90
+
91
+ @hasRestrictedAddPermission.setter
92
+ def hasRestrictedAddPermission(self, value):
93
+ self._hasRestrictedAddPermission = self.checkAndConvertNullable(
94
+ value, bool, "hasRestrictedAddPermission"
95
+ )
96
+
97
+ @property
98
+ def hasRestrictedEditPermission(self) -> Optional[bool]:
99
+ return self._hasRestrictedEditPermission
100
+
101
+ @hasRestrictedEditPermission.setter
102
+ def hasRestrictedEditPermission(self, value):
103
+ self._hasRestrictedEditPermission = self.checkAndConvertNullable(
104
+ value, bool, "hasRestrictedEditPermission"
105
+ )
106
+
107
+ @property
108
+ def hasRestrictedReadPermission(self) -> Optional[bool]:
109
+ return self._hasRestrictedReadPermission
110
+
111
+ @hasRestrictedReadPermission.setter
112
+ def hasRestrictedReadPermission(self, value):
113
+ self._hasRestrictedReadPermission = self.checkAndConvertNullable(
114
+ value, bool, "hasRestrictedReadPermission"
115
+ )
116
+
117
+ @property
118
+ def sections(self) -> Optional[List[CustomTypeSection]]:
119
+ return self._sections
120
+
121
+ @sections.setter
122
+ def sections(self, value):
123
+ self._sections = self.checkListAndConvertNullable(
124
+ value, CustomTypeSection, "sections"
125
+ )
126
+
127
+ @property
128
+ def isEnabled(self) -> Optional[bool]:
129
+ return self._isEnabled
130
+
131
+ @isEnabled.setter
132
+ def isEnabled(self, value):
133
+ self._isEnabled = self.checkAndConvertNullable(value, bool, "isEnabled")
134
+
135
+ @property
136
+ def inventoryName(self) -> Optional[str]:
137
+ return self._inventoryName
138
+
139
+ @inventoryName.setter
140
+ def inventoryName(self, value):
141
+ self._inventoryName = self.checkAndConvertNullable(value, str, "inventoryName")
142
+
143
+ @property
144
+ def inventoryDescription(self) -> Optional[str]:
145
+ return self._inventoryDescription
146
+
147
+ @inventoryDescription.setter
148
+ def inventoryDescription(self, value):
149
+ self._inventoryDescription = self.checkAndConvertNullable(
150
+ value, str, "inventoryDescription"
151
+ )
152
+
153
+ @property
154
+ def isHierarchyRoot(self) -> Optional[bool]:
155
+ return self._isHierarchyRoot
156
+
157
+ @isHierarchyRoot.setter
158
+ def isHierarchyRoot(self, value):
159
+ self._isHierarchyRoot = self.checkAndConvertNullable(
160
+ value, bool, "isHierarchyRoot"
161
+ )
162
+
163
+ @property
164
+ def rootHierarchy(self) -> Optional["CustomTypeMinimal"]:
165
+ return self._rootHierarchy
166
+
167
+ @rootHierarchy.setter
168
+ def rootHierarchy(self, value):
169
+ self._rootHierarchy = MinimalModelGenerator.MinimalFromSingle(
170
+ value, "CustomTypeMinimal", "rootHierarchy", self._getConnection()
171
+ )
172
+
173
+ @property
174
+ def parentTypes(self) -> Optional[List["CustomTypeMinimal"]]:
175
+ return self._parentTypes
176
+
177
+ @parentTypes.setter
178
+ def parentTypes(self, value):
179
+ self._parentTypes = MinimalModelGenerator.MinimalFromList(
180
+ value, "CustomTypeMinimal", "parentTypes", self._getConnection()
181
+ )
182
+
183
+ @property
184
+ def customFields(self) -> List[CustomField]:
185
+ if self.sections is None:
186
+ return []
187
+
188
+ return [
189
+ field
190
+ for section in self.sections
191
+ if section.customFields is not None
192
+ for field in section.customFields
193
+ if field is not None
194
+ ]
195
+
196
+ @property
197
+ def templateVersion(self) -> Optional[str]:
198
+ return self._templateVersion
199
+
200
+ @templateVersion.setter
201
+ def templateVersion(self, value):
202
+ self._templateVersion = self.checkAndConvertNullable(
203
+ value, str, "templateVersion"
204
+ )
205
+
206
+ @property
207
+ def integrationId(self) -> Optional[str]:
208
+ return self._integrationId
209
+
210
+ @integrationId.setter
211
+ def integrationId(self, value):
212
+ self._integrationId = self.checkAndConvertNullable(value, str, "integrationId")