pinexq-client 0.10.3rc1__py3-none-any.whl → 0.10.5rc1__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.
@@ -60,5 +60,11 @@ class ActionHco(ClientContainer, HypermediaAvailability):
60
60
  raise_exception_on_error(f"Error while executing action, unexpected response", response)
61
61
  return response
62
62
 
63
+ def _execute_returns_url(self) -> URL:
64
+ result = self._execute_internal()
65
+ if result is None:
66
+ raise ClientException("Action did not respond with URL")
67
+ return result
68
+
63
69
  def __repr__(self):
64
70
  return f"<{self.__class__.__name__}: '{self._action.name}'>"
@@ -22,4 +22,4 @@ from .model import JobSortPropertiesSortParameter, ProcessingView
22
22
  from .tool import Job, JobGroup, ProcessingStep, WorkData
23
23
 
24
24
  # Protocol version the JMA is using
25
- __jma_version__ = [8, 8, 0]
25
+ __jma_version__ = [9, 0, 0]
@@ -19,6 +19,9 @@ class ApiEventsEndpointLink(LinkHco):
19
19
  class DeploymentRegistryEndpointLink(LinkHco):
20
20
  pass
21
21
 
22
+ class RemoteEndpointLink(LinkHco):
23
+ pass
24
+
22
25
  class InfoHco(Hco[InfoEntity]):
23
26
  api_version: str = Property()
24
27
  build_version: str = Property()
@@ -29,6 +32,7 @@ class InfoHco(Hco[InfoEntity]):
29
32
  self_link: InfoLink
30
33
  api_events_endpoint: ApiEventsEndpointLink
31
34
  deployment_registry_endpoint: DeploymentRegistryEndpointLink
35
+ remote_endpoint: RemoteEndpointLink
32
36
 
33
37
  @classmethod
34
38
  def from_entity(cls, entity: InfoEntity, client: httpx.Client) -> Self:
@@ -42,6 +46,7 @@ class InfoHco(Hco[InfoEntity]):
42
46
 
43
47
  instance.api_events_endpoint = ApiEventsEndpointLink.from_entity(instance._client, instance._entity, Relations.API_EVENTS_ENDPOINT)
44
48
  instance.deployment_registry_endpoint = DeploymentRegistryEndpointLink.from_entity_optional(instance._client, instance._entity, Relations.DEPLOYMENT_REGISTRY_ENDPOINT)
49
+ instance.remote_endpoint = RemoteEndpointLink.from_entity_optional(instance._client, instance._entity, Relations.REMOTE_ENDPOINT)
45
50
 
46
51
  instance._extract_current_user()
47
52
 
@@ -45,11 +45,13 @@ class InputDataSlotClearDataAction(ActionHco):
45
45
 
46
46
 
47
47
  class InputDataSlotHco(Hco[InputDataSlotEntity]):
48
- is_configured: bool | None = Property()
48
+
49
49
  title: str | None = Property()
50
50
  description: str | None = Property()
51
+ name: str | None = Property()
51
52
  media_type: str | None = Property()
52
53
  selected_workdatas: list[WorkDataHco]
54
+ is_configured: bool | None = Property()
53
55
 
54
56
  select_workdata_action: InputDataSlotSelectWorkDataAction | UnavailableAction
55
57
  select_workdata_collection_action: InputDataSlotSelectWorkDataCollectionAction | UnavailableAction
@@ -20,6 +20,7 @@ class OutputDataSlotLink(LinkHco):
20
20
  class OutputDataSlotHco(Hco[OutputDataSlotEntity]):
21
21
  title: str | None = Property()
22
22
  description: str | None = Property()
23
+ name: str | None = Property()
23
24
  media_type: str | None = Property()
24
25
  assigned_workdatas: list[WorkDataHco]
25
26
 
@@ -11,14 +11,12 @@ from pinexq_client.core.hco.download_link_hco import DownloadLinkHco
11
11
  from pinexq_client.core.hco.hco_base import Hco, Property
12
12
  from pinexq_client.core.hco.link_hco import LinkHco
13
13
  from pinexq_client.core.hco.unavailable import UnavailableAction
14
- from pinexq_client.core.hco.upload_action_hco import UploadAction, UploadParameters
15
14
  from pinexq_client.job_management.known_relations import Relations
16
- from pinexq_client.job_management.model import CopyPsFromUserToOrgActionParameters, CopyPsFromOrgToUserActionParameters, \
17
- DeprecatePsActionParameters, AssignCodeHashParameters
15
+ from pinexq_client.job_management.model import CopyPsFromUserToOrgActionParameters, \
16
+ DeprecatePsActionParameters, AssignCodeHashParameters, SetProcessingStepTitleParameters
18
17
  from pinexq_client.job_management.model.open_api_generated import (DataSpecificationHto,
19
18
  SetProcessingStepTagsParameters,
20
- EditProcessingStepParameters,
21
- ConfigureDeploymentParameters, DeploymentStates)
19
+ ConfigureDeploymentParameters, DeploymentStates, ProcessingStepDeploymentHto)
22
20
  from pinexq_client.job_management.model.sirenentities import ProcessingStepEntity
23
21
 
24
22
 
@@ -46,15 +44,6 @@ class ProcessingStepUnHideAction(ActionHco):
46
44
  self._execute_internal()
47
45
 
48
46
 
49
- class ProcessingStepEditPropertiesAction(ActionWithParametersHco[EditProcessingStepParameters]):
50
- def execute(self, parameters: EditProcessingStepParameters):
51
- self._execute(parameters)
52
-
53
- def default_parameters(self) -> EditProcessingStepParameters:
54
- return self._get_default_parameters(EditProcessingStepParameters,
55
- EditProcessingStepParameters())
56
-
57
-
58
47
  class GenericProcessingConfigureParameters(BaseModel):
59
48
  """Generic parameter model, that can be set with any dictionary"""
60
49
  model_config = ConfigDict(extra='allow')
@@ -109,11 +98,6 @@ class ClearCodeHashAction(ActionHco):
109
98
  self._execute_internal()
110
99
 
111
100
 
112
- class UploadConfigurationAction(UploadAction):
113
- def execute(self, parameters: UploadParameters):
114
- upload_json(self._client, self._action, parameters.json_, parameters.filename)
115
-
116
-
117
101
  class ProcessingStepCopyFromUserToOrgAction(ActionWithParametersHco[CopyPsFromUserToOrgActionParameters]):
118
102
  def execute(self, parameters: CopyPsFromUserToOrgActionParameters) -> ProcessingStepLink:
119
103
  url = self._execute_returns_url(parameters)
@@ -125,16 +109,12 @@ class ProcessingStepCopyFromUserToOrgAction(ActionWithParametersHco[CopyPsFromUs
125
109
  CopyPsFromUserToOrgActionParameters())
126
110
 
127
111
 
128
- class ProcessingStepCopyFromOrgToUserAction(ActionWithParametersHco[CopyPsFromOrgToUserActionParameters]):
129
- def execute(self, parameters: CopyPsFromOrgToUserActionParameters) -> ProcessingStepLink:
130
- url = self._execute_returns_url(parameters)
112
+ class ProcessingStepCopyFromOrgToUserAction(ActionHco):
113
+ def execute(self) -> ProcessingStepLink:
114
+ url = self._execute_returns_url()
131
115
  link = Link.from_url(url, [str(Relations.CREATED_RESSOURCE)], "Copied Processing Step", MediaTypes.SIREN)
132
116
  return ProcessingStepLink.from_link(self._client, link)
133
117
 
134
- def default_parameters(self) -> CopyPsFromOrgToUserActionParameters:
135
- return self._get_default_parameters(CopyPsFromOrgToUserActionParameters,
136
- CopyPsFromOrgToUserActionParameters())
137
-
138
118
 
139
119
  class ProcessingStepDeprecateAction(ActionWithParametersHco[DeprecatePsActionParameters]):
140
120
  def execute(self, parameters: DeprecatePsActionParameters):
@@ -163,37 +143,64 @@ class AssignCodeHashAction(ActionWithParametersHco[AssignCodeHashParameters]):
163
143
  AssignCodeHashParameters())
164
144
 
165
145
 
146
+ class MakePublicAction(ActionHco):
147
+ def execute(self):
148
+ self._execute_internal()
149
+
150
+
151
+ class MakePrivateAction(ActionHco):
152
+ def execute(self):
153
+ self._execute_internal()
154
+
155
+
156
+ class SetTitleAction(ActionWithParametersHco[SetProcessingStepTitleParameters]):
157
+ def execute(self, parameters: SetProcessingStepTitleParameters):
158
+ self._execute(parameters)
159
+
160
+ def default_parameters(self) -> SetProcessingStepTitleParameters:
161
+ return self._get_default_parameters(SetProcessingStepTitleParameters,
162
+ SetProcessingStepTitleParameters())
163
+
164
+
166
165
  class ProcessingStepHco(Hco[ProcessingStepEntity]):
167
166
  title: str = Property()
168
167
  version: str | None = Property()
169
168
  function_name: str | None = Property()
170
169
  short_description: str | None = Property()
171
170
  long_description: str | None = Property()
171
+
172
+ created_by: str | None = Property()
173
+ owner_id: str | None= Property()
174
+
172
175
  tags: list[str] | None = Property()
173
176
  has_parameters: bool | None = Property()
174
177
  is_public: bool | None = Property()
175
- is_configured: bool | None = Property()
176
178
  created_at: datetime | None = Property()
177
179
  last_modified_at: datetime | None = Property()
178
180
  parameter_schema: str | None = Property()
179
181
  default_parameters: str | None = Property()
180
182
  return_schema: str | None = Property()
181
- error_schema: str | None = Property()
182
183
  hidden: bool | None = Property()
183
- deprecated_on: datetime | None = Property()
184
+
185
+ code_hash: str | None= Property()
186
+ pro_con_version: str | None = Property()
187
+
188
+ deprecated_at: datetime | None = Property()
184
189
  reason_for_deprecation: str | None = Property()
185
190
  is_deprecated: bool | None = Property()
191
+
186
192
  deployment_state: DeploymentStates = Property()
193
+ deployment: ProcessingStepDeploymentHto = Property()
187
194
 
188
195
  input_data_slot_specification: List[DataSpecificationHto] | None = Property()
189
196
  output_data_slot_specification: List[DataSpecificationHto] | None = Property()
190
197
  edit_tags_action: ProcessingStepEditTagsAction | UnavailableAction
191
- edit_properties_action: ProcessingStepEditPropertiesAction | UnavailableAction
192
198
  configure_default_parameters_action: ConfigureDefaultParametersAction | UnavailableAction
193
199
  clear_default_parameters_action: ClearDefaultParametersAction | UnavailableAction
194
- upload_configuration_action: UploadConfigurationAction | None
195
200
  hide_action: ProcessingStepHideAction | UnavailableAction
196
201
  unhide_action: ProcessingStepUnHideAction | UnavailableAction
202
+ make_public_action: MakePublicAction | UnavailableAction
203
+ make_private_action: MakePrivateAction | UnavailableAction
197
204
  copy_from_user_to_org_action: ProcessingStepCopyFromUserToOrgAction | UnavailableAction
198
205
  copy_from_org_to_user_action: ProcessingStepCopyFromOrgToUserAction | UnavailableAction
199
206
  delete_action: DeleteAction | UnavailableAction
@@ -206,6 +213,7 @@ class ProcessingStepHco(Hco[ProcessingStepEntity]):
206
213
  suspend_deployment_action: SuspendDeploymentAction | UnavailableAction
207
214
  resume_deployment_action: ResumeDeploymentAction | UnavailableAction
208
215
  clear_code_hash_action: ClearCodeHashAction | UnavailableAction
216
+ set_title_action: SetTitleAction | UnavailableAction
209
217
 
210
218
  self_link: ProcessingStepLink
211
219
  download_link: DownloadLinkHco
@@ -222,18 +230,18 @@ class ProcessingStepHco(Hco[ProcessingStepEntity]):
222
230
 
223
231
  instance.edit_tags_action = ProcessingStepEditTagsAction.from_entity_optional(
224
232
  client, instance._entity, "EditTags")
225
- instance.edit_properties_action = ProcessingStepEditPropertiesAction.from_entity_optional(
226
- client, instance._entity, "EditProperties")
227
233
  instance.configure_default_parameters_action = ConfigureDefaultParametersAction.from_entity_optional(
228
234
  client, instance._entity, "ConfigureDefaultParameters")
229
235
  instance.clear_default_parameters_action = ClearDefaultParametersAction.from_entity_optional(
230
236
  client, instance._entity, "ClearDefaultParameters")
231
- instance.upload_configuration_action = UploadConfigurationAction.from_entity_optional(
232
- client, instance._entity, "Upload")
233
237
  instance.hide_action = ProcessingStepHideAction.from_entity_optional(
234
238
  client, instance._entity, "Hide")
235
239
  instance.unhide_action = ProcessingStepUnHideAction.from_entity_optional(
236
240
  client, instance._entity, "UnHide")
