pinexq-client 0.10.6rc1__py3-none-any.whl → 1.1.0__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 → pinexq/client}/core/api_event_manager.py +3 -4
- {pinexq_client → pinexq/client}/core/enterapi.py +6 -4
- {pinexq_client → pinexq/client}/core/exceptions.py +2 -2
- {pinexq_client → pinexq/client}/core/hco/action_hco.py +3 -3
- {pinexq_client → pinexq/client}/core/hco/action_with_parameters_hco.py +4 -4
- {pinexq_client → pinexq/client}/core/hco/download_link_hco.py +2 -2
- {pinexq_client → pinexq/client}/core/hco/hco_base.py +1 -1
- {pinexq_client → pinexq/client}/core/hco/link_hco.py +6 -8
- pinexq/client/core/hco/unavailable.py +36 -0
- {pinexq_client → pinexq/client}/core/hco/upload_action_hco.py +4 -5
- {pinexq_client → pinexq/client}/job_management/__init__.py +1 -1
- {pinexq_client → pinexq/client}/job_management/enterjma.py +11 -9
- {pinexq_client → pinexq/client}/job_management/hcos/entrypoint_hco.py +9 -9
- {pinexq_client → pinexq/client}/job_management/hcos/info_hco.py +5 -5
- pinexq/client/job_management/hcos/input_dataslot_hco.py +88 -0
- {pinexq_client → pinexq/client}/job_management/hcos/job_hco.py +23 -16
- pinexq/client/job_management/hcos/job_query_result_hco.py +89 -0
- {pinexq_client → pinexq/client}/job_management/hcos/job_used_tags_hco.py +5 -5
- {pinexq_client → pinexq/client}/job_management/hcos/jobsroot_hco.py +13 -16
- {pinexq_client → pinexq/client}/job_management/hcos/output_dataslot_hco.py +6 -9
- {pinexq_client → pinexq/client}/job_management/hcos/processing_step_hco.py +23 -14
- {pinexq_client → pinexq/client}/job_management/hcos/processing_step_used_tags_hco.py +5 -5
- pinexq/client/job_management/hcos/processingstep_query_result_hco.py +91 -0
- {pinexq_client → pinexq/client}/job_management/hcos/processingsteproot_hco.py +14 -15
- {pinexq_client → pinexq/client}/job_management/hcos/user_hco.py +4 -4
- {pinexq_client → pinexq/client}/job_management/hcos/workdata_hco.py +17 -16
- pinexq/client/job_management/hcos/workdata_query_result_hco.py +91 -0
- {pinexq_client → pinexq/client}/job_management/hcos/workdata_used_tags_query_result_hco.py +5 -5
- {pinexq_client → pinexq/client}/job_management/hcos/workdataroot_hco.py +16 -14
- {pinexq_client → pinexq/client}/job_management/model/open_api_generated.py +120 -96
- {pinexq_client → pinexq/client}/job_management/model/sirenentities.py +14 -12
- {pinexq_client → pinexq/client}/job_management/tool/job.py +20 -25
- {pinexq_client → pinexq/client}/job_management/tool/job_group.py +6 -7
- {pinexq_client → pinexq/client}/job_management/tool/processing_step.py +26 -15
- {pinexq_client → pinexq/client}/job_management/tool/workdata.py +7 -8
- {pinexq_client-0.10.6rc1.dist-info → pinexq_client-1.1.0.dist-info}/METADATA +10 -10
- pinexq_client-1.1.0.dist-info/RECORD +52 -0
- {pinexq_client-0.10.6rc1.dist-info → pinexq_client-1.1.0.dist-info}/WHEEL +2 -2
- pinexq_client/core/hco/unavailable.py +0 -36
- pinexq_client/job_management/hcos/input_dataslot_hco.py +0 -86
- pinexq_client/job_management/hcos/job_query_result_hco.py +0 -89
- pinexq_client/job_management/hcos/processingstep_query_result_hco.py +0 -94
- pinexq_client/job_management/hcos/workdata_query_result_hco.py +0 -91
- pinexq_client-0.10.6rc1.dist-info/RECORD +0 -52
- {pinexq_client → pinexq/client}/core/__init__.py +0 -0
- {pinexq_client → pinexq/client}/core/base_relations.py +0 -0
- {pinexq_client → pinexq/client}/core/hco/__init__.py +0 -0
- {pinexq_client → pinexq/client}/core/http_headers.py +0 -0
- {pinexq_client → pinexq/client}/core/media_types.py +0 -0
- {pinexq_client → pinexq/client}/core/model/__init__.py +0 -0
- {pinexq_client → pinexq/client}/core/model/error.py +0 -0
- {pinexq_client → pinexq/client}/core/model/sirenmodels.py +0 -0
- {pinexq_client → pinexq/client}/core/polling.py +0 -0
- {pinexq_client → pinexq/client}/core/sirenaccess.py +0 -0
- {pinexq_client → pinexq/client}/job_management/hcos/__init__.py +0 -0
- {pinexq_client → pinexq/client}/job_management/known_relations.py +0 -0
- {pinexq_client → pinexq/client}/job_management/model/__init__.py +0 -0
- {pinexq_client → pinexq/client}/job_management/tool/__init__.py +0 -0
|
@@ -4,20 +4,28 @@ from typing import List, Self
|
|
|
4
4
|
import httpx
|
|
5
5
|
from pydantic import BaseModel, ConfigDict
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
from ...core import Link, MediaTypes, upload_json
|
|
8
|
+
from ...core.hco.action_hco import ActionHco
|
|
9
|
+
from ...core.hco.action_with_parameters_hco import ActionWithParametersHco
|
|
10
|
+
from ...core.hco.download_link_hco import DownloadLinkHco
|
|
11
|
+
from ...core.hco.hco_base import Hco, Property
|
|
12
|
+
from ...core.hco.link_hco import LinkHco
|
|
13
|
+
from ...core.hco.unavailable import UnavailableAction
|
|
14
|
+
from ...core.hco.upload_action_hco import UploadAction, UploadParameters
|
|
15
|
+
from ..known_relations import Relations
|
|
16
|
+
from ..model import (
|
|
17
|
+
AssignCodeHashParameters,
|
|
18
|
+
CopyPsFromUserToOrgActionParameters,
|
|
19
|
+
DeprecatePsActionParameters,
|
|
20
|
+
)
|
|
21
|
+
from ..model.open_api_generated import (
|
|
22
|
+
ConfigureDeploymentParameters,
|
|
23
|
+
DataSpecificationHto,
|
|
24
|
+
DeploymentStates,
|
|
25
|
+
ProcessingStepDeploymentHto,
|
|
26
|
+
SetProcessingStepTagsParameters, SetProcessingStepTitleParameters, TagDetailsHto,
|
|
27
|
+
)
|
|
28
|
+
from ..model.sirenentities import ProcessingStepEntity
|
|
21
29
|
|
|
22
30
|
|
|
23
31
|
class ProcessingStepLink(LinkHco):
|
|
@@ -173,6 +181,7 @@ class ProcessingStepHco(Hco[ProcessingStepEntity]):
|
|
|
173
181
|
owner_id: str | None= Property()
|
|
174
182
|
|
|
175
183
|
tags: list[str] | None = Property()
|
|
184
|
+
tag_details: List[TagDetailsHto] | None = Property()
|
|
176
185
|
has_parameters: bool | None = Property()
|
|
177
186
|
is_public: bool | None = Property()
|
|
178
187
|
created_at: datetime | None = Property()
|
|
@@ -2,11 +2,11 @@ from typing import List, Self
|
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
5
|
+
from ...core.hco.hco_base import Hco, Property
|
|
6
|
+
from ...core.hco.link_hco import LinkHco
|
|
7
|
+
from ..known_relations import Relations
|
|
8
|
+
from ..model import ProcessingStepUsedTagsEntityAdmin
|
|
9
|
+
from ..model.sirenentities import ProcessingStepUsedTagsEntity
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class ProcessingStepUsedTagsHco(Hco[ProcessingStepUsedTagsEntity]):
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from typing import Iterator, List, Self
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
from ...core.hco.hco_base import Hco, Property
|
|
6
|
+
from ...core.hco.link_hco import LinkHco
|
|
7
|
+
from ...core.hco.unavailable import UnavailableLink
|
|
8
|
+
from ..hcos.processing_step_hco import ProcessingStepHco
|
|
9
|
+
from ..known_relations import Relations
|
|
10
|
+
from ..model.sirenentities import ProcessingStepEntity, ProcessingStepQueryResultEntity
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ProcessingStepQueryResultPaginationLink(LinkHco):
|
|
14
|
+
def navigate(self) -> 'ProcessingStepQueryResultHco':
|
|
15
|
+
return ProcessingStepQueryResultHco.from_entity(self._navigate_internal(ProcessingStepQueryResultEntity),
|
|
16
|
+
self._client)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ProcessingStepQueryResultLink(LinkHco):
|
|
20
|
+
def navigate(self) -> 'ProcessingStepQueryResultHco':
|
|
21
|
+
return ProcessingStepQueryResultHco.from_entity(self._navigate_internal(ProcessingStepQueryResultEntity),
|
|
22
|
+
self._client)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ProcessingStepQueryResultHco(Hco[ProcessingStepQueryResultEntity]):
|
|
26
|
+
total_entities: int = Property()
|
|
27
|
+
current_entities_count: int = Property()
|
|
28
|
+
processing_steps: list[ProcessingStepHco]
|
|
29
|
+
remaining_tags: List[str] | None = Property()
|
|
30
|
+
|
|
31
|
+
self_link: ProcessingStepQueryResultLink
|
|
32
|
+
all_link: ProcessingStepQueryResultPaginationLink | UnavailableLink
|
|
33
|
+
first_link: ProcessingStepQueryResultPaginationLink | UnavailableLink
|
|
34
|
+
last_link: ProcessingStepQueryResultPaginationLink | UnavailableLink
|
|
35
|
+
next_link: ProcessingStepQueryResultPaginationLink | UnavailableLink
|
|
36
|
+
previous_link: ProcessingStepQueryResultPaginationLink | UnavailableLink
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_entity(cls, entity: ProcessingStepQueryResultEntity, client: httpx.Client) -> Self:
|
|
40
|
+
instance = cls(client, entity)
|
|
41
|
+
|
|
42
|
+
Hco.check_classes(instance._entity.class_, ["ProcessingStepQueryResult"])
|
|
43
|
+
|
|
44
|
+
# pagination links
|
|
45
|
+
instance.self_link = ProcessingStepQueryResultLink.from_entity(
|
|
46
|
+
instance._client, instance._entity, Relations.SELF)
|
|
47
|
+
instance.all_link = ProcessingStepQueryResultPaginationLink.from_entity_optional(
|
|
48
|
+
instance._client, instance._entity, Relations.ALL)
|
|
49
|
+
instance.first_link = ProcessingStepQueryResultPaginationLink.from_entity_optional(
|
|
50
|
+
instance._client, instance._entity, Relations.FIRST)
|
|
51
|
+
instance.last_link = ProcessingStepQueryResultPaginationLink.from_entity_optional(
|
|
52
|
+
instance._client, instance._entity, Relations.LAST)
|
|
53
|
+
instance.next_link = ProcessingStepQueryResultPaginationLink.from_entity_optional(
|
|
54
|
+
instance._client, instance._entity, Relations.NEXT)
|
|
55
|
+
instance.previous_link = ProcessingStepQueryResultPaginationLink.from_entity_optional(
|
|
56
|
+
instance._client, instance._entity, Relations.PREVIOUS)
|
|
57
|
+
|
|
58
|
+
instance._extract_processing_steps()
|
|
59
|
+
|
|
60
|
+
return instance
|
|
61
|
+
|
|
62
|
+
def _extract_processing_steps(self):
|
|
63
|
+
self.processing_steps = []
|
|
64
|
+
processing_steps = self._entity.find_all_entities_with_relation(Relations.ITEM, ProcessingStepEntity)
|
|
65
|
+
for processing_step in processing_steps:
|
|
66
|
+
processing_step_hco: ProcessingStepHco = ProcessingStepHco.from_entity(processing_step, self._client)
|
|
67
|
+
self.processing_steps.append(processing_step_hco)
|
|
68
|
+
|
|
69
|
+
def iter(self) -> Iterator[Self]:
|
|
70
|
+
"""
|
|
71
|
+
Returns an Iterator of `ProcessingStepQueryResultHco` objects so that all pages can be processed in a loop.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
An iterator of `ProcessingStepQueryResultHco` objects
|
|
75
|
+
"""
|
|
76
|
+
result = self
|
|
77
|
+
while result is not None:
|
|
78
|
+
yield result
|
|
79
|
+
if isinstance(result.next_link, UnavailableLink):
|
|
80
|
+
return
|
|
81
|
+
result = result.next_link.navigate()
|
|
82
|
+
|
|
83
|
+
def iter_flat(self) -> Iterator[ProcessingStepHco]:
|
|
84
|
+
"""
|
|
85
|
+
Returns an Iterator of `ProcessingStepHco` objects so that all processing steps can be processed in a loop.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
An iterator of `ProcessingStepHco` objects
|
|
89
|
+
"""
|
|
90
|
+
for page in self.iter():
|
|
91
|
+
yield from page.processing_steps
|
|
@@ -3,23 +3,22 @@ from typing import Self
|
|
|
3
3
|
import httpx
|
|
4
4
|
from httpx import URL
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
ProcessingStepUsedTagsAdminLink
|
|
15
|
-
from pinexq_client.job_management.hcos.processingstep_query_result_hco import (
|
|
6
|
+
from ...core import Link, MediaTypes, upload_json, raise_exception_on_error, ClientException
|
|
7
|
+
from ...core.hco.action_with_parameters_hco import ActionWithParametersHco
|
|
8
|
+
from ...core.hco.hco_base import Hco
|
|
9
|
+
from ...core.hco.link_hco import LinkHco
|
|
10
|
+
from ...core.hco.unavailable import UnavailableAction, UnavailableLink
|
|
11
|
+
from ..hcos.processing_step_hco import ProcessingStepHco, ProcessingStepLink
|
|
12
|
+
from ..hcos.processing_step_used_tags_hco import ProcessingStepUsedTagsAdminLink, ProcessingStepUsedTagsLink
|
|
13
|
+
from ..hcos.processingstep_query_result_hco import (
|
|
16
14
|
ProcessingStepQueryResultHco,
|
|
17
15
|
ProcessingStepQueryResultLink,
|
|
18
|
-
ProcessingStepQueryResultPaginationLink
|
|
16
|
+
ProcessingStepQueryResultPaginationLink,
|
|
19
17
|
)
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
18
|
+
from ..known_relations import Relations
|
|
19
|
+
from ..model import ProcessingStepQueryParameters
|
|
20
|
+
from ..model.sirenentities import ProcessingStepsRootEntity
|
|
21
|
+
from ...core.hco.upload_action_hco import UploadAction, UploadParameters
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
class ProcessingStepQueryAction(ActionWithParametersHco[ProcessingStepQueryParameters]):
|
|
@@ -35,7 +34,7 @@ class ProcessingStepQueryAction(ActionWithParametersHco[ProcessingStepQueryParam
|
|
|
35
34
|
|
|
36
35
|
class ProcessingStepRegisterNewAction(UploadAction):
|
|
37
36
|
def execute(self, parameters: UploadParameters) -> ProcessingStepLink:
|
|
38
|
-
url = upload_json(self._client, self._action, parameters.json_, parameters.filename)
|
|
37
|
+
url = upload_json(self._client, self._action, parameters.json_, parameters.filename)
|
|
39
38
|
raise_exception_on_error(f"Error while uploading", url)
|
|
40
39
|
|
|
41
40
|
if not isinstance(url, URL):
|
|
@@ -3,10 +3,10 @@ from uuid import UUID
|
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
6
|
+
from ...core.hco.hco_base import Hco, Property
|
|
7
|
+
from ...core.hco.link_hco import LinkHco
|
|
8
|
+
from ..known_relations import Relations
|
|
9
|
+
from ..model.sirenentities import UserEntity
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class UserLink(LinkHco):
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
from typing import Self
|
|
2
|
+
from typing import Self, List
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
SetNameWorkDataParameters,
|
|
6
|
+
from ...core import Link, MediaTypes
|
|
7
|
+
from ...core.hco.action_hco import ActionHco
|
|
8
|
+
from ...core.hco.action_with_parameters_hco import ActionWithParametersHco
|
|
9
|
+
from ...core.hco.download_link_hco import DownloadLinkHco
|
|
10
|
+
from ...core.hco.hco_base import Hco, Property
|
|
11
|
+
from ...core.hco.link_hco import LinkHco
|
|
12
|
+
from ...core.hco.unavailable import UnavailableAction, UnavailableLink
|
|
13
|
+
from ..hcos.job_hco import JobLink
|
|
14
|
+
from ..hcos.processing_step_hco import ProcessingStepLink
|
|
15
|
+
from ..known_relations import Relations
|
|
16
|
+
from ..model import CopyWorkDataFromUserToOrgActionParameters
|
|
17
|
+
from ..model.open_api_generated import (
|
|
19
18
|
SetCommentWorkDataParameters,
|
|
19
|
+
SetNameWorkDataParameters,
|
|
20
20
|
SetTagsWorkDataParameters,
|
|
21
|
-
WorkDataKind
|
|
21
|
+
WorkDataKind, TagDetailsHto,
|
|
22
22
|
)
|
|
23
|
-
from
|
|
23
|
+
from ..model.sirenentities import WorkDataEntity
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class WorkDataLink(LinkHco):
|
|
@@ -100,6 +100,7 @@ class WorkDataHco(Hco[WorkDataEntity]):
|
|
|
100
100
|
created_at: datetime | None = Property()
|
|
101
101
|
size_in_bytes: int | None = Property()
|
|
102
102
|
tags: list[str] | None = Property()
|
|
103
|
+
tag_details: List[TagDetailsHto] | None = Property()
|
|
103
104
|
media_type: str | None = Property()
|
|
104
105
|
kind: WorkDataKind | None = Property()
|
|
105
106
|
comments: str | None = Property()
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from typing import Iterator, List, Self
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
from ...core.hco.hco_base import Hco, Property
|
|
6
|
+
from ...core.hco.link_hco import LinkHco
|
|
7
|
+
from ...core.hco.unavailable import UnavailableLink
|
|
8
|
+
from ..hcos.workdata_hco import WorkDataHco
|
|
9
|
+
from ..known_relations import Relations
|
|
10
|
+
from ..model.sirenentities import WorkDataEntity, WorkDataQueryResultEntity
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class WorkDataQueryResultPaginationLink(LinkHco):
|
|
14
|
+
def navigate(self) -> 'WorkDataQueryResultHco':
|
|
15
|
+
return WorkDataQueryResultHco.from_entity(self._navigate_internal(WorkDataQueryResultEntity), self._client)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class WorkDataQueryResultLink(LinkHco):
|
|
19
|
+
def navigate(self) -> 'WorkDataQueryResultHco':
|
|
20
|
+
return WorkDataQueryResultHco.from_entity(self._navigate_internal(WorkDataQueryResultEntity), self._client)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class WorkDataQueryResultHco(Hco[WorkDataQueryResultEntity]):
|
|
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
|
|
@@ -2,11 +2,11 @@ from typing import List, Self
|
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
5
|
+
from ...core.hco.hco_base import Hco, Property
|
|
6
|
+
from ...core.hco.link_hco import LinkHco
|
|
7
|
+
from ..known_relations import Relations
|
|
8
|
+
from ..model import WorkDataUsedTagsQueryResultEntityAdmin
|
|
9
|
+
from ..model.sirenentities import WorkDataUsedTagsQueryResultEntity
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class WorkDataUsedTagsQueryResultHto(Hco[WorkDataUsedTagsQueryResultEntity]):
|
|
@@ -2,23 +2,25 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
5
|
+
from ...core import Link, MediaTypes
|
|
6
|
+
from ...core.hco.action_with_parameters_hco import ActionWithParametersHco
|
|
7
|
+
from ...core.hco.hco_base import Hco
|
|
8
|
+
from ...core.hco.link_hco import LinkHco
|
|
9
|
+
from ...core.hco.unavailable import UnavailableAction, UnavailableLink
|
|
10
|
+
from ...core.hco.upload_action_hco import UploadAction, UploadParameters
|
|
11
|
+
from ..hcos.workdata_hco import WorkDataLink
|
|
12
|
+
from ..hcos.workdata_query_result_hco import (
|
|
13
13
|
WorkDataQueryResultHco,
|
|
14
14
|
WorkDataQueryResultLink,
|
|
15
|
-
WorkDataQueryResultPaginationLink
|
|
15
|
+
WorkDataQueryResultPaginationLink,
|
|
16
16
|
)
|
|
17
|
-
from
|
|
18
|
-
WorkDataUsedTagsAdminLink
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
from
|
|
17
|
+
from ..hcos.workdata_used_tags_query_result_hco import (
|
|
18
|
+
WorkDataUsedTagsAdminLink,
|
|
19
|
+
WorkDataUsedTagsLink,
|
|
20
|
+
)
|
|
21
|
+
from ..known_relations import Relations
|
|
22
|
+
from ..model import WorkDataQueryParameters, WorkDataUsedTagsFilterParameter
|
|
23
|
+
from ..model.sirenentities import WorkDataRootEntity
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
class WorkDataQueryAction(ActionWithParametersHco[WorkDataQueryParameters]):
|