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,52 @@
1
+ from typing import List, Optional
2
+
3
+ from LOGS.Auxiliary.Decorators import Endpoint
4
+ from LOGS.Entities.ProjectPersonPermission import ProjectPersonPermission
5
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
6
+ from LOGS.Interfaces.IEntryRecord import IEntryRecord
7
+ from LOGS.Interfaces.ILockableEntity import ILockableEntity
8
+ from LOGS.Interfaces.IModificationRecord import IModificationRecord
9
+ from LOGS.Interfaces.INamedEntity import INamedEntity
10
+ from LOGS.Interfaces.IOwnedEntity import IOwnedEntity
11
+ from LOGS.Interfaces.IPermissionedEntity import IGenericPermissionEntity
12
+ from LOGS.Interfaces.ITypedEntity import ITypedEntity
13
+ from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
14
+ from LOGS.LOGSConnection import LOGSConnection
15
+
16
+
17
+ @Endpoint("projects")
18
+ class Project(
19
+ IEntityWithIntId,
20
+ IUniqueEntity,
21
+ INamedEntity,
22
+ ITypedEntity,
23
+ IOwnedEntity,
24
+ IEntryRecord,
25
+ IModificationRecord,
26
+ ILockableEntity,
27
+ IGenericPermissionEntity,
28
+ ):
29
+
30
+ _projectPersonPermissions: Optional[List[ProjectPersonPermission]] = None
31
+
32
+ def __init__(
33
+ self,
34
+ ref=None,
35
+ id: Optional[int] = None,
36
+ connection: Optional[LOGSConnection] = None,
37
+ name: Optional[str] = None,
38
+ ):
39
+ """Represents a connected LOGS entity type"""
40
+
41
+ self._name = name
42
+ super().__init__(ref=ref, id=id, connection=connection)
43
+
44
+ @property
45
+ def projectPersonPermissions(self) -> Optional[List[ProjectPersonPermission]]:
46
+ return self._projectPersonPermissions
47
+
48
+ @projectPersonPermissions.setter
49
+ def projectPersonPermissions(self, value):
50
+ self._projectPersonPermissions = self.checkListAndConvertNullable(
51
+ value, ProjectPersonPermission, "projectPersonPermissions"
52
+ )
@@ -0,0 +1,8 @@
1
+ from LOGS.Auxiliary.Decorators import FullModel
2
+ from LOGS.Entities.Project import Project
3
+ from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
4
+
5
+
6
+ @FullModel(Project)
7
+ class ProjectMinimal(EntityMinimalWithIntId[Project]):
8
+ pass
@@ -0,0 +1,102 @@
1
+ from typing import TYPE_CHECKING, Any, Callable, Optional, Tuple, Union
2
+
3
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
4
+ from LOGS.Entity.ConnectedEntity import ConnectedEntity
5
+
6
+ if TYPE_CHECKING:
7
+ from LOGS.Entities.PersonMinimal import PersonMinimal
8
+ from LOGS.Entities.ProjectMinimal import ProjectMinimal
9
+
10
+
11
+ class ProjectPersonPermission(ConnectedEntity):
12
+ _person: Optional["PersonMinimal"] = None
13
+ _project: Optional["ProjectMinimal"] = None
14
+ _administer: Optional[bool] = None
15
+ _edit: Optional[bool] = None
16
+ _add: Optional[bool] = None
17
+ _read: Optional[bool] = None
18
+
19
+ def _fromRef(
20
+ self,
21
+ ref,
22
+ selfClass,
23
+ convertOtherType: Union[Tuple[type, Callable[[Any], Any]], None] = None,
24
+ ):
25
+ if isinstance(ref, dict) and "read" in ref:
26
+ self._read = ref["read"]
27
+ del ref["read"]
28
+ return super()._fromRef(ref, selfClass, convertOtherType)
29
+
30
+ def __str__(self):
31
+ attrList = self._getAttrList()
32
+
33
+ s1 = f"'{self.person.name}'" if self.person else ""
34
+ s2 = ",".join(k for k in attrList if getattr(self, k, None) is True)
35
+ return f"<{type(self).__name__} {s1} access:{s2}>"
36
+
37
+ def contentToString(self, indentation: int = 1, hideNone: bool = False) -> str:
38
+ return str(self)
39
+
40
+ @property
41
+ def person(self) -> Optional["PersonMinimal"]:
42
+ return self._person
43
+
44
+ @person.setter
45
+ def person(self, value):
46
+ self._person = MinimalModelGenerator.MinimalFromSingle(
47
+ value, "PersonMinimal", "person", self._getConnection()
48
+ )
49
+
50
+ @property
51
+ def project(self) -> Optional["ProjectMinimal"]:
52
+ return self._project
53
+
54
+ @project.setter
55
+ def project(self, value):
56
+ self._project = MinimalModelGenerator.MinimalFromSingle(
57
+ value, "ProjectMinimal", "project", self._getConnection()
58
+ )
59
+
60
+ @property
61
+ def administer(self) -> Optional[bool]:
62
+ return self._administer
63
+
64
+ @administer.setter
65
+ def administer(self, value):
66
+ self._administer = self.checkAndConvertNullable(value, bool, "administer")
67
+ if self._administer:
68
+ self._edit = True
69
+ self._add = True
70
+
71
+ @property
72
+ def edit(self) -> Optional[bool]:
73
+ return self._edit
74
+
75
+ @edit.setter
76
+ def edit(self, value):
77
+ self._edit = self.checkAndConvertNullable(value, bool, "edit")
78
+ if self._edit:
79
+ self._add = True
80
+ else:
81
+ self._administer = False
82
+
83
+ @property
84
+ def add(self) -> Optional[bool]:
85
+ return self._add
86
+
87
+ @add.setter
88
+ def add(self, value):
89
+ self._add = self.checkAndConvertNullable(value, bool, "add")
90
+ if not self._add:
91
+ self._edit = False
92
+ self._administer = False
93
+
94
+ @property
95
+ def read(self) -> Optional[bool]:
96
+ return self._read
97
+
98
+ @read.setter
99
+ def read(self, _):
100
+ raise Exception(
101
+ "Every person added to a project has automatically read permissions."
102
+ )
@@ -0,0 +1,58 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import List, Optional, Type, cast
3
+
4
+ from typing_extensions import Self
5
+
6
+ from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
7
+ from LOGS.Entity.IGenericEntityOrderBy import (
8
+ IEntryRecordSortingOptions,
9
+ IGenericEntitySortingOptions,
10
+ IModificationRecordSortingOptions,
11
+ INamedEntitySortingOptions,
12
+ ITypedEntitySortingOptions,
13
+ )
14
+ from LOGS.Interfaces.IEntryRecord import IEntryRecordRequest
15
+ from LOGS.Interfaces.ILockableEntity import ILockableEntityRequest
16
+ from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
17
+ from LOGS.Interfaces.INamedEntity import INamedEntityRequest
18
+ from LOGS.Interfaces.IOwnedEntity import IOwnedEntityRequest
19
+ from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
20
+ from LOGS.Interfaces.ITypedEntity import ITypedEntityRequest
21
+ from LOGS.Interfaces.IUniqueEntity import IUniqueEntityRequest
22
+
23
+
24
+ class ProjectSortingOptions(
25
+ IGenericEntitySortingOptions,
26
+ INamedEntitySortingOptions,
27
+ IEntryRecordSortingOptions,
28
+ IModificationRecordSortingOptions,
29
+ ITypedEntitySortingOptions,
30
+ ):
31
+ DATASET_COUNT: Self = cast(Self, "DATASET_COUNT")
32
+ INVENTORY_ITEM_COUNT: Self = cast(Self, "INVENTORY_ITEM_COUNT")
33
+ LAB_NOTEBOOK_COUNT: Self = cast(Self, "LAB_NOTEBOOK_COUNT")
34
+ SAMPLE_COUNT: Self = cast(Self, "SAMPLE_COUNT")
35
+
36
+
37
+ @dataclass
38
+ class ProjectRequestParameter(
39
+ EntityRequestParameter[ProjectSortingOptions],
40
+ IPermissionedEntityRequest,
41
+ IUniqueEntityRequest,
42
+ INamedEntityRequest,
43
+ IOwnedEntityRequest,
44
+ IEntryRecordRequest,
45
+ IModificationRecordRequest,
46
+ ILockableEntityRequest,
47
+ ITypedEntityRequest,
48
+ ):
49
+ _orderByType: Type[ProjectSortingOptions] = field(
50
+ default=ProjectSortingOptions, init=False
51
+ )
52
+
53
+ inventoryItemIds: Optional[List[int]] = None
54
+ labNotebookIds: Optional[List[int]] = None
55
+ personIds: Optional[List[int]] = None
56
+ datasetIds: Optional[List[int]] = None
57
+ sampleIds: Optional[List[int]] = None
58
+ currentUserHasAddPermission: Optional[bool] = None
@@ -0,0 +1,12 @@
1
+ from LOGS.Auxiliary.Decorators import Endpoint
2
+ from LOGS.Entities.Project import Project
3
+ from LOGS.Entities.ProjectRequestParameter import ProjectRequestParameter
4
+ from LOGS.Entity.EntityIterator import EntityIterator
5
+
6
+
7
+ @Endpoint("projects")
8
+ class Projects(EntityIterator[Project, ProjectRequestParameter]):
9
+ """LOGS connected Projects iterator"""
10
+
11
+ _generatorType = Project
12
+ _parameterType = ProjectRequestParameter
LOGS/Entities/Role.py ADDED
@@ -0,0 +1,94 @@
1
+ from typing import TYPE_CHECKING, List, Optional
2
+
3
+ from LOGS.Auxiliary import MinimalModelGenerator
4
+ from LOGS.Auxiliary.Decorators import Endpoint
5
+ from LOGS.Entities.Permission import Permission
6
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
7
+ from LOGS.Interfaces.IEntryRecord import IEntryRecord
8
+ from LOGS.Interfaces.IModificationRecord import IModificationRecord
9
+ from LOGS.Interfaces.INamedEntity import INamedEntity
10
+ from LOGS.Interfaces.IPermissionedEntity import IGenericPermissionEntity
11
+ from LOGS.LOGSConnection import LOGSConnection
12
+
13
+ if TYPE_CHECKING:
14
+ from LOGS.Entities.PersonMinimal import PersonMinimal
15
+
16
+
17
+ @Endpoint("roles")
18
+ class Role(
19
+ IEntityWithIntId,
20
+ INamedEntity,
21
+ IGenericPermissionEntity,
22
+ IEntryRecord,
23
+ IModificationRecord,
24
+ ):
25
+
26
+ _rolePermissions: Optional[List["Permission"]] = None
27
+ _users: Optional[List["PersonMinimal"]] = None
28
+ _isInternal: Optional[bool] = None
29
+ _roleId: Optional[str] = None
30
+ _description: Optional[str] = None
31
+ _isDefault: Optional[bool] = None
32
+
33
+ def __init__(
34
+ self,
35
+ ref=None,
36
+ id: Optional[int] = None,
37
+ connection: Optional["LOGSConnection"] = None,
38
+ ):
39
+ if isinstance(ref, str):
40
+ ref = {"roleId": ref}
41
+
42
+ super().__init__(ref=ref, id=id, connection=connection)
43
+
44
+ @property
45
+ def rolePermissions(self) -> Optional[List["Permission"]]:
46
+ return self._rolePermissions
47
+
48
+ @rolePermissions.setter
49
+ def rolePermissions(self, value):
50
+ self._rolePermissions = self.checkListAndConvertNullable(
51
+ value, Permission, "rolePermissions"
52
+ )
53
+
54
+ @property
55
+ def users(self) -> Optional[List["PersonMinimal"]]:
56
+ return self._users
57
+
58
+ @users.setter
59
+ def users(self, value):
60
+ self._users = MinimalModelGenerator.MinimalFromList(
61
+ value, "PersonMinimal", "users", self._getConnection()
62
+ )
63
+
64
+ @property
65
+ def isInternal(self) -> Optional[bool]:
66
+ return self._isInternal
67
+
68
+ @isInternal.setter
69
+ def isInternal(self, value):
70
+ self._isInternal = self.checkAndConvertNullable(value, bool, "isInternal")
71
+
72
+ @property
73
+ def roleId(self) -> Optional[str]:
74
+ return self._roleId
75
+
76
+ @roleId.setter
77
+ def roleId(self, value):
78
+ self._roleId = self.checkAndConvertNullable(value, str, "roleId")
79
+
80
+ @property
81
+ def description(self) -> Optional[str]:
82
+ return self._description
83
+
84
+ @description.setter
85
+ def description(self, value):
86
+ self._description = self.checkAndConvertNullable(value, str, "description")
87
+
88
+ @property
89
+ def isDefault(self) -> Optional[bool]:
90
+ return self._isDefault
91
+
92
+ @isDefault.setter
93
+ def isDefault(self, value):
94
+ self._isDefault = self.checkAndConvertNullable(value, bool, "isDefault")
@@ -0,0 +1,8 @@
1
+ from LOGS.Auxiliary.Decorators import FullModel
2
+ from LOGS.Entities.Role import Role
3
+ from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
4
+
5
+
6
+ @FullModel(Role)
7
+ class RoleMinimal(EntityMinimalWithIntId[Role]):
8
+ pass
@@ -0,0 +1,40 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import Optional, Type, cast
3
+
4
+ from typing_extensions import Self
5
+
6
+ from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
7
+ from LOGS.Entity.IGenericEntityOrderBy import (
8
+ IEntryRecordSortingOptions,
9
+ IGenericEntitySortingOptions,
10
+ IModificationRecordSortingOptions,
11
+ INamedEntitySortingOptions,
12
+ )
13
+ from LOGS.Interfaces.IEntryRecord import IEntryRecordRequest
14
+ from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
15
+ from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
16
+
17
+
18
+ class RoleSortingOptions(
19
+ IGenericEntitySortingOptions,
20
+ INamedEntitySortingOptions,
21
+ IEntryRecordSortingOptions,
22
+ IModificationRecordSortingOptions,
23
+ ):
24
+ IS_INTERNAL: Self = cast(Self, "IS_INTERNAL")
25
+
26
+
27
+ @dataclass
28
+ class RoleRequestParameter(
29
+ EntityRequestParameter[RoleSortingOptions],
30
+ IEntryRecordRequest,
31
+ IModificationRecordRequest,
32
+ IPermissionedEntityRequest,
33
+ ):
34
+ _orderByType: Type[RoleSortingOptions] = field(
35
+ default=RoleSortingOptions, init=False
36
+ )
37
+
38
+ name: Optional[str] = None
39
+ roleId: Optional[str] = None
40
+ includeInternals: Optional[bool] = None
LOGS/Entities/Roles.py ADDED
@@ -0,0 +1,12 @@
1
+ from LOGS.Auxiliary.Decorators import Endpoint
2
+ from LOGS.Entities.Role import Role
3
+ from LOGS.Entities.RoleRequestParameter import RoleRequestParameter
4
+ from LOGS.Entity.EntityIterator import EntityIterator
5
+
6
+
7
+ @Endpoint("Roles")
8
+ class Roles(EntityIterator[Role, RoleRequestParameter]):
9
+ """LOGS connected Person iterator"""
10
+
11
+ _generatorType = Role
12
+ _parameterType = RoleRequestParameter
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class RunState(Enum):
5
+ Running = "Running"
6
+ Failed = "Failed"
7
+ Finished = "Finished"
8
+ Waiting = "Waiting"
9
+ Aborted = "Aborted"
@@ -0,0 +1,53 @@
1
+ from typing import TYPE_CHECKING, List, Optional, Union, cast
2
+
3
+ from LOGS.Auxiliary.Decorators import Endpoint
4
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
5
+ from LOGS.Interfaces.IEntryRecord import IEntryRecord
6
+ from LOGS.Interfaces.ILockableEntity import ILockableEntity
7
+ from LOGS.Interfaces.IModificationRecord import IModificationRecord
8
+ from LOGS.Interfaces.INamedEntity import INamedEntity
9
+ from LOGS.Interfaces.IOwnedEntity import IOwnedEntity
10
+ from LOGS.Interfaces.IPermissionedEntity import IGenericPermissionEntity
11
+ from LOGS.Interfaces.IProjectBased import IProjectBased
12
+ from LOGS.Interfaces.ISignableEntity import ISignableEntity
13
+ from LOGS.Interfaces.ISoftDeletable import ISoftDeletable
14
+ from LOGS.Interfaces.ITypedEntity import ITypedEntity
15
+ from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
16
+ from LOGS.LOGSConnection import LOGSConnection
17
+
18
+ if TYPE_CHECKING:
19
+ from LOGS.Entities.Project import Project
20
+ from LOGS.Entities.ProjectMinimal import ProjectMinimal
21
+
22
+
23
+ @Endpoint("samples")
24
+ class Sample(
25
+ IEntityWithIntId,
26
+ IUniqueEntity,
27
+ INamedEntity,
28
+ ITypedEntity,
29
+ IOwnedEntity,
30
+ IProjectBased,
31
+ IEntryRecord,
32
+ IModificationRecord,
33
+ ISoftDeletable,
34
+ ILockableEntity,
35
+ ISignableEntity,
36
+ IGenericPermissionEntity,
37
+ ):
38
+
39
+ def __init__(
40
+ self,
41
+ ref=None,
42
+ id: Optional[int] = None,
43
+ connection: Optional[LOGSConnection] = None,
44
+ name: str = "",
45
+ projects: Optional[List[Union["ProjectMinimal", "Project"]]] = None,
46
+ ):
47
+ self._name = name
48
+ self._projects = cast(Optional[List["ProjectMinimal"]], projects)
49
+
50
+ if ref != None and isinstance(ref, (str, int, float)):
51
+ ref = {"text": str(ref)}
52
+
53
+ super().__init__(ref=ref, id=id, connection=connection)
@@ -0,0 +1,8 @@
1
+ from LOGS.Auxiliary.Decorators import FullModel
2
+ from LOGS.Entities.Sample import Sample
3
+ from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
4
+
5
+
6
+ @FullModel(Sample)
7
+ class SampleMinimal(EntityMinimalWithIntId[Sample]):
8
+ pass
@@ -0,0 +1,54 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import Type, cast
3
+
4
+ from typing_extensions import Self
5
+
6
+ from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
7
+ from LOGS.Entity.IGenericEntityOrderBy import (
8
+ IEntryRecordSortingOptions,
9
+ IGenericEntitySortingOptions,
10
+ IModificationRecordSortingOptions,
11
+ INamedEntitySortingOptions,
12
+ ITypedEntitySortingOptions,
13
+ )
14
+ from LOGS.Interfaces.IEntryRecord import IEntryRecordRequest
15
+ from LOGS.Interfaces.ILockableEntity import ILockableEntityRequest
16
+ from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
17
+ from LOGS.Interfaces.INamedEntity import INamedEntityRequest
18
+ from LOGS.Interfaces.IOwnedEntity import IOwnedEntityRequest
19
+ from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
20
+ from LOGS.Interfaces.IProjectBased import IProjectBasedRequest
21
+ from LOGS.Interfaces.ISignableEntity import ISignableEntityRequest
22
+ from LOGS.Interfaces.ISoftDeletable import ISoftDeletableRequest
23
+ from LOGS.Interfaces.ITypedEntity import ITypedEntityRequest
24
+ from LOGS.Interfaces.IUniqueEntity import IUniqueEntityRequest
25
+
26
+
27
+ class SampleSortingOptions(
28
+ IGenericEntitySortingOptions,
29
+ INamedEntitySortingOptions,
30
+ IModificationRecordSortingOptions,
31
+ IEntryRecordSortingOptions,
32
+ ITypedEntitySortingOptions,
33
+ ):
34
+ OWNER: Self = cast(Self, "OWNER")
35
+
36
+
37
+ @dataclass
38
+ class SampleRequestParameter(
39
+ EntityRequestParameter[SampleSortingOptions],
40
+ IPermissionedEntityRequest,
41
+ IUniqueEntityRequest,
42
+ INamedEntityRequest,
43
+ IOwnedEntityRequest,
44
+ IProjectBasedRequest,
45
+ IEntryRecordRequest,
46
+ IModificationRecordRequest,
47
+ ISoftDeletableRequest,
48
+ ILockableEntityRequest,
49
+ ISignableEntityRequest,
50
+ ITypedEntityRequest,
51
+ ):
52
+ _orderByType: Type[SampleSortingOptions] = field(
53
+ default=SampleSortingOptions, init=False
54
+ )
@@ -0,0 +1,12 @@
1
+ from LOGS.Auxiliary.Decorators import Endpoint
2
+ from LOGS.Entities.Sample import Sample
3
+ from LOGS.Entities.SampleRequestParameter import SampleRequestParameter
4
+ from LOGS.Entity.EntityIterator import EntityIterator
5
+
6
+
7
+ @Endpoint("samples")
8
+ class Samples(EntityIterator[Sample, SampleRequestParameter]):
9
+ """LOGS connected Samples iterator"""
10
+
11
+ _generatorType = Sample
12
+ _parameterType = SampleRequestParameter
@@ -0,0 +1,87 @@
1
+ from typing import TYPE_CHECKING, List, Optional
2
+
3
+ from deprecation import deprecated # type: ignore
4
+
5
+ from LOGS.Auxiliary.Decorators import Endpoint
6
+ from LOGS.Auxiliary.MinimalModelGenerator import MinimalModelGenerator
7
+ from LOGS.Entity.EntityWithIntId import IEntityWithIntId
8
+ from LOGS.Interfaces.IEntryRecord import IEntryRecord
9
+ from LOGS.Interfaces.IModificationRecord import IModificationRecord
10
+ from LOGS.Interfaces.INamedEntity import INamedEntity
11
+ from LOGS.Interfaces.IOwnedEntity import IOwnedEntity
12
+ from LOGS.Interfaces.IPermissionedEntity import IGenericPermissionEntity
13
+ from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
14
+
15
+ if TYPE_CHECKING:
16
+ from LOGS.Entities.DatasetMinimal import DatasetMinimal
17
+
18
+
19
+ @Endpoint("shared_content")
20
+ class SharedContent(
21
+ IEntityWithIntId,
22
+ IGenericPermissionEntity,
23
+ IUniqueEntity,
24
+ INamedEntity,
25
+ IOwnedEntity,
26
+ IEntryRecord,
27
+ IModificationRecord,
28
+ ):
29
+
30
+ _shareId: Optional[str] = None
31
+ _allowContentDownload: Optional[bool] = None
32
+ _publicNotes: Optional[str] = None
33
+ _privateNotes: Optional[str] = None
34
+ _password: Optional[str] = None
35
+ _datasets: Optional[List["DatasetMinimal"]] = None
36
+
37
+ @property
38
+ def shareId(self) -> Optional[str]:
39
+ return self._shareId
40
+
41
+ @shareId.setter
42
+ def shareId(self, value):
43
+ self._shareId = self.checkAndConvertNullable(value, str, "shareId")
44
+
45
+ @property
46
+ def allowContentDownload(self) -> Optional[bool]:
47
+ return self._allowContentDownload
48
+
49
+ @allowContentDownload.setter
50
+ def allowContentDownload(self, value):
51
+ self._allowContentDownload = self.checkAndConvertNullable(
52
+ value, bool, "allowContentDownload"
53
+ )
54
+
55
+ @property
56
+ def publicNotes(self) -> Optional[str]:
57
+ return self._publicNotes
58
+
59
+ @publicNotes.setter
60
+ def publicNotes(self, value):
61
+ self._publicNotes = self.checkAndConvertNullable(value, str, "publicNotes")
62
+
63
+ @property
64
+ def privateNotes(self) -> Optional[str]:
65
+ return self._privateNotes
66
+
67
+ @privateNotes.setter
68
+ def privateNotes(self, value):
69
+ self._privateNotes = self.checkAndConvertNullable(value, str, "privateNotes")
70
+
71
+ @property
72
+ def password(self) -> Optional[str]:
73
+ return self._password
74
+
75
+ @password.setter
76
+ def password(self, value):
77
+ self._password = self.checkAndConvertNullable(value, str, "password")
78
+
79
+ @property
80
+ def datasets(self) -> Optional[List["DatasetMinimal"]]:
81
+ return self._datasets
82
+
83
+ @datasets.setter
84
+ def datasets(self, value):
85
+ self._datasets = MinimalModelGenerator.MinimalFromList(
86
+ value, "DatasetMinimal", "datasets", connection=self._getConnection()
87
+ )
@@ -0,0 +1,8 @@
1
+ from LOGS.Auxiliary.Decorators import FullModel
2
+ from LOGS.Entities.SharedContent import SharedContent
3
+ from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
4
+
5
+
6
+ @FullModel(SharedContent)
7
+ class SharedContentMinimal(EntityMinimalWithIntId[SharedContent]):
8
+ pass
@@ -0,0 +1,38 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import List, Optional, Type
3
+
4
+ from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
5
+ from LOGS.Entity.IGenericEntityOrderBy import (
6
+ IEntryRecordSortingOptions,
7
+ IGenericEntitySortingOptions,
8
+ IModificationRecordSortingOptions,
9
+ INamedEntitySortingOptions,
10
+ )
11
+ from LOGS.Interfaces.IEntryRecord import IEntryRecordRequest
12
+ from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
13
+ from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
14
+ from LOGS.Interfaces.ISoftDeletable import ISoftDeletableRequest
15
+
16
+
17
+ class SharedContentSortingOptions(
18
+ IGenericEntitySortingOptions,
19
+ INamedEntitySortingOptions,
20
+ IEntryRecordSortingOptions,
21
+ IModificationRecordSortingOptions,
22
+ ):
23
+ pass
24
+
25
+
26
+ @dataclass
27
+ class SharedContentRequestParameter(
28
+ EntityRequestParameter[SharedContentSortingOptions],
29
+ ISoftDeletableRequest,
30
+ IEntryRecordRequest,
31
+ IModificationRecordRequest,
32
+ IPermissionedEntityRequest,
33
+ ):
34
+ _orderByType: Type[SharedContentSortingOptions] = field(
35
+ default=SharedContentSortingOptions, init=False
36
+ )
37
+
38
+ datasetIds: Optional[List[int]] = None
@@ -0,0 +1,12 @@
1
+ from LOGS.Auxiliary.Decorators import Endpoint
2
+ from LOGS.Entities.SharedContent import SharedContent
3
+ from LOGS.Entities.SharedContentRequestParameter import SharedContentRequestParameter
4
+ from LOGS.Entity.EntityIterator import EntityIterator
5
+
6
+
7
+ @Endpoint("shared_content")
8
+ class SharedContents(EntityIterator[SharedContent, SharedContentRequestParameter]):
9
+ """LOGS connected SharedContents iterator"""
10
+
11
+ _generatorType = SharedContent
12
+ _parameterType = SharedContentRequestParameter