diff --git a/pyproject.toml b/pyproject.toml index 992614663..5968c9a71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/uipath_sdk/_assets_service.py b/src/uipath_sdk/_assets_service.py index 3565d5d4b..e009b9d86 100644 --- a/src/uipath_sdk/_assets_service.py +++ b/src/uipath_sdk/_assets_service.py @@ -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(), ) @@ -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, + } + ), ) diff --git a/src/uipath_sdk/_processes_service.py b/src/uipath_sdk/_processes_service.py index 9e34e8d17..523572898 100644 --- a/src/uipath_sdk/_processes_service.py +++ b/src/uipath_sdk/_processes_service.py @@ -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}}), + ) diff --git a/src/uipath_sdk/_uipath_client.py b/src/uipath_sdk/_uipath_client.py index c52c74fbc..bae5aeed4 100644 --- a/src/uipath_sdk/_uipath_client.py +++ b/src/uipath_sdk/_uipath_client.py @@ -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 @@ -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 @@ -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)