pinexq-client 0.3.0.20240620.2__py3-none-any.whl → 0.4.2.20241009.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pinexq_client/core/enterapi.py +8 -9
- pinexq_client/core/exceptions.py +73 -2
- pinexq_client/core/hco/action_hco.py +12 -22
- pinexq_client/core/hco/action_with_parameters_hco.py +15 -21
- pinexq_client/core/hco/download_link_hco.py +2 -3
- pinexq_client/core/hco/hco_base.py +2 -3
- pinexq_client/core/hco/link_hco.py +10 -9
- pinexq_client/core/hco/unavailable.py +17 -0
- pinexq_client/core/hco/upload_action_hco.py +11 -10
- pinexq_client/core/model/error.py +5 -1
- pinexq_client/core/sirenaccess.py +18 -27
- pinexq_client/job_management/__init__.py +1 -1
- pinexq_client/job_management/enterjma.py +2 -4
- pinexq_client/job_management/hcos/entrypoint_hco.py +36 -35
- pinexq_client/job_management/hcos/input_dataslot_hco.py +53 -51
- pinexq_client/job_management/hcos/job_hco.py +121 -120
- pinexq_client/job_management/hcos/job_query_result_hco.py +72 -47
- pinexq_client/job_management/hcos/jobsroot_hco.py +44 -42
- pinexq_client/job_management/hcos/output_dataslot_hco.py +1 -1
- pinexq_client/job_management/hcos/processing_step_hco.py +71 -70
- pinexq_client/job_management/hcos/processingstep_query_result_hco.py +76 -51
- pinexq_client/job_management/hcos/processingsteproot_hco.py +44 -43
- pinexq_client/job_management/hcos/workdata_hco.py +81 -80
- pinexq_client/job_management/hcos/workdata_query_result_hco.py +75 -52
- pinexq_client/job_management/hcos/workdataroot_hco.py +53 -52
- pinexq_client/job_management/model/open_api_generated.py +3 -1
- pinexq_client/job_management/tool/job.py +108 -11
- pinexq_client/job_management/tool/job_group.py +158 -0
- pinexq_client/job_management/tool/processing_step.py +83 -5
- pinexq_client/job_management/tool/workdata.py +8 -0
- {pinexq_client-0.3.0.20240620.2.dist-info → pinexq_client-0.4.2.20241009.1.dist-info}/METADATA +2 -2
- pinexq_client-0.4.2.20241009.1.dist-info/RECORD +53 -0
- {pinexq_client-0.3.0.20240620.2.dist-info → pinexq_client-0.4.2.20241009.1.dist-info}/WHEEL +1 -1
- pinexq_client-0.4.2.20241009.1.dist-info/entry_points.txt +4 -0
- pinexq_client-0.3.0.20240620.2.dist-info/RECORD +0 -50
- {pinexq_client-0.3.0.20240620.2.dist-info → pinexq_client-0.4.2.20241009.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,12 +6,13 @@ from pinexq_client.core import MediaTypes, Link
|
|
|
6
6
|
from pinexq_client.core.hco.action_with_parameters_hco import ActionWithParametersHco
|
|
7
7
|
from pinexq_client.core.hco.hco_base import Hco
|
|
8
8
|
from pinexq_client.core.hco.link_hco import LinkHco
|
|
9
|
+
from pinexq_client.core.hco.unavailable import UnavailableAction, UnavailableLink
|
|
9
10
|
from pinexq_client.job_management.hcos.processing_step_hco import ProcessingStepLink, ProcessingStepHco
|
|
10
11
|
from pinexq_client.job_management.hcos.processing_step_used_tags_hco import ProcessingStepUsedTagsLink
|
|
11
12
|
from pinexq_client.job_management.hcos.processingstep_query_result_hco import (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
ProcessingStepQueryResultHco,
|
|
14
|
+
ProcessingStepQueryResultLink,
|
|
15
|
+
ProcessingStepQueryResultPaginationLink
|
|
15
16
|
)
|
|
16
17
|
from pinexq_client.job_management.known_relations import Relations
|
|
17
18
|
from pinexq_client.job_management.model import ProcessingStepQueryParameters, CreateProcessingStepParameters
|
|
@@ -19,54 +20,54 @@ from pinexq_client.job_management.model.sirenentities import ProcessingStepsRoot
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
class ProcessingStepQueryAction(ActionWithParametersHco[ProcessingStepQueryParameters]):
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
def execute(self, parameters: ProcessingStepQueryParameters) -> ProcessingStepQueryResultHco:
|
|
24
|
+
url = self._execute_returns_url(parameters)
|
|
25
|
+
link = Link.from_url(url, [str(Relations.CREATED_RESSOURCE)], "Created query", MediaTypes.SIREN)
|
|
26
|
+
# resolve link immediately
|
|
27
|
+
return ProcessingStepQueryResultLink.from_link(self._client, link).navigate()
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
def default_parameters(self) -> ProcessingStepQueryParameters:
|
|
30
|
+
return self._get_default_parameters(ProcessingStepQueryParameters, ProcessingStepQueryParameters())
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
class ProcessingStepRegisterNewAction(ActionWithParametersHco[CreateProcessingStepParameters]):
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
def execute(self, parameters: CreateProcessingStepParameters) -> ProcessingStepHco:
|
|
35
|
+
url = self._execute_returns_url(parameters)
|
|
36
|
+
link = Link.from_url(url, [str(Relations.CREATED_RESSOURCE)], "Created processing-step", MediaTypes.SIREN)
|
|
37
|
+
# resolve link immediately
|
|
38
|
+
return ProcessingStepLink.from_link(self._client, link).navigate()
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
def default_parameters(self) -> CreateProcessingStepParameters:
|
|
41
|
+
return self._get_default_parameters(CreateProcessingStepParameters, CreateProcessingStepParameters())
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
class ProcessingStepsRootLink(LinkHco):
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
def navigate(self) -> 'ProcessingStepsRootHco':
|
|
46
|
+
return ProcessingStepsRootHco.from_entity(self._navigate_internal(ProcessingStepsRootEntity), self._client)
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
class ProcessingStepsRootHco(Hco[ProcessingStepsRootEntity]):
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
50
|
+
query_action: ProcessingStepQueryAction | UnavailableAction
|
|
51
|
+
register_new_action: ProcessingStepRegisterNewAction | UnavailableAction
|
|
52
|
+
|
|
53
|
+
self_link: ProcessingStepsRootLink
|
|
54
|
+
all_link: ProcessingStepQueryResultPaginationLink | UnavailableLink
|
|
55
|
+
used_tags_link: ProcessingStepUsedTagsLink | UnavailableLink
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_entity(cls, entity: ProcessingStepsRootEntity, client: httpx.Client) -> Self:
|
|
59
|
+
instance = cls(client, entity)
|
|
60
|
+
Hco.check_classes(instance._entity.class_, ["ProcessingStepRoot"])
|
|
61
|
+
|
|
62
|
+
instance.register_new_action = ProcessingStepRegisterNewAction.from_entity_optional(
|
|
63
|
+
client, instance._entity, "RegisterNewProcessingStep")
|
|
64
|
+
instance.query_action = ProcessingStepQueryAction.from_entity_optional(
|
|
65
|
+
client, instance._entity, "CreateProcessingStepQuery")
|
|
66
|
+
instance.used_tags_link = ProcessingStepUsedTagsLink.from_entity_optional(
|
|
67
|
+
instance._client, instance._entity, Relations.USED_TAGS)
|
|
68
|
+
instance.self_link = ProcessingStepsRootLink.from_entity(
|
|
69
|
+
instance._client, instance._entity, Relations.SELF)
|
|
70
|
+
instance.all_link = ProcessingStepQueryResultPaginationLink.from_entity_optional(
|
|
71
|
+
instance._client, instance._entity, Relations.ALL)
|
|
72
|
+
|
|
73
|
+
return instance
|
|
@@ -8,120 +8,121 @@ from pinexq_client.core.hco.action_with_parameters_hco import ActionWithParamete
|
|
|
8
8
|
from pinexq_client.core.hco.download_link_hco import DownloadLinkHco
|
|
9
9
|
from pinexq_client.core.hco.hco_base import Hco, Property
|
|
10
10
|
from pinexq_client.core.hco.link_hco import LinkHco
|
|
11
|
+
from pinexq_client.core.hco.unavailable import UnavailableAction
|
|
11
12
|
from pinexq_client.job_management.known_relations import Relations
|
|
12
13
|
from pinexq_client.job_management.model.open_api_generated import (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
SetNameWorkDataParameters,
|
|
15
|
+
SetCommentWorkDataParameters,
|
|
16
|
+
SetTagsWorkDataParameters,
|
|
17
|
+
WorkDataKind
|
|
17
18
|
)
|
|
18
19
|
from pinexq_client.job_management.model.sirenentities import WorkDataEntity
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
class WorkDataLink(LinkHco):
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
def navigate(self) -> 'WorkDataHco':
|
|
24
|
+
return WorkDataHco.from_entity(self._navigate_internal(WorkDataEntity), self._client)
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class WorkDataDeleteAction(ActionHco):
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
def execute(self):
|
|
29
|
+
self._execute_internal()
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
class WorkDataRenameAction(ActionWithParametersHco[SetNameWorkDataParameters]):
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
def execute(self, parameters: SetNameWorkDataParameters):
|
|
34
|
+
self._execute(parameters)
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
def default_parameters(self) -> SetNameWorkDataParameters:
|
|
37
|
+
return self._get_default_parameters(SetNameWorkDataParameters, SetNameWorkDataParameters())
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
class WorkDataEditCommentAction(ActionWithParametersHco[SetCommentWorkDataParameters]):
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
def execute(self, parameters: SetCommentWorkDataParameters):
|
|
42
|
+
self._execute(parameters)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
def default_parameters(self) -> SetCommentWorkDataParameters:
|
|
45
|
+
return self._get_default_parameters(SetCommentWorkDataParameters, SetCommentWorkDataParameters())
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
class WorkDataEditTagsAction(ActionWithParametersHco[SetTagsWorkDataParameters]):
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
def execute(self, parameters: SetTagsWorkDataParameters):
|
|
50
|
+
self._execute(parameters)
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
def default_parameters(self) -> SetTagsWorkDataParameters:
|
|
53
|
+
# todo check why we have to manually set tags
|
|
54
|
+
return self._get_default_parameters(SetTagsWorkDataParameters, SetTagsWorkDataParameters(tags=[]))
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
class WorkDataAllowDeletionAction(ActionHco):
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
def execute(self):
|
|
59
|
+
self._execute_internal()
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
class WorkDataDisallowAction(ActionHco):
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
def execute(self):
|
|
64
|
+
self._execute_internal()
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
class WorkDataHideAction(ActionHco):
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
def execute(self):
|
|
69
|
+
self._execute_internal()
|
|
69
70
|
|
|
70
71
|
|
|
71
72
|
class WorkDataUnHideAction(ActionHco):
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
def execute(self):
|
|
74
|
+
self._execute_internal()
|
|
74
75
|
|
|
75
76
|
|
|
76
77
|
class WorkDataHco(Hco[WorkDataEntity]):
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
78
|
+
name: str | None = Property()
|
|
79
|
+
created_at: datetime | None = Property()
|
|
80
|
+
size_in_bytes: int | None = Property()
|
|
81
|
+
tags: list[str] | None = Property()
|
|
82
|
+
media_type: str | None = Property()
|
|
83
|
+
kind: WorkDataKind | None = Property()
|
|
84
|
+
comments: str | None = Property()
|
|
85
|
+
is_deletable: bool | None = Property()
|
|
86
|
+
hidden: bool | None = Property()
|
|
87
|
+
|
|
88
|
+
delete_action: WorkDataDeleteAction | UnavailableAction
|
|
89
|
+
hide_action: WorkDataHideAction | UnavailableAction
|
|
90
|
+
unhide_action: WorkDataUnHideAction | UnavailableAction
|
|
91
|
+
allow_deletion_action: WorkDataAllowDeletionAction | UnavailableAction
|
|
92
|
+
disallow_deletion_action: WorkDataDisallowAction | UnavailableAction
|
|
93
|
+
rename_action: WorkDataRenameAction | UnavailableAction
|
|
94
|
+
edit_comment_action: WorkDataEditCommentAction | UnavailableAction
|
|
95
|
+
edit_tags_action: WorkDataEditTagsAction | UnavailableAction
|
|
96
|
+
|
|
97
|
+
self_link: WorkDataLink
|
|
98
|
+
download_link: DownloadLinkHco
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_entity(cls, entity: WorkDataEntity, client: httpx.Client) -> Self:
|
|
102
|
+
instance = cls(client, entity)
|
|
103
|
+
Hco.check_classes(instance._entity.class_, ["WorkData"])
|
|
104
|
+
|
|
105
|
+
# actions
|
|
106
|
+
instance.hide_action = WorkDataHideAction.from_entity_optional(
|
|
107
|
+
client, instance._entity, "Hide")
|
|
108
|
+
instance.unhide_action = WorkDataUnHideAction.from_entity_optional(
|
|
109
|
+
client, instance._entity, "UnHide")
|
|
110
|
+
instance.delete_action = WorkDataDeleteAction.from_entity_optional(
|
|
111
|
+
client, instance._entity, "Delete")
|
|
112
|
+
instance.rename_action = WorkDataRenameAction.from_entity_optional(
|
|
113
|
+
client, instance._entity, "Rename")
|
|
114
|
+
instance.edit_comment_action = WorkDataEditCommentAction.from_entity_optional(
|
|
115
|
+
client, instance._entity, "EditComment")
|
|
116
|
+
instance.edit_tags_action = WorkDataEditTagsAction.from_entity_optional(
|
|
117
|
+
client, instance._entity, "EditTags")
|
|
118
|
+
instance.allow_deletion_action = WorkDataAllowDeletionAction.from_entity_optional(
|
|
119
|
+
client, instance._entity, "AllowDeletion")
|
|
120
|
+
instance.disallow_deletion_action = WorkDataDisallowAction.from_entity_optional(
|
|
121
|
+
client, instance._entity, "DisallowDeletion")
|
|
122
|
+
|
|
123
|
+
# links
|
|
124
|
+
instance.self_link = WorkDataLink.from_entity(
|
|
125
|
+
instance._client, instance._entity, Relations.SELF)
|
|
126
|
+
instance.download_link = DownloadLinkHco.from_entity(
|
|
127
|
+
instance._client, instance._entity, Relations.DOWNLOAD)
|
|
128
|
+
return instance
|
|
@@ -1,68 +1,91 @@
|
|
|
1
|
-
from typing import Self, List
|
|
1
|
+
from typing import Self, List, Iterator
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
4
|
|
|
5
|
-
from pinexq_client.job_management.known_relations import Relations
|
|
6
5
|
from pinexq_client.core.hco.hco_base import Hco, Property
|
|
7
6
|
from pinexq_client.core.hco.link_hco import LinkHco
|
|
7
|
+
from pinexq_client.core.hco.unavailable import UnavailableLink
|
|
8
8
|
from pinexq_client.job_management.hcos.workdata_hco import WorkDataHco
|
|
9
|
+
from pinexq_client.job_management.known_relations import Relations
|
|
9
10
|
from pinexq_client.job_management.model.sirenentities import WorkDataQueryResultEntity, WorkDataEntity
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class WorkDataQueryResultPaginationLink(LinkHco):
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
def navigate(self) -> 'WorkDataQueryResultHco':
|
|
15
|
+
return WorkDataQueryResultHco.from_entity(self._navigate_internal(WorkDataQueryResultEntity), self._client)
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class WorkDataQueryResultLink(LinkHco):
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
def navigate(self) -> 'WorkDataQueryResultHco':
|
|
20
|
+
return WorkDataQueryResultHco.from_entity(self._navigate_internal(WorkDataQueryResultEntity), self._client)
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
class WorkDataQueryResultHco(Hco[WorkDataQueryResultEntity]):
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
24
|
+
workdata_query_action: WorkDataQueryResultEntity
|
|
25
|
+
|
|
26
|
+
total_entities: int = Property()
|
|
27
|
+
current_entities_count: int = Property()
|
|
28
|
+
workdatas: list[WorkDataHco]
|
|
29
|
+
remaining_tags: List[str] | None = Property()
|
|
30
|
+
|
|
31
|
+
self_link: WorkDataQueryResultLink
|
|
32
|
+
all_link: WorkDataQueryResultPaginationLink | UnavailableLink
|
|
33
|
+
first_link: WorkDataQueryResultPaginationLink | UnavailableLink
|
|
34
|
+
last_link: WorkDataQueryResultPaginationLink | UnavailableLink
|
|
35
|
+
next_link: WorkDataQueryResultPaginationLink | UnavailableLink
|
|
36
|
+
previous_link: WorkDataQueryResultPaginationLink | UnavailableLink
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_entity(cls, entity: WorkDataQueryResultEntity, client: httpx.Client) -> Self:
|
|
40
|
+
instance = cls(client, entity)
|
|
41
|
+
|
|
42
|
+
Hco.check_classes(instance._entity.class_, ["WorkDataQueryResult"])
|
|
43
|
+
|
|
44
|
+
# pagination links
|
|
45
|
+
instance.self_link = WorkDataQueryResultLink.from_entity(
|
|
46
|
+
instance._client, instance._entity, Relations.SELF)
|
|
47
|
+
instance.all_link = WorkDataQueryResultPaginationLink.from_entity_optional(
|
|
48
|
+
instance._client, instance._entity, Relations.ALL)
|
|
49
|
+
instance.first_link = WorkDataQueryResultPaginationLink.from_entity_optional(
|
|
50
|
+
instance._client, instance._entity, Relations.FIRST)
|
|
51
|
+
instance.last_link = WorkDataQueryResultPaginationLink.from_entity_optional(
|
|
52
|
+
instance._client, instance._entity, Relations.LAST)
|
|
53
|
+
instance.next_link = WorkDataQueryResultPaginationLink.from_entity_optional(
|
|
54
|
+
instance._client, instance._entity, Relations.NEXT)
|
|
55
|
+
instance.previous_link = WorkDataQueryResultPaginationLink.from_entity_optional(
|
|
56
|
+
instance._client, instance._entity, Relations.PREVIOUS)
|
|
57
|
+
|
|
58
|
+
# entities
|
|
59
|
+
|
|
60
|
+
instance._extract_workdatas()
|
|
61
|
+
|
|
62
|
+
return instance
|
|
63
|
+
|
|
64
|
+
def _extract_workdatas(self):
|
|
65
|
+
self.workdatas = []
|
|
66
|
+
workdatas = self._entity.find_all_entities_with_relation(Relations.ITEM, WorkDataEntity)
|
|
67
|
+
for workdata in workdatas:
|
|
68
|
+
workdata_hco: WorkDataHco = WorkDataHco.from_entity(workdata, self._client)
|
|
69
|
+
self.workdatas.append(workdata_hco)
|
|
70
|
+
|
|
71
|
+
def iter(self) -> Iterator[Self]:
|
|
72
|
+
"""
|
|
73
|
+
Returns an Iterator of `WorkDataQueryResultHco` so that all pages can be processed in a loop.
|
|
74
|
+
Returns:
|
|
75
|
+
An iterator of `WorkDataQueryResultHco` objects
|
|
76
|
+
"""
|
|
77
|
+
result = self
|
|
78
|
+
while result is not None:
|
|
79
|
+
yield result
|
|
80
|
+
if isinstance(result.next_link, UnavailableLink):
|
|
81
|
+
return
|
|
82
|
+
result = result.next_link.navigate()
|
|
83
|
+
|
|
84
|
+
def iter_flat(self) -> Iterator[WorkDataHco]:
|
|
85
|
+
"""
|
|
86
|
+
Returns an Iterator of the `WorkDataHco` so that all WorkDatas can be processed in a loop.
|
|
87
|
+
Returns:
|
|
88
|
+
An iterator of `WorkDataHco` objects
|
|
89
|
+
"""
|
|
90
|
+
for page in self.iter():
|
|
91
|
+
yield from page.workdatas
|
|
@@ -6,79 +6,80 @@ from pinexq_client.core import MediaTypes, Link
|
|
|
6
6
|
from pinexq_client.core.hco.action_with_parameters_hco import ActionWithParametersHco
|
|
7
7
|
from pinexq_client.core.hco.hco_base import Hco
|
|
8
8
|
from pinexq_client.core.hco.link_hco import LinkHco
|
|
9
|
+
from pinexq_client.core.hco.unavailable import UnavailableAction, UnavailableLink
|
|
9
10
|
from pinexq_client.core.hco.upload_action_hco import UploadAction, UploadParameters
|
|
10
|
-
from pinexq_client.job_management.hcos.workdata_used_tags_query_result_hco import WorkDataUsedTagsLink
|
|
11
11
|
from pinexq_client.job_management.hcos.workdata_hco import WorkDataLink
|
|
12
12
|
from pinexq_client.job_management.hcos.workdata_query_result_hco import (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
WorkDataQueryResultHco,
|
|
14
|
+
WorkDataQueryResultLink,
|
|
15
|
+
WorkDataQueryResultPaginationLink
|
|
16
16
|
)
|
|
17
|
+
from pinexq_client.job_management.hcos.workdata_used_tags_query_result_hco import WorkDataUsedTagsLink
|
|
17
18
|
from pinexq_client.job_management.known_relations import Relations
|
|
18
19
|
from pinexq_client.job_management.model import WorkDataQueryParameters, WorkDataUsedTagsFilterParameter
|
|
19
20
|
from pinexq_client.job_management.model.sirenentities import WorkDataRootEntity
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
class WorkDataQueryAction(ActionWithParametersHco[WorkDataQueryParameters]):
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
def execute(self, parameters: WorkDataQueryParameters) -> WorkDataQueryResultHco:
|
|
25
|
+
url = self._execute_returns_url(parameters)
|
|
26
|
+
link = Link.from_url(url, [str(Relations.CREATED_RESSOURCE)], "Created query", MediaTypes.SIREN)
|
|
27
|
+
# resolve link immediately
|
|
28
|
+
return WorkDataQueryResultLink.from_link(self._client, link).navigate()
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
def default_parameters(self) -> WorkDataQueryParameters:
|
|
31
|
+
return self._get_default_parameters(WorkDataQueryParameters, WorkDataQueryParameters())
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
class WorkDataUsedTagsQueryAction(ActionWithParametersHco[WorkDataUsedTagsFilterParameter]):
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
def execute(self, parameters: WorkDataUsedTagsFilterParameter) -> WorkDataUsedTagsLink:
|
|
36
|
+
url = self._execute_returns_url(parameters)
|
|
37
|
+
link = Link.from_url(url, [str(Relations.CREATED_RESSOURCE)], "Created query", MediaTypes.SIREN)
|
|
38
|
+
return WorkDataUsedTagsLink.from_link(self._client, link)
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
def default_parameters(self) -> WorkDataUsedTagsFilterParameter:
|
|
41
|
+
return self._get_default_parameters(WorkDataUsedTagsFilterParameter, WorkDataUsedTagsFilterParameter())
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
class WorkDataUploadAction(UploadAction):
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
def execute(self, parameters: UploadParameters) -> WorkDataLink:
|
|
46
|
+
url = self._upload(parameters)
|
|
47
|
+
link = Link.from_url(url, [str(Relations.CREATED_RESSOURCE)], "Uploaded workdata", MediaTypes.SIREN)
|
|
48
|
+
return WorkDataLink.from_link(self._client, link)
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
class WorkDataRootLink(LinkHco):
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
def navigate(self) -> 'WorkDataRootHco':
|
|
53
|
+
return WorkDataRootHco.from_entity(self._navigate_internal(WorkDataRootEntity), self._client)
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
class WorkDataRootHco(Hco[WorkDataRootEntity]):
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
57
|
+
query_action: WorkDataQueryAction | UnavailableAction
|
|
58
|
+
query_tags_action: WorkDataUsedTagsQueryAction | UnavailableAction
|
|
59
|
+
upload_action: WorkDataUploadAction | None
|
|
60
|
+
|
|
61
|
+
self_link: WorkDataRootLink
|
|
62
|
+
all_link: WorkDataQueryResultPaginationLink | UnavailableLink
|
|
63
|
+
used_tags_link: WorkDataUsedTagsLink | UnavailableLink
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_entity(cls, entity: WorkDataRootEntity, client: httpx.Client) -> Self:
|
|
67
|
+
instance = cls(client, entity)
|
|
68
|
+
Hco.check_classes(instance._entity.class_, ["WorkDataRoot"])
|
|
69
|
+
|
|
70
|
+
instance.query_action = WorkDataQueryAction.from_entity_optional(
|
|
71
|
+
client, instance._entity, "CreateWorkDataQuery")
|
|
72
|
+
instance.query_tags_action = WorkDataUsedTagsQueryAction.from_entity_optional(
|
|
73
|
+
client, instance._entity, "CreateWorkDataTagsQuery")
|
|
74
|
+
instance.upload_action = WorkDataUploadAction.from_entity_optional(
|
|
75
|
+
client, instance._entity, "Upload")
|
|
76
|
+
|
|
77
|
+
instance.self_link = WorkDataRootLink.from_entity(
|
|
78
|
+
instance._client, instance._entity, Relations.SELF)
|
|
79
|
+
|
|
80
|
+
instance.all_link = WorkDataQueryResultPaginationLink.from_entity_optional(
|
|
81
|
+
instance._client, instance._entity, Relations.ALL)
|
|
82
|
+
|
|
83
|
+
instance.used_tags_link = WorkDataUsedTagsLink.from_entity_optional(
|
|
84
|
+
instance._client, instance._entity, Relations.USED_TAGS)
|
|
85
|
+
return instance
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: openapi.json
|
|
3
|
-
# timestamp: 2024-
|
|
3
|
+
# timestamp: 2024-09-24T10:14:32+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -58,6 +58,7 @@ class CreateProcessingStepParameters(BaseModel):
|
|
|
58
58
|
)
|
|
59
59
|
title: constr(min_length=1) = Field(..., alias='Title')
|
|
60
60
|
function_name: constr(min_length=1) = Field(..., alias='FunctionName')
|
|
61
|
+
version: constr(min_length=1) = Field(..., alias='Version')
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
class CreateSubJobParameters(BaseModel):
|
|
@@ -785,6 +786,7 @@ class WorkDataHtoOpenApiProperties(BaseModel):
|
|
|
785
786
|
media_type: str | None = Field(None, alias='MediaType')
|
|
786
787
|
kind: WorkDataKind | None = Field(None, alias='Kind')
|
|
787
788
|
is_deletable: bool | None = Field(None, alias='IsDeletable')
|
|
789
|
+
is_used_as_job_input: bool | None = Field(None, alias='IsUsedAsJobInput')
|
|
788
790
|
hidden: bool | None = Field(None, alias='Hidden')
|
|
789
791
|
comments: str | None = Field(None, alias='Comments')
|
|
790
792
|
|