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,56 @@
1
+ from dataclasses import dataclass
2
+ from datetime import datetime
3
+ from typing import TYPE_CHECKING, List, Optional
4
+
5
+ from LOGS.Auxiliary import Tools
6
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
7
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
8
+
9
+ if TYPE_CHECKING:
10
+ from LOGS.Entities.PersonMinimal import PersonMinimal
11
+
12
+
13
+ @dataclass
14
+ class IModificationRecordRequest:
15
+ pass
16
+
17
+
18
+ class IModifiedOnRequest:
19
+ modifiedFrom: Optional[datetime] = None
20
+ modifiedTo: Optional[datetime] = None
21
+
22
+
23
+ class IModifiedByRequest:
24
+ modifiedByIds: Optional[List[int]]
25
+
26
+
27
+ class IModifiedOn(IEntityInterface):
28
+ _modifiedOn: Optional[datetime] = None
29
+
30
+ @property
31
+ def modifiedOn(self) -> Optional[datetime]:
32
+ return self._modifiedOn
33
+
34
+ @modifiedOn.setter
35
+ def modifiedOn(self, value):
36
+ self._modifiedOn = Tools.checkAndConvert(
37
+ value, datetime, "modifiedOn", allowNone=True
38
+ )
39
+
40
+
41
+ class IModifiedBy(IEntityInterface):
42
+ _modifiedBy: Optional["PersonMinimal"] = None
43
+
44
+ @property
45
+ def modifiedBy(self) -> Optional["PersonMinimal"]:
46
+ return self._modifiedBy
47
+
48
+ @modifiedBy.setter
49
+ def modifiedBy(self, value):
50
+ self._modifiedBy = MinimalModelGenerator.MinimalFromSingle(
51
+ value, "PersonMinimal", "modifiedBy", connection=self._getEntityConnection()
52
+ )
53
+
54
+
55
+ class IModificationRecord(IModifiedOn, IModifiedBy):
56
+ pass
@@ -0,0 +1,25 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, List, Optional
3
+
4
+ from LOGS.Auxiliary import Tools
5
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
6
+
7
+ if TYPE_CHECKING:
8
+ pass
9
+
10
+
11
+ @dataclass
12
+ class INamedEntityRequest:
13
+ names: Optional[List[str]] = None
14
+
15
+
16
+ class INamedEntity(IEntityInterface):
17
+ _name: Optional[str] = None
18
+
19
+ @property
20
+ def name(self) -> Optional[str]:
21
+ return self._name
22
+
23
+ @name.setter
24
+ def name(self, value):
25
+ self._name = Tools.checkAndConvert(value, str, "name", allowNone=True)
@@ -0,0 +1,27 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, List, Optional
3
+
4
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
5
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
6
+
7
+ if TYPE_CHECKING:
8
+ from LOGS.Entities.PersonMinimal import PersonMinimal
9
+
10
+
11
+ @dataclass
12
+ class IOwnedEntityRequest:
13
+ ownerIds: Optional[List[int]] = None
14
+
15
+
16
+ class IOwnedEntity(IEntityInterface):
17
+ _owner: Optional["PersonMinimal"] = None
18
+
19
+ @property
20
+ def owner(self) -> Optional["PersonMinimal"]:
21
+ return self._owner
22
+
23
+ @owner.setter
24
+ def owner(self, value):
25
+ self._owner = MinimalModelGenerator.MinimalFromSingle(
26
+ value, "PersonMinimal", "owner", connection=self._getEntityConnection()
27
+ )
@@ -0,0 +1,11 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, Optional
3
+
4
+ if TYPE_CHECKING:
5
+ pass
6
+
7
+
8
+ @dataclass
9
+ class IPaginationRequest:
10
+ page: Optional[int] = None
11
+ pageSize: Optional[int] = None
@@ -0,0 +1,72 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, Generic, Optional, Type, TypeVar, cast
3
+
4
+ from LOGS.Auxiliary import Tools
5
+ from LOGS.Entity.SerializableContent import SerializableClass
6
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
7
+
8
+ if TYPE_CHECKING:
9
+ pass
10
+
11
+
12
+ @dataclass
13
+ class IPermissionedEntityRequest:
14
+ includePermissions: Optional[bool] = None
15
+
16
+
17
+ class IPermissionModel:
18
+ edit: Optional[bool] = None
19
+
20
+
21
+ class GenericPermission(IPermissionModel, SerializableClass):
22
+ canDownload: Optional[bool] = None
23
+ canEdit: Optional[bool] = None
24
+ canTrash: Optional[bool] = None
25
+ canRestore: Optional[bool] = None
26
+ canDelete: Optional[bool] = None
27
+ canLock: Optional[bool] = None
28
+ canUnlock: Optional[bool] = None
29
+ canSign: Optional[bool] = None
30
+ canRemoveSignatures: Optional[bool] = None
31
+
32
+ def __str__(self):
33
+ attrList = self._getAttrList()
34
+
35
+ s = ",".join(
36
+ k
37
+ for k in attrList
38
+ if k.startswith("can") and getattr(self, k, None) is True
39
+ )
40
+ return f"<{type(self).__name__} access:{s}>"
41
+
42
+ def contentToString(self, indentation: int = 1, hideNone: bool = False) -> str:
43
+ return str(self)
44
+
45
+
46
+ _PERMISSION = TypeVar("_PERMISSION", bound=IPermissionModel)
47
+
48
+
49
+ class IPermissionedEntity(Generic[_PERMISSION], IEntityInterface):
50
+ _permissionType: Optional[Type[_PERMISSION]] = None
51
+
52
+ _permissions: Optional[_PERMISSION] = None
53
+
54
+ @property
55
+ def permissions(self) -> Optional[_PERMISSION]:
56
+ return self._permissions
57
+
58
+ @permissions.setter
59
+ def permissions(self, value):
60
+ if not self._permissionType:
61
+ raise NotImplementedError("Permission type must be set")
62
+
63
+ self._permissions = Tools.checkAndConvert(
64
+ value,
65
+ cast(Type[_PERMISSION], self._permissionType),
66
+ "permissions",
67
+ allowNone=True,
68
+ )
69
+
70
+
71
+ class IGenericPermissionEntity(IPermissionedEntity[GenericPermission]):
72
+ _permissionType: Type[GenericPermission] = GenericPermission
@@ -0,0 +1,27 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, List, Optional
3
+
4
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
5
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
6
+
7
+ if TYPE_CHECKING:
8
+ from LOGS.Entities.ProjectMinimal import ProjectMinimal
9
+
10
+
11
+ @dataclass
12
+ class IProjectBasedRequest:
13
+ projectIds: Optional[List[int]] = None
14
+
15
+
16
+ class IProjectBased(IEntityInterface):
17
+ _projects: Optional[List["ProjectMinimal"]] = None
18
+
19
+ @property
20
+ def projects(self) -> Optional[List["ProjectMinimal"]]:
21
+ return self._projects
22
+
23
+ @projects.setter
24
+ def projects(self, value):
25
+ self._projects = MinimalModelGenerator.MinimalFromList(
26
+ value, "ProjectMinimal", "projects", connection=self._getEntityConnection()
27
+ )
@@ -0,0 +1,59 @@
1
+ from datetime import datetime
2
+ from typing import TYPE_CHECKING, Optional
3
+
4
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
5
+ from LOGS.Auxiliary.Tools import Tools
6
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
7
+
8
+ if TYPE_CHECKING:
9
+ from LOGS.Entities.PersonMinimal import PersonMinimal
10
+
11
+
12
+ class ISessionedEntity(IEntityInterface):
13
+ _currentlyEditedBy: Optional["PersonMinimal"] = None
14
+ _currentlyEditedSince: Optional[datetime] = None
15
+ _publicSessionId: Optional[str] = None
16
+ _isCurrentlyEdited: Optional[bool] = None
17
+
18
+ @property
19
+ def currentlyEditedBy(self) -> Optional["PersonMinimal"]:
20
+ return self._currentlyEditedBy
21
+
22
+ @currentlyEditedBy.setter
23
+ def currentlyEditedBy(self, value):
24
+ self._currentlyEditedBy = MinimalModelGenerator.MinimalFromSingle(
25
+ value,
26
+ "PersonMinimal",
27
+ "currentlyEditedBy",
28
+ connection=self._getEntityConnection(),
29
+ )
30
+
31
+ @property
32
+ def currentlyEditedSince(self) -> Optional[datetime]:
33
+ return self._currentlyEditedSince
34
+
35
+ @currentlyEditedSince.setter
36
+ def currentlyEditedSince(self, value):
37
+ self._currentlyEditedSince = Tools.checkAndConvert(
38
+ value, datetime, "currentlyEditedSince", allowNone=True
39
+ )
40
+
41
+ @property
42
+ def publicSessionId(self) -> Optional[str]:
43
+ return self._publicSessionId
44
+
45
+ @publicSessionId.setter
46
+ def publicSessionId(self, value):
47
+ self._publicSessionId = Tools.checkAndConvert(
48
+ value, str, "publicSessionId", allowNone=True
49
+ )
50
+
51
+ @property
52
+ def isCurrentlyEdited(self) -> Optional[bool]:
53
+ return self._isCurrentlyEdited
54
+
55
+ @isCurrentlyEdited.setter
56
+ def isCurrentlyEdited(self, value):
57
+ self._isCurrentlyEdited = Tools.checkAndConvert(
58
+ value, bool, "isCurrentlyEdited", allowNone=True
59
+ )
@@ -0,0 +1,49 @@
1
+ from dataclasses import dataclass
2
+ from datetime import datetime
3
+ from typing import TYPE_CHECKING, List, Optional, Union
4
+
5
+ from LOGS.Auxiliary.Tools import Tools
6
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
7
+
8
+ if TYPE_CHECKING:
9
+ from LOGS.Entities.Signature import Signature, SignatureType
10
+
11
+
12
+ @dataclass
13
+ class ISignableEntityRequest:
14
+ signedByIds: Optional[List[int]] = None
15
+ notSignedByIds: Optional[List[int]] = None
16
+ signedFrom: Optional[datetime] = None
17
+ signedTo: Optional[datetime] = None
18
+ isSigned: Optional[bool] = None
19
+ signatureTypes: Optional[List["SignatureType"]] = None
20
+
21
+
22
+ class ISignableEntity(IEntityInterface):
23
+ _signatures: Optional[List["Signature"]] = None
24
+ _isSigned: Optional[bool] = None
25
+
26
+ @property
27
+ def signatures(self) -> Optional[List["Signature"]]:
28
+ return self._signatures
29
+
30
+ @signatures.setter
31
+ def signatures(self, value: Optional[Union[List["Signature"], List[dict]]]):
32
+ from LOGS.Entities.Signature import Signature
33
+ from LOGS.Entity.ConnectedEntity import ConnectedEntity
34
+
35
+ self._signatures = ConnectedEntity.checkListAndConvertWithConnection(
36
+ value,
37
+ Signature,
38
+ "signatures",
39
+ allowNone=True,
40
+ connection=self._getEntityConnection(),
41
+ )
42
+
43
+ @property
44
+ def isSigned(self) -> Optional[bool]:
45
+ return self._isSigned
46
+
47
+ @isSigned.setter
48
+ def isSigned(self, value: Optional[bool]):
49
+ self._isSigned = Tools.checkAndConvert(value, bool, "isSigned", allowNone=True)
@@ -0,0 +1,28 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, Optional
3
+
4
+ from LOGS.Auxiliary.Tools import Tools
5
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
6
+
7
+ if TYPE_CHECKING:
8
+ pass
9
+
10
+
11
+ @dataclass
12
+ class ISoftDeletableRequest:
13
+ includeSoftDeleted: Optional[bool] = None
14
+ isSoftDeleted: Optional[bool] = None
15
+
16
+
17
+ class ISoftDeletable(IEntityInterface):
18
+ _isDeleted: Optional[bool] = None
19
+
20
+ @property
21
+ def isDeleted(self) -> Optional[bool]:
22
+ return self._isDeleted
23
+
24
+ @isDeleted.setter
25
+ def isDeleted(self, value):
26
+ self._isDeleted = Tools.checkAndConvert(
27
+ value, bool, "isDeleted", allowNone=True
28
+ )
@@ -0,0 +1,129 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type
3
+
4
+ from typing_extensions import Self
5
+
6
+ from LOGS.Auxiliary.Exceptions import EntityNotConnectedException
7
+ from LOGS.Entities.CustomType import CustomType
8
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
9
+
10
+ if TYPE_CHECKING:
11
+ from LOGS.Entity.Entity import Entity
12
+ from LOGS.Interfaces.ICustomTypeValue import ICustomTypeValue
13
+
14
+
15
+ @dataclass
16
+ class ITypedEntityRequest:
17
+ customTypeIds: Optional[List[int]] = None
18
+ customFieldIds: Optional[List[int]] = None
19
+
20
+
21
+ class ITypedEntity(IEntityInterface):
22
+ _customType: Optional["CustomType"] = (
23
+ None # this diverges from the LOGS model (CustomTypeMinimal) because here the full custom type is retrieved
24
+ )
25
+ _customValues: Optional["ICustomTypeValue"] = None
26
+
27
+ _untypedValues: Optional[List[Dict[str, Any]]] = None
28
+ _untypedCustomType: Optional[Dict[str, Any]] = None
29
+ _initCustomValues: bool = True
30
+ _baseType: Optional[Type["Entity"]] = None
31
+
32
+ def _contentToString(self) -> str:
33
+ s = f"{type(self).__name__}"
34
+ if self.customType:
35
+ s += f" <{self.customType.name}>\n"
36
+ s += self.customValues._contentToString(1) if self.customValues else ""
37
+ else:
38
+ s += " <no type>\n"
39
+ return s
40
+
41
+ def _createCustomValuesInstance(self) -> None:
42
+ from LOGS.Auxiliary.CustomTypeClassGenerator import CustomTypeClassGenerator
43
+
44
+ if self.customType is None:
45
+ return
46
+
47
+ connection = self._getEntityConnection()
48
+ if not connection:
49
+ raise EntityNotConnectedException()
50
+
51
+ self._customValues = CustomTypeClassGenerator.convert(
52
+ [],
53
+ customTypeOrId=self.customType,
54
+ fieldName="customValues",
55
+ connection=connection,
56
+ )
57
+
58
+ def getUntypedInstance(self) -> Self:
59
+ from LOGS.Auxiliary.CustomEntityClassGenerator import CustomEntityClassGenerator
60
+
61
+ return CustomEntityClassGenerator.convertToUntyped(self)
62
+
63
+ def _getTypedInstance(self) -> "ITypedEntity":
64
+ from LOGS.Auxiliary.CustomEntityClassGenerator import CustomEntityClassGenerator
65
+ from LOGS.Interfaces.INamedEntity import INamedEntity
66
+
67
+ return CustomEntityClassGenerator.convertFromUntyped(
68
+ self,
69
+ fieldName=self.name if isinstance(self, INamedEntity) else None,
70
+ limitToEntityType=type(self),
71
+ )
72
+
73
+ @property
74
+ def baseType(self) -> Optional[Type["Entity"]]:
75
+ return self._baseType
76
+
77
+ @property
78
+ def customType(self) -> Optional["CustomType"]:
79
+ return self._customType
80
+
81
+ @customType.setter
82
+ def customType(self, value):
83
+ if not self._customType and isinstance(value, dict) and "id" in value:
84
+ self._untypedCustomType = value
85
+ return
86
+
87
+ if self._customType == value or value == None:
88
+ return
89
+
90
+ newId = (
91
+ value.id
92
+ if isinstance(value, CustomType)
93
+ else value["id"] if isinstance(value, dict) and "id" in value else None
94
+ )
95
+ if newId and self._customType and self._customType.id == newId:
96
+ return
97
+
98
+ raise ValueError(f"Custom type {self._customType} cannot be changed.")
99
+
100
+ @property
101
+ def customValues(
102
+ self,
103
+ ) -> Optional["ICustomTypeValue"]:
104
+ if self._customType and self._customValues is None:
105
+ self._createCustomValuesInstance()
106
+ return self._customValues
107
+
108
+ @customValues.setter
109
+ def customValues(self, value):
110
+ from LOGS.Auxiliary.CustomTypeClassGenerator import CustomTypeClassGenerator
111
+
112
+ if (
113
+ self.customType is None
114
+ or self._getEntityConnection() is None
115
+ or value is None
116
+ ):
117
+ self._untypedValues = value
118
+ return
119
+
120
+ connection = self._getEntityConnection()
121
+ if not connection:
122
+ raise EntityNotConnectedException()
123
+
124
+ self._customValues = CustomTypeClassGenerator.convert(
125
+ value,
126
+ customTypeOrId=self.customType,
127
+ fieldName="customValues",
128
+ connection=connection,
129
+ )
@@ -0,0 +1,61 @@
1
+ from dataclasses import dataclass
2
+ from typing import List, Optional, Union
3
+ from uuid import UUID
4
+
5
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
6
+ from LOGS.Auxiliary.Tools import Tools
7
+ from LOGS.Entities.Origin import Origin
8
+ from LOGS.Entities.OriginMinimal import OriginMinimal
9
+ from LOGS.Interfaces.IEntityInterface import IEntityInterface
10
+
11
+
12
+ @dataclass
13
+ class IUniqueEntityRequest:
14
+ originIds: Optional[List[int]] = None
15
+
16
+
17
+ class IUniqueEntity(IEntityInterface):
18
+ _uid: Optional[str] = None
19
+ _origin: Optional[OriginMinimal] = None
20
+
21
+ _foreignUid: Optional[UUID] = None
22
+ _foreignOrigin: Optional[OriginMinimal] = None
23
+
24
+ def setOrigin(
25
+ self,
26
+ uid: Optional[Union[str, UUID]] = None,
27
+ origin: Optional[Union[Origin, OriginMinimal]] = None,
28
+ ):
29
+ self._foreignUid = Tools.checkAndConvert(
30
+ uid, UUID, "setOrigin(uid)", allowNone=True
31
+ )
32
+ self._foreignOrigin = Tools.checkAndConvert(
33
+ origin, OriginMinimal, "setOrigin(origin)", allowNone=True
34
+ )
35
+
36
+ def _originConverter(self, origin: Union[Origin, OriginMinimal]) -> OriginMinimal:
37
+ if isinstance(origin, OriginMinimal):
38
+ return origin
39
+ if isinstance(origin, Origin):
40
+ return OriginMinimal(name=origin.name, id=origin.id)
41
+ return Tools.checkAndConvert(origin, OriginMinimal, allowNone=True)
42
+
43
+ @property
44
+ def uid(self) -> Optional[str]:
45
+ return self._uid
46
+
47
+ @uid.setter
48
+ def uid(self, value):
49
+ self._uid = Tools.checkAndConvert(
50
+ value=value, fieldType=str, fieldName="uid", allowNone=True
51
+ )
52
+
53
+ @property
54
+ def origin(self) -> Optional[OriginMinimal]:
55
+ return self._origin
56
+
57
+ @origin.setter
58
+ def origin(self, value):
59
+ self._origin = MinimalModelGenerator.MinimalFromSingle(
60
+ value, "PersonMinimal", "origin", connection=self._getEntityConnection()
61
+ )
@@ -0,0 +1,39 @@
1
+ from dataclasses import dataclass
2
+ from typing import TYPE_CHECKING, Generic, List, Optional, TypeVar, Union
3
+
4
+ from LOGS.Auxiliary import Tools
5
+ from LOGS.Interfaces.IEntryRecord import IEntryRecord, IEntryRecordRequest
6
+ from LOGS.Interfaces.IModificationRecord import (
7
+ IModificationRecord,
8
+ IModificationRecordRequest,
9
+ )
10
+ from LOGS.Interfaces.ISoftDeletable import ISoftDeletable, ISoftDeletableRequest
11
+
12
+ if TYPE_CHECKING:
13
+ pass
14
+
15
+ _idType = TypeVar("_idType", bound=Union[int, str])
16
+
17
+
18
+ @dataclass
19
+ class IVersionedEntityRequest(
20
+ Generic[_idType],
21
+ IEntryRecordRequest,
22
+ IModificationRecordRequest,
23
+ ISoftDeletableRequest,
24
+ ):
25
+ originalIds: Optional[List[_idType]] = None
26
+ versionIds: Optional[List[int]] = None
27
+ versions: Optional[List[int]] = None
28
+
29
+
30
+ class IVersionedEntity(IEntryRecord, IModificationRecord, ISoftDeletable):
31
+ _version: Optional[int] = None
32
+
33
+ @property
34
+ def version(self) -> Optional[int]:
35
+ return self._version
36
+
37
+ @version.setter
38
+ def version(self, value):
39
+ self._version = Tools.checkAndConvert(value, int, "version", allowNone=True)
@@ -0,0 +1,7 @@
1
+ """
2
+ This Module is written for the LOGS Repository.
3
+
4
+ It's objects can be used to access the LOGS public API
5
+ programatically via python scripts.
6
+ ...
7
+ """