Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath_sdk"
version = "0.0.1"
version = "0.0.2"
description = "UiPath Client for the UiPath API"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
22 changes: 13 additions & 9 deletions src/uipath_sdk/_assets_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ def retrieve(
UserAsset,
self.client.post(
"/orchestrator_/odata/Assets/UiPath.Server.Configuration.OData.GetRobotAssetByNameForRobotKey",
data={
"assetName": assetName,
"robotKey": robotKey,
"supportsCredentialsProxyDisconnected": True,
},
content=str(
{
"assetName": assetName,
"robotKey": robotKey,
"supportsCredentialsProxyDisconnected": True,
}
),
).json(),
)

Expand All @@ -50,8 +52,10 @@ def update(
) -> None:
self.client.post(
"/orchestrator_/odata/Assets/UiPath.Server.Configuration.OData.SetRobotAssetByRobotKey",
data={
"robotKey": robotKey,
"robotAsset": robotAsset,
},
content=str(
{
"robotKey": robotKey,
"robotAsset": robotAsset,
}
),
)
10 changes: 7 additions & 3 deletions src/uipath_sdk/_processes_service.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from httpx import Response

from ._base_service import BaseService


class ProcessesService(BaseService):
# FIXME: endpoint?
def invoke_process(self) -> None:
pass
def invoke_process(self, release_key: str) -> Response:
return self.client.post(
"/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs",
content=str({"startInfo": {"ReleaseKey": release_key}}),
)
3 changes: 3 additions & 0 deletions src/uipath_sdk/_uipath_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from httpx import Client, Headers

from ._assets_service import RobotAssetsService
from ._processes_service import ProcessesService
from ._uipath_client_config import UiPathClientConfig


Expand Down Expand Up @@ -28,6 +29,7 @@ def _init_http_client(self) -> None:
k: v
for k, v in {
"Authorization": f"Bearer {self.config.secret}",
"Content-Type": "application/json",
"x-uipath-organizationunitid": self.config.folder_id,
}.items()
if v is not None
Expand All @@ -37,3 +39,4 @@ def _init_http_client(self) -> None:

def _init_services(self) -> None:
self.robot_assets = RobotAssetsService(self._http_client)
self.processes = ProcessesService(self._http_client)