uipath 2.0.61__py3-none-any.whl → 2.0.63__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.

Potentially problematic release.


This version of uipath might be problematic. Click here for more details.

@@ -384,13 +384,14 @@ class AttachmentsService(FolderContext, BaseService):
384
384
  if source_path:
385
385
  # Upload from file
386
386
  with open(source_path, "rb") as file:
387
+ file_content = file.read()
387
388
  if result["BlobFileAccess"]["RequiresAuth"]:
388
389
  self.request(
389
- "PUT", upload_uri, headers=headers, files={"file": file}
390
+ "PUT", upload_uri, headers=headers, content=file_content
390
391
  )
391
392
  else:
392
393
  with httpx.Client() as client:
393
- client.put(upload_uri, headers=headers, files={"file": file})
394
+ client.put(upload_uri, headers=headers, content=file_content)
394
395
  else:
395
396
  # Upload from memory
396
397
  # Convert string to bytes if needed
@@ -519,13 +520,14 @@ class AttachmentsService(FolderContext, BaseService):
519
520
  if source_path:
520
521
  # Upload from file
521
522
  with open(source_path, "rb") as file:
523
+ file_content = file.read()
522
524
  if result["BlobFileAccess"]["RequiresAuth"]:
523
525
  await self.request_async(
524
- "PUT", upload_uri, headers=headers, files={"file": file}
526
+ "PUT", upload_uri, headers=headers, content=file_content
525
527
  )
526
528
  else:
527
529
  with httpx.Client() as client:
528
- client.put(upload_uri, headers=headers, files={"file": file})
530
+ client.put(upload_uri, headers=headers, content=file_content)
529
531
  else:
530
532
  # Upload from memory
531
533
  # Convert string to bytes if needed
@@ -113,8 +113,6 @@ class JobsService(FolderContext, BaseService):
113
113
 
114
114
  async def main(): # noqa: D103
115
115
  payload = await sdk.jobs.resume_async(job_id="38073051", payload="The response")
116
- print(payload)
117
-
118
116
 
119
117
  asyncio.run(main())
