openrelik-api-client 0.4.0__py3-none-any.whl → 0.5.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.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Google LLC
1
+ # Copyright 2024-2025 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ class WorkflowsAPI:
25
25
  self.folders_url = f"{self.api_client.base_url}/folders"
26
26
 
27
27
  def create_workflow(
28
- self, folder_id: int, file_ids: list, template_id: int = None
28
+ self, folder_id: int, file_ids: list, template_id: int = None, template_params: dict = {}
29
29
  ) -> int | None:
30
30
  """Creates a new workflow.
31
31
 
@@ -46,6 +46,7 @@ class WorkflowsAPI:
46
46
  "folder_id": folder_id,
47
47
  "file_ids": file_ids,
48
48
  "template_id": template_id,
49
+ "template_params": template_params,
49
50
  }
50
51
  response = self.api_client.session.post(endpoint, json=data)
51
52
  response.raise_for_status()
@@ -157,3 +158,21 @@ class WorkflowsAPI:
157
158
  if response.status_code == 200:
158
159
  workflow = response.json()
159
160
  return workflow
161
+
162
+ def get_workflow_report(self, workflow_id: int) -> dict[str, Any] | None:
163
+ """Retrieves a workflow report.
164
+
165
+ Args:
166
+ workflow_id: The ID of the workflow to retrieve the report from.
167
+
168
+ Returns:
169
+ The workflow report data.
170
+
171
+ Raises:
172
+ HTTPError: If the API request failed.
173
+ """
174
+ endpoint = f"{self.api_client.base_url}/workflows/{workflow_id}/report/"
175
+ response = self.api_client.session.get(endpoint)
176
+ response.raise_for_status()
177
+ if response.status_code == 200:
178
+ return response.json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openrelik-api-client
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: API client that automatically handles token refresh
5
5
  Author: Johan Berggren
6
6
  Author-email: jberggren@gmail.com
@@ -4,8 +4,8 @@ openrelik_api_client/configs.py,sha256=ns0AF6i9vZq8M-1EKEF4xZ-IpcvDPbTFxn1WMAe_P
4
4
  openrelik_api_client/files.py,sha256=0lWUsMIjUGsz9CGQJFchcfq3myBSaxSZCKPJ1oyMgWQ,8444
5
5
  openrelik_api_client/folders.py,sha256=6Hix2G4WoRPBMQu7HTeV_ZS_lZTj8pZW57NW80riZp4,8118
6
6
  openrelik_api_client/groups.py,sha256=zhR2oq9_PG0ZmFgVHf62T7KWeg7h6mJmXOABScOJGyU,6116
7
- openrelik_api_client/workflows.py,sha256=5DjpNuqGfbLz-glWPqqIZpL6wtHtt2DWsqG-EpFDeRw,5510
8
- openrelik_api_client-0.4.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
9
- openrelik_api_client-0.4.0.dist-info/METADATA,sha256=65UwGhJtWFuEc_Hcfpf7ehjdUbAU6EPsfyxYc8eQQgU,2114
10
- openrelik_api_client-0.4.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
- openrelik_api_client-0.4.0.dist-info/RECORD,,
7
+ openrelik_api_client/workflows.py,sha256=BwIBSjS0krsJWglPiFdAAtcwRMqNmtWDyz9H7UDgHWE,6187
8
+ openrelik_api_client-0.5.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
9
+ openrelik_api_client-0.5.0.dist-info/METADATA,sha256=pcSwYPyaRjtqxonmu6mMPr6YpnKdw4JDkerxXSnYgw8,2114
10
+ openrelik_api_client-0.5.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
+ openrelik_api_client-0.5.0.dist-info/RECORD,,