241
+ instance.make_public_action = MakePublicAction.from_entity_optional(
242
+ client, instance._entity, "MakePublic")
243
+ instance.make_private_action = MakePrivateAction.from_entity_optional(
244
+ client, instance._entity, "MakePrivate")
237
245
  instance.copy_from_user_to_org_action = ProcessingStepCopyFromUserToOrgAction.from_entity_optional(
238
246
  client, instance._entity, "CopyToOrg")
239
247
  instance.copy_from_org_to_user_action = ProcessingStepCopyFromOrgToUserAction.from_entity_optional(
@@ -258,5 +266,7 @@ class ProcessingStepHco(Hco[ProcessingStepEntity]):
258
266
  client, instance._entity, "ResumeDeployment")
259
267
  instance.clear_code_hash_action = ClearCodeHashAction.from_entity_optional(
260
268
  client, instance._entity, "ClearCodeHash")
269
+ instance.set_title_action = SetTitleAction.from_entity_optional(
270
+ client, instance._entity, "EditTitle")
261
271
 
262
272
  return instance
@@ -1,12 +1,14 @@
1
1
  from typing import Self
2
2
 
3
3
  import httpx
4
+ from httpx import URL
4
5
 
5
- from pinexq_client.core import MediaTypes, Link
6
+ from pinexq_client.core import MediaTypes, Link, upload_json, ClientException, raise_exception_on_error
6
7
  from pinexq_client.core.hco.action_with_parameters_hco import ActionWithParametersHco
7
8
  from pinexq_client.core.hco.hco_base import Hco
8
9
  from pinexq_client.core.hco.link_hco import LinkHco
9
10
  from pinexq_client.core.hco.unavailable import UnavailableAction, UnavailableLink
11
+ from pinexq_client.core.hco.upload_action_hco import UploadParameters, UploadAction
10
12
  from pinexq_client.job_management.hcos.processing_step_hco import ProcessingStepLink, ProcessingStepHco
11
13
  from pinexq_client.job_management.hcos.processing_step_used_tags_hco import ProcessingStepUsedTagsLink, \
12
14
  ProcessingStepUsedTagsAdminLink
@@ -16,7 +18,7 @@ from pinexq_client.job_management.hcos.processingstep_query_result_hco import (
16
18
  ProcessingStepQueryResultPaginationLink
17
19
  )
18
20
  from pinexq_client.job_management.known_relations import Relations
19
- from pinexq_client.job_management.model import ProcessingStepQueryParameters, CreateProcessingStepParameters
21
+ from pinexq_client.job_management.model import ProcessingStepQueryParameters
20
22
  from pinexq_client.job_management.model.sirenentities import ProcessingStepsRootEntity
21
23
 
22
24
 
@@ -31,15 +33,17 @@ class ProcessingStepQueryAction(ActionWithParametersHco[ProcessingStepQueryParam
31
33
  return self._get_default_parameters(ProcessingStepQueryParameters, ProcessingStepQueryParameters())
32
34
 
33
35
 
34
- class ProcessingStepRegisterNewAction(ActionWithParametersHco[CreateProcessingStepParameters]):
35
- def execute(self, parameters: CreateProcessingStepParameters) -> ProcessingStepHco:
36
- url = self._execute_returns_url(parameters)
36
+ class ProcessingStepRegisterNewAction(UploadAction):
37
+ def execute(self, parameters: UploadParameters) -> ProcessingStepLink:
38
+ url = upload_json(self._client, self._action, parameters.json_, parameters.filename) # todo handle errors
39
+ raise_exception_on_error(f"Error while uploading", url)
40
+
41
+ if not isinstance(url, URL):
42
+ raise ClientException("Upload did not respond with location")
43
+
37
44
  link = Link.from_url(url, [str(Relations.CREATED_RESSOURCE)], "Created processing-step", MediaTypes.SIREN)
38
45
  # resolve link immediately
39
- return ProcessingStepLink.from_link(self._client, link).navigate()
40
-
41
- def default_parameters(self) -> CreateProcessingStepParameters:
42
- return self._get_default_parameters(CreateProcessingStepParameters, CreateProcessingStepParameters())
46
+ return ProcessingStepLink.from_link(self._client, link)
43
47
 
44
48
 
45
49
  class ProcessingStepsRootLink(LinkHco):
@@ -38,3 +38,4 @@ class Relations(StrEnum):
38
38
 
39
39
  # Deployment
40
40
  DEPLOYMENT_REGISTRY_ENDPOINT = "Registry"
41
+ REMOTE_ENDPOINT = "Remote"