120
118
  ```
@@ -154,11 +152,35 @@ class JobsService(FolderContext, BaseService):
154
152
  def retrieve(
155
153
  self,
156
154
  job_key: str,
155
+ *,
156
+ folder_key: Optional[str] = None,
157
+ folder_path: Optional[str] = None,
157
158
  ) -> Job:
158
- spec = self._retrieve_spec(job_key=job_key)
159
+ """Retrieve a job identified by its key.
160
+
161
+ Args:
162
+ job_key (str): The job unique identifier.
163
+ folder_key (Optional[str]): The key of the folder in which the job was executed.
164
+ folder_path (Optional[str]): The path of the folder in which the job was executed.
165
+
166
+ Returns:
167
+ Job: The retrieved job.
168
+
169
+ Examples:
170
+ ```python
171
+ from uipath import UiPath
172
+
173
+ sdk = UiPath()
174
+ job = sdk.jobs.retrieve(job_key="ee9327fd-237d-419e-86ef-9946b34461e3", folder_path="Shared")
175
+ ```
176
+ """
177
+ spec = self._retrieve_spec(
178
+ job_key=job_key, folder_key=folder_key, folder_path=folder_path
179
+ )
159
180
  response = self.request(
160
181
  spec.method,
161
182
  url=spec.endpoint,
183
+ headers=spec.headers,
162
184
  )
163
185
 
164
186
  return Job.model_validate(response.json())
@@ -166,11 +188,42 @@ class JobsService(FolderContext, BaseService):
166
188
  async def retrieve_async(
167
189
  self,
168
190
  job_key: str,
191
+ *,
192
+ folder_key: Optional[str] = None,
193
+ folder_path: Optional[str] = None,
169
194
  ) -> Job:
170
- spec = self._retrieve_spec(job_key=job_key)
195
+ """Asynchronously retrieve a job identified by its key.
196
+
197
+ Args:
198
+ job_key (str): The job unique identifier.
199
+ folder_key (Optional[str]): The key of the folder in which the job was executed.
200
+ folder_path (Optional[str]): The path of the folder in which the job was executed.
201
+
202
+ Returns:
203
+ Job: The retrieved job.
204
+
205
+ Examples:
206
+ ```python
207
+ import asyncio
208
+
209
+ from uipath import UiPath
210
+
211
+ sdk = UiPath()
212
+
213
+
214
+ async def main(): # noqa: D103
215
+ job = await sdk.jobs.retrieve_async(job_key="ee9327fd-237d-419e-86ef-9946b34461e3", folder_path="Shared")
216
+
217
+ asyncio.run(main())
218
+ ```
219
+ """
220
+ spec = self._retrieve_spec(
221
+ job_key=job_key, folder_key=folder_key, folder_path=folder_path
222
+ )
171
223
  response = await self.request_async(
172
224
  spec.method,
173
225
  url=spec.endpoint,
226
+ headers=spec.headers,
174
227
  )
175
228
 
176
229
  return Job.model_validate(response.json())
@@ -268,12 +321,17 @@ class JobsService(FolderContext, BaseService):
268
321
  self,
269
322
  *,
270
323
  job_key: str,
324
+ folder_key: Optional[str] = None,
325
+ folder_path: Optional[str] = None,
271
326
  ) -> RequestSpec:
272
327
  return RequestSpec(
273
328
  method="GET",
274
329
  endpoint=Endpoint(
275
330
  f"/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.GetByKey(identifier={job_key})"
276
331
  ),
332
+ headers={
333
+ **header_folder(folder_key, folder_path),
334
+ },
277
335
  )
278
336
 
279
337
  @traced(name="jobs_list_attachments", run_type="uipath")
@@ -553,8 +611,12 @@ class JobsService(FolderContext, BaseService):
553
611
 
554
612
  # Get job key from context if not explicitly provided
555
613
  context_job_key = None
556
- if job_key is None and hasattr(self._execution_context, "job_key"):
557
- context_job_key = self._execution_context.job_key
614
+ if job_key is None:
615
+ try:
616
+ context_job_key = self._execution_context.instance_key
617
+ except ValueError:
618
+ # Instance key is not set in environment
619
+ context_job_key = None
558
620
 
559
621
  # Check if a job is available
560
622
  if job_key is not None or context_job_key is not None:
@@ -690,8 +752,12 @@ class JobsService(FolderContext, BaseService):
690
752
 
691
753
  # Get job key from context if not explicitly provided
692
754
  context_job_key = None
693
- if job_key is None and hasattr(self._execution_context, "job_key"):
694
- context_job_key = self._execution_context.job_key
755
+ if job_key is None:
756
+ try:
757
+ context_job_key = self._execution_context.instance_key
758
+ except ValueError:
759
+ # Instance key is not set in environment
760
+ context_job_key = None
695
761
 
696
762
  # Check if a job is available
697
763
  if job_key is not None or context_job_key is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.61
3
+ Version: 2.0.63
4
4
  Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-python
@@ -45,12 +45,12 @@ uipath/_services/_base_service.py,sha256=y-QATIRF9JnUFKIwmjOWMHlE2BrJYgD8y4sGAve
45
45
  uipath/_services/actions_service.py,sha256=LYKvG4VxNGQgZ46AzGK9kI1Txb-YmVvZj5ScPOue8Ls,15989
46
46
  uipath/_services/api_client.py,sha256=hcof0EMa4-phEHD1WlO7Tdfzq6aL18Sbi2aBE7lJm1w,1821
47
47
  uipath/_services/assets_service.py,sha256=acqWogfhZiSO1eeVYqFxmqWGSTmrW46QxI1J0bJe3jo,11918
48
- uipath/_services/attachments_service.py,sha256=h2pEm5YcW0x5F6Ti3CKB7ufg2FBE7MYhyc1mRmuKca4,26372
48
+ uipath/_services/attachments_service.py,sha256=FwnagLtgpn_IpQMvo9uj5mmA_rlyTTiRd4IduB6FpaQ,26458
49
49
  uipath/_services/buckets_service.py,sha256=Ikqt1Cgs_o2-2kuzcogcaBkNceSQDXLEe63kzkHzWqk,17374
50
50
  uipath/_services/connections_service.py,sha256=qh-HNL_GJsyPUD0wSJZRF8ZdrTE9l4HrIilmXGK6dDk,4581
51
51
  uipath/_services/context_grounding_service.py,sha256=zS991jW8C8CLkXvJwB2SuY3edTRG84SUOmiXpKId2Go,24381
52
52
  uipath/_services/folder_service.py,sha256=h0CWNqF2-8w2QLrfy-D8P3z_qA81Te689OXlFKtnby0,2001
53
- uipath/_services/jobs_service.py,sha256=I2-iqjMJcfgz5sgVOMWF5PkGzch_1q1swUstdv2PpMo,27308
53
+ uipath/_services/jobs_service.py,sha256=JiqHhfpe-a9G7sQq_TyHUvGkce5I1e_Bda533b5LvkY,29406
54
54
  uipath/_services/llm_gateway_service.py,sha256=ySg3sflIoXmY9K7txlSm7bkuI2qzBT0kAKmGlFBk5KA,12032
55
55
  uipath/_services/processes_service.py,sha256=b-c4ynjcgS0ymp130r0lI93z7DF989u8HWOmWCux754,5727
56
56
  uipath/_services/queues_service.py,sha256=VaG3dWL2QK6AJBOLoW2NQTpkPfZjsqsYPl9-kfXPFzA,13534
@@ -87,8 +87,8 @@ uipath/tracing/__init__.py,sha256=GKRINyWdHVrDsI-8mrZDLdf0oey6GHGlNZTOADK-kgc,22
87
87
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
88
88
  uipath/tracing/_traced.py,sha256=UL0TBqUexYb2PuUIY_am9l0TEeRGXFdxKEcDq5J-NXQ,16319
89
89
  uipath/tracing/_utils.py,sha256=ZeensQexnw69jVcsVrGyED7mPlAU-L1agDGm6_1A3oc,10388
90
- uipath-2.0.61.dist-info/METADATA,sha256=qh7FjyhDyqQPqGX8PmuQQ057AGljmoHCZKTGZtUZnlQ,6304
91
- uipath-2.0.61.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
- uipath-2.0.61.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
93
- uipath-2.0.61.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
94
- uipath-2.0.61.dist-info/RECORD,,
90
+ uipath-2.0.63.dist-info/METADATA,sha256=5KVy_f28alxFsAHE2alkPSAa89ppEVaRm3ELkU9xV4c,6304
91
+ uipath-2.0.63.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
+ uipath-2.0.63.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
93
+ uipath-2.0.63.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
94
+ uipath-2.0.63.dist-info/RECORD